[][src]Module seq_io::fastq::multiline

FASTQ reading with multi-line FASTQ support.

Behaviour

  • Since the quality scores can contain @, this parser always compares sequence and quality score lengths, internal @ are ignored.
  • Sequence and quality lines are not optional. The following is not a valid record: @id\n+\n. The minimal valid (though empty) record would be @id\n\n+\n\n.

Writing multi-line FASTQ is not possible. This is on purpose, since multi-line FASTQ is problematic and its use discouraged by many people.

Example

use seq_io::prelude::*;
use seq_io::fastq::multiline::Reader;

let seq = b"@id
SEQU
ENCE
+
II
@EI
III
";

let mut reader = Reader::new(&seq[..]);

let rec = reader.next().unwrap().unwrap();

assert_eq!(rec.id(), Ok("id"));
assert_eq!(rec.seq(), b"SEQU\nENCE");
assert_eq!(rec.full_seq().as_ref(), b"SEQUENCE");
assert_eq!(rec.full_qual().as_ref(), b"II@EIIII");

Note that even if the second line of the quality string starts with a @, it is recognized as internal quality score because it is assumed that sequence and quality lengths are the same. If they were different, it may confuse the parser and lead to weird errors.

Structs

MultiRangeStore
Reader

FASTQ parser

RecordsIntoIter

Iterator of OwnedRecord that owns the underlying reader

RecordsIter

Borrowed iterator of OwnedRecord