pub struct Genotype { /* private fields */ }Expand description
A parsed genotype for a single sample at a variant site.
Alleles are 0-indexed where 0 means reference and 1+ means the Nth
alternate allele. None represents a missing allele (. in VCF).
Implementations§
Source§impl Genotype
impl Genotype
Sourcepub fn parse(gt: &str) -> Result<Self>
pub fn parse(gt: &str) -> Result<Self>
Parse a VCF GT field string (e.g. "0/1", "1|0", "0|1|2",
"./.", "0").
Returns the parsed genotype with allele indices and phasing information.
§Errors
Returns an error if the GT string is empty or contains invalid allele values.
Sourcepub fn is_hom_alt(&self) -> bool
pub fn is_hom_alt(&self) -> bool
Return true if all alleles are the same non-reference allele.
Sourcepub fn is_hom_ref(&self) -> bool
pub fn is_hom_ref(&self) -> bool
Return true if all alleles are reference (index 0).
Trait Implementations§
impl Eq for Genotype
impl StructuralPartialEq for Genotype
Auto Trait Implementations§
impl Freeze for Genotype
impl RefUnwindSafe for Genotype
impl Send for Genotype
impl Sync for Genotype
impl Unpin for Genotype
impl UnsafeUnpin for Genotype
impl UnwindSafe for Genotype
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.