/// Writes output record into output files
Writes output record into output files
Writes output record into output files
fn write_impl(&mut self, record: &NextalignRecord) -> Result<(), Report> {
    let NextalignRecord {
      index,
      seq_name,
      outputs_or_err,
    } = record;
    match outputs_or_err {
      Ok(output) => {
        let NextalignOutputs {
          stripped,
          alignment,
          translations,
          warnings,
          missing_genes,
        } = output;
        if let Some(fasta_writer) = &mut self.fasta_writer {
          fasta_writer.write(seq_name, &from_nuc_seq(&stripped.qry_seq))?;
        }
        if let Some(fasta_peptide_writer) = &mut self.fasta_peptide_writer {
          for translation in translations {
            fasta_peptide_writer.write(seq_name, translation)?;
          }
        }
        if let Some(insertions_csv_writer) = &mut self.insertions_csv_writer {
          insertions_csv_writer.write(seq_name, &stripped.insertions, translations)?;
        }
        if let Some(errors_csv_writer) = &mut self.errors_csv_writer {
          errors_csv_writer.write_aa_errors(seq_name, warnings, missing_genes)?;
        }
      }
      Err(report) => {
        let cause = report_to_string(report);
        let message = format!(
          "In sequence #{index} '{seq_name}': {cause}. Note that this sequence will not be included in the results."
        );
        warn!("{message}");
        if let Some(errors_csv_writer) = &mut self.errors_csv_writer {
          errors_csv_writer.write_nuc_error(seq_name, &message)?;
        }
      }
    }
    Ok(())
  }
fn write_impl ( & mut self , record : & NextalignRecord ) -> Result < ( ) , Report > { let NextalignRecord { index , seq_name , outputs_or_err , } = record ; match outputs_or_err { Ok ( output ) => { let NextalignOutputs { stripped , alignment , translations , warnings , missing_genes , } = output ; if let Some ( fasta_writer ) = & mut self . fasta_writer { fasta_writer . write ( seq_name , & from_nuc_seq ( & stripped . qry_seq ) ) ? ; } if let Some ( fasta_peptide_writer ) = & mut self . fasta_peptide_writer { for translation in translations { fasta_peptide_writer . write ( seq_name , translation ) ? ; } } if let Some ( insertions_csv_writer ) = & mut self . insertions_csv_writer { insertions_csv_writer . write ( seq_name , & stripped . insertions , translations ) ? ; } if let Some ( errors_csv_writer ) = & mut self . errors_csv_writer { errors_csv_writer . write_aa_errors ( seq_name , warnings , missing_genes ) ? ; } } Err ( report ) => { let cause = report_to_string ( report ) ; let message = format ! ( " " ) ; warn ! ( " " ) ; if let Some ( errors_csv_writer ) = & mut self . errors_csv_writer { errors_csv_writer . write_nuc_error ( seq_name , & message ) ? ; } } } Ok ( ( ) ) }
Writes output record into output files
Writes output record into output files
&mut self
record
&NextalignRecord