[][src]Struct genomics::Sample

pub struct Sample { /* fields omitted */ }

Implementations

impl Sample[src]

pub fn new() -> Self[src]

Constructs a new empty Sample

The Sample can be filled up iteratively by calling observation().

pub fn flush(&mut self) -> Result<(), Box<dyn Error>>[src]

Recreates the Sample's matrix.

This function is called before a matrix calculation so there is no need to explicitly call it after observing data.

pub fn allele(&mut self, locus: &str, variation: &str) -> Allele[src]

Returns the allele in this locus

This will create the locus and allele if needed and mark the Sample as dirty. Dirty samples will updated before the next call that requires a matrix calculation or when flush() is called.

pub fn group(&mut self, group: &str) -> Arc<Group>[src]

Returns a reference to a Group

This will create the Group if needed and mark the Sample as dirty.

pub fn _observe(&mut self, observation: Observation)[src]

Observes a single Observation

This function is normally called by a Sample's observe function to read in data. To read in data from an arbitrary data source. Implement an Iterator with type Item = Observation.

pub fn observe<I>(&mut self, observable: I) -> Result<(), Box<dyn Error>> where
    I: Iterator<Item = Result<Observation, Box<dyn Error>>>, 
[src]

Observe all the data in the argument.

pub fn loci_names(&self) -> Vec<&String>[src]

A list of the names of all loci in a sample

Trait Implementations

impl<'_> From<&'_ Sample> for Vec<AlleleCount>[src]

Auto Trait Implementations

impl RefUnwindSafe for Sample

impl Send for Sample

impl Sync for Sample

impl Unpin for Sample

impl UnwindSafe for Sample

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.