pub struct SequenceRef<'a> { /* private fields */ }Expand description
One FASTA or FASTQ record, borrowed from the reader that produced it.
Valid only until the next record is read. Call SequenceRef::to_owned to
keep one.
Identifiers are &[u8] rather than &str deliberately: validating UTF-8 is
work this type exists to avoid, and sequence identifiers are ASCII in
practice. SequenceRef::id_str converts when you need text, borrowing
rather than allocating whenever the bytes are already valid UTF-8.
Implementations§
Source§impl<'a> SequenceRef<'a>
impl<'a> SequenceRef<'a>
Sourcepub fn id_str(&self) -> Cow<'a, str>
pub fn id_str(&self) -> Cow<'a, str>
The identifier as text, replacing anything that is not UTF-8.
Borrows when the bytes are already valid UTF-8, which is the normal case.
Sourcepub fn description(&self) -> Option<&'a [u8]>
pub fn description(&self) -> Option<&'a [u8]>
Everything after the first whitespace in the header, if any.
Sourcepub fn description_str(&self) -> Option<Cow<'a, str>>
pub fn description_str(&self) -> Option<Cow<'a, str>>
The description as text, replacing anything that is not UTF-8.
Sourcepub fn quality(&self) -> Option<&'a [u8]>
pub fn quality(&self) -> Option<&'a [u8]>
The Phred quality characters, FASTQ only, always Phred+33.
Sourcepub fn has_quality(&self) -> bool
pub fn has_quality(&self) -> bool
True when the record carries quality scores.
Sourcepub fn base_counts(&self) -> BaseCounts
pub fn base_counts(&self) -> BaseCounts
Per-base counts.
Sourcepub fn gc_content(&self) -> Option<f64>
pub fn gc_content(&self) -> Option<f64>
GC fraction over unambiguous bases, None when there are none.
Sourcepub fn mean_quality(&self) -> Option<f64>
pub fn mean_quality(&self) -> Option<f64>
Error-probability-weighted mean quality (Phred+33).
Sourcepub fn expected_errors(&self) -> Option<f64>
pub fn expected_errors(&self) -> Option<f64>
Expected number of sequencing errors in the read (Phred+33).
Sourcepub fn kmers(&self, k: usize) -> impl Iterator<Item = &'a [u8]>
pub fn kmers(&self, k: usize) -> impl Iterator<Item = &'a [u8]>
Iterator over overlapping k-mers.
Trait Implementations§
Source§impl<'a> Clone for SequenceRef<'a>
impl<'a> Clone for SequenceRef<'a>
Source§fn clone(&self) -> SequenceRef<'a>
fn clone(&self) -> SequenceRef<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for SequenceRef<'a>
Source§impl<'a> Debug for SequenceRef<'a>
impl<'a> Debug for SequenceRef<'a>
impl<'a> Eq for SequenceRef<'a>
Source§impl<'a> Hash for SequenceRef<'a>
impl<'a> Hash for SequenceRef<'a>
Source§impl<'a> PartialEq for SequenceRef<'a>
impl<'a> PartialEq for SequenceRef<'a>
Source§impl PartialEq<Sequence> for SequenceRef<'_>
impl PartialEq<Sequence> for SequenceRef<'_>
impl<'a> StructuralPartialEq for SequenceRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for SequenceRef<'a>
impl<'a> RefUnwindSafe for SequenceRef<'a>
impl<'a> Send for SequenceRef<'a>
impl<'a> Sync for SequenceRef<'a>
impl<'a> Unpin for SequenceRef<'a>
impl<'a> UnsafeUnpin for SequenceRef<'a>
impl<'a> UnwindSafe for SequenceRef<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more