pub fn read_records<'a, TNucleotide, TLines>(lines: TLines) -> Vec<Fasta<TNucleotide>>
where
  TNucleotide: Nucleotide,
  TLines: Iterator<Item = &'a str>,
  <TNucleotide as TryFrom<char>>::Error: std::fmt::Debug,
{
  let mut records: Vec<Fasta<TNucleotide>> = vec![];
  let mut current_lines: Vec<&str> = vec![];
  for line in lines {
    if line.starts_with(">") {
      if !current_lines.is_empty() {
        records.push(Fasta::from(current_lines.into_iter()));
      }
      current_lines = vec![];
    }
    current_lines.push(line);
  }
  if !current_lines.is_empty() {
    records.push(Fasta::from(current_lines.into_iter()));
  }
  records
}
/// reads the lines into a list of FASTA records
reads the lines into a list of FASTA records
reads the lines into a list of FASTA records
pub fn read_records<'a, TNucleotide, TLines>(lines: TLines) -> Vec<Fasta<TNucleotide>>
where
  TNucleotide: Nucleotide,
  TLines: Iterator<Item = &'a str>,
  <TNucleotide as TryFrom<char>>::Error: std::fmt::Debug,
{
  let mut records: Vec<Fasta<TNucleotide>> = vec![];
  let mut current_lines: Vec<&str> = vec![];
  for line in lines {
    if line.starts_with(">") {
      if !current_lines.is_empty() {
        records.push(Fasta::from(current_lines.into_iter()));
      }
      current_lines = vec![];
    }
    current_lines.push(line);
  }
  if !current_lines.is_empty() {
    records.push(Fasta::from(current_lines.into_iter()));
  }
  records
}
pub fn read_records < ' a , TNucleotide , TLines > ( lines : TLines ) -> Vec < Fasta < TNucleotide > > where TNucleotide : Nucleotide , TLines : Iterator < Item = & ' a str > , < TNucleotide as TryFrom < char > > :: Error : std :: fmt :: Debug , { let mut records : Vec < Fasta < TNucleotide > > = vec ! [ ] ; let mut current_lines : Vec < & str > = vec ! [ ] ; for line in lines { if line . starts_with ( " " ) { if ! current_lines . is_empty ( ) { records . push ( Fasta :: from ( current_lines . into_iter ( ) ) ) ; } current_lines = vec ! [ ] ; } current_lines . push ( line ) ; } if ! current_lines . is_empty ( ) { records . push ( Fasta :: from ( current_lines . into_iter ( ) ) ) ; } records }
reads the lines into a list of FASTA records
reads the lines into a list of FASTA records
lines
TLines
lines
TLines