Struct noodles_fastq::Reader [−][src]
pub struct Reader<R> { /* fields omitted */ }
Expand description
A FASTQ reader.
Implementations
Creates a FASTQ reader.
Examples
use noodles_fastq as fastq; let data = b"@r0\nATCG\n+\nNDLS\n"; let reader = fastq::Reader::new(&data[..]);
Reads a FASTQ record.
This reads from the underlying stream until four lines are read: the read name, the sequence, the plus line, and the quality scores. Each line omits the trailing newline.
The stream is expected to be at the start of a record.
If successful, the number of bytes read is returned. If the number of bytes read is 0, the stream reached EOF.
Examples
use noodles_fastq as fastq; let data = b"@r0\nATCG\n+\nNDLS\n"; let mut reader = fastq::Reader::new(&data[..]); let mut record = fastq::Record::default(); reader.read_record(&mut record)?; assert_eq!(record.read_name(), b"r0"); assert_eq!(record.sequence(), b"ATCG"); assert_eq!(record.quality_scores(), b"NDLS"); Ok::<(), io::Error>(())
Returns an iterator over records starting from the current stream position.
The stream is expected to be at the start of a record.
Examples
use noodles_fastq as fastq; let data = b"@r0\nATCG\n+\nNDLS\n"; let mut reader = fastq::Reader::new(&data[..]); let mut records = reader.records(); assert_eq!( records.next().transpose()?, Some(fastq::Record::new("r0", "ATCG", "NDLS") )); assert!(records.next().is_none());
Auto Trait Implementations
impl<R> RefUnwindSafe for Reader<R> where
R: RefUnwindSafe,
impl<R> UnwindSafe for Reader<R> where
R: UnwindSafe,