pub struct AlleleVariant<T> {
pub allele_one: Allele<T>,
pub allele_two: Option<Allele<T>>,
pub phase: Option<AllelePhase>,
pub alleles_unphased: Vec<Allele<T>>,
}Expand description
Allele container holding an initial allele, an optional second established allele, and any later unphased alleles.
§Examples
use tinyhgvs::{AllelePhase, VariantDescription, parse_hgvs};
let variant = parse_hgvs("NM_004006.2:c.[2376G>C];[2376=]").unwrap();
match variant.description {
VariantDescription::NucleotideAllele(allele) => {
assert_eq!(allele.allele_one.variants.len(), 1);
assert!(allele.allele_two.is_some());
assert_eq!(allele.phase, Some(AllelePhase::Trans));
assert_eq!(allele.iter().count(), 2);
}
_ => unreachable!("expected nucleotide allele"),
}Fields§
§allele_one: Allele<T>§allele_two: Option<Allele<T>>§phase: Option<AllelePhase>§alleles_unphased: Vec<Allele<T>>Implementations§
Source§impl<T> AlleleVariant<T>
impl<T> AlleleVariant<T>
Sourcepub fn phased_alleles(&self) -> Option<(&Allele<T>, &Allele<T>)>
pub fn phased_alleles(&self) -> Option<(&Allele<T>, &Allele<T>)>
Returns the established trans allele pair when the relation is known.
Sourcepub fn unphased_alleles(&self) -> &[Allele<T>]
pub fn unphased_alleles(&self) -> &[Allele<T>]
Returns any later alleles written in uncertain relation to the established allele state.
Trait Implementations§
Source§impl<T: Clone> Clone for AlleleVariant<T>
impl<T: Clone> Clone for AlleleVariant<T>
Source§fn clone(&self) -> AlleleVariant<T>
fn clone(&self) -> AlleleVariant<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for AlleleVariant<T>
impl<T: Debug> Debug for AlleleVariant<T>
Source§impl<'a, T> IntoIterator for &'a AlleleVariant<T>
impl<'a, T> IntoIterator for &'a AlleleVariant<T>
Source§impl<T: PartialEq> PartialEq for AlleleVariant<T>
impl<T: PartialEq> PartialEq for AlleleVariant<T>
impl<T: Eq> Eq for AlleleVariant<T>
impl<T> StructuralPartialEq for AlleleVariant<T>
Auto Trait Implementations§
impl<T> Freeze for AlleleVariant<T>
impl<T> RefUnwindSafe for AlleleVariant<T>where
T: RefUnwindSafe,
impl<T> Send for AlleleVariant<T>where
T: Send,
impl<T> Sync for AlleleVariant<T>where
T: Sync,
impl<T> Unpin for AlleleVariant<T>where
T: Unpin,
impl<T> UnsafeUnpin for AlleleVariant<T>
impl<T> UnwindSafe for AlleleVariant<T>where
T: UnwindSafe,
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