pub enum QualityEncoding {
Phred33,
Phred64,
}Expand description
The ASCII offset used by a FASTQ quality string.
Deliberately not #[non_exhaustive]: these two are the whole of the
offset-encoded world. Solexa’s old scheme is not a third offset but a
different formula, so it could not join this enum without changing what
QualityEncoding::offset means.
Variants§
Implementations§
Source§impl QualityEncoding
impl QualityEncoding
Sourcepub fn detect(quality: &[u8]) -> Option<QualityEncoding>
pub fn detect(quality: &[u8]) -> Option<QualityEncoding>
Guess the encoding from observed quality characters.
Returns None when the sample is compatible with both encodings, which
is common for short high-quality samples — callers should then keep their
current default rather than guessing.
use fastx::qual::QualityEncoding;
assert_eq!(QualityEncoding::detect(b"!!##$$"), Some(QualityEncoding::Phred33));
assert_eq!(QualityEncoding::detect(b"hhhhhh"), Some(QualityEncoding::Phred64));
assert_eq!(QualityEncoding::detect(b"IIIIII"), None);Trait Implementations§
Source§impl Clone for QualityEncoding
impl Clone for QualityEncoding
Source§fn clone(&self) -> QualityEncoding
fn clone(&self) -> QualityEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for QualityEncoding
Source§impl Debug for QualityEncoding
impl Debug for QualityEncoding
Source§impl Default for QualityEncoding
impl Default for QualityEncoding
Source§fn default() -> QualityEncoding
fn default() -> QualityEncoding
Returns the “default value” for a type. Read more
impl Eq for QualityEncoding
Source§impl Hash for QualityEncoding
impl Hash for QualityEncoding
Source§impl PartialEq for QualityEncoding
impl PartialEq for QualityEncoding
impl StructuralPartialEq for QualityEncoding
Auto Trait Implementations§
impl Freeze for QualityEncoding
impl RefUnwindSafe for QualityEncoding
impl Send for QualityEncoding
impl Sync for QualityEncoding
impl Unpin for QualityEncoding
impl UnsafeUnpin for QualityEncoding
impl UnwindSafe for QualityEncoding
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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