pub struct Allele { /* private fields */ }
Expand description
A VCF record genotype value allele.
Implementations§
source§impl Allele
impl Allele
sourcepub fn new(position: Option<usize>, phasing: Phasing) -> Allele
pub fn new(position: Option<usize>, phasing: Phasing) -> Allele
Creates a variant record samples genotype value allele.
§Examples
use noodles_vcf::variant::{
record::samples::series::value::genotype::Phasing,
record_buf::samples::sample::value::genotype::Allele,
};
let allele = Allele::new(Some(0), Phasing::Phased);
sourcepub fn position(&self) -> Option<usize>
pub fn position(&self) -> Option<usize>
Returns the position of the allele.
§Examples
use noodles_vcf::variant::{
record::samples::series::value::genotype::Phasing,
record_buf::samples::sample::value::genotype::Allele,
};
let allele = Allele::new(Some(0), Phasing::Phased);
assert_eq!(allele.position(), Some(0));
sourcepub fn position_mut(&mut self) -> &mut Option<usize>
pub fn position_mut(&mut self) -> &mut Option<usize>
Returns a mutable reference to the position of the allele.
§Examples
use noodles_vcf::variant::{
record::samples::series::value::genotype::Phasing,
record_buf::samples::sample::value::genotype::Allele,
};
let mut allele = Allele::new(Some(0), Phasing::Phased);
*allele.position_mut() = Some(1);
assert_eq!(allele.position(), Some(1));
sourcepub fn phasing(&self) -> Phasing
pub fn phasing(&self) -> Phasing
Returns the phasing of the allele.
§Examples
use noodles_vcf::variant::{
record::samples::series::value::genotype::Phasing,
record_buf::samples::sample::value::genotype::Allele,
};
let allele = Allele::new(Some(0), Phasing::Phased);
assert_eq!(allele.phasing(), Phasing::Phased);
sourcepub fn phasing_mut(&mut self) -> &mut Phasing
pub fn phasing_mut(&mut self) -> &mut Phasing
Returns a mutable reference to the phasing of the allele.
§Examples
use noodles_vcf::variant::{
record::samples::series::value::genotype::Phasing,
record_buf::samples::sample::value::genotype::Allele,
};
let mut allele = Allele::new(Some(0), Phasing::Phased);
*allele.phasing_mut() = Phasing::Unphased;
assert_eq!(allele.phasing(), Phasing::Unphased);
Trait Implementations§
source§impl Extend<Allele> for Genotype
impl Extend<Allele> for Genotype
source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Allele>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Allele>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl FromIterator<Allele> for Genotype
impl FromIterator<Allele> for Genotype
source§impl PartialEq for Allele
impl PartialEq for Allele
impl Eq for Allele
impl StructuralPartialEq for Allele
Auto Trait Implementations§
impl Freeze for Allele
impl RefUnwindSafe for Allele
impl Send for Allele
impl Sync for Allele
impl Unpin for Allele
impl UnwindSafe for Allele
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<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.