[][src]Struct cgats::Cgats

pub struct Cgats {
    pub vendor: Option<Vendor>,
    pub meta: DataVec,
    pub fields: Vec<Field>,
    pub data_map: BTreeMap<usize, Sample>,
}

Fields

vendor: Option<Vendor>meta: DataVecfields: Vec<Field>data_map: BTreeMap<usize, Sample>

Methods

impl Cgats[src]

pub fn new() -> Cgats[src]

Create a new empty CGATS object

pub fn sample_count(&self) -> usize[src]

Returns the number of samples in the data

pub fn new_with_vendor(vendor: Vendor) -> Cgats[src]

Create a new empty CGATS object with a Vendor

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Cgats>[src]

Create a CGATS object from an existing CGATS file

pub fn write_to_file<P: AsRef<Path>>(&self, file: P) -> Result<()>[src]

Write a CGATS object to a properly formatted CGATS file

pub fn format(&self) -> String[src]

Format the entire CGATS object to a string

impl Cgats[src]

pub fn average(collection: Vec<Cgats>) -> Result<Cgats>[src]

Average all the values in a collection of CGATS. Returns an Error if the DATA_FORMATS or NUMBER_OF_SAMPLES don't match.

pub fn concatenate(collection: Vec<Cgats>) -> Result<Cgats>[src]

Concatente multiple CGATS file from a collection. Returns an Error if the DATA_FORMATS don't match.

pub fn deltae(self, other: Cgats, method: DEMethod) -> Result<Cgats>[src]

Calculate DELTA E of all samples between exactly 2 CGATS objects. Returns an Error if both CGATS do not contain LAB, or if the NUMBER_OF_SAMPLES differ.

pub fn de_method(&self) -> Result<(usize, DEMethod)>[src]

Returns the index and the first DEMethod found in the DATA_FORMAT Returns an error if no DE is found

pub fn field_index(&self, field: &Field) -> Option<usize>[src]

Returns the index of a given Field, returns None if not present.

pub fn reindex_sample_id(&mut self)[src]

Replace SAMPLE_ID values with the index of the sample (starting from 0)

pub fn insert_sample_id(&mut self)[src]

Insert SAMPLE_ID field into CGATS object

Trait Implementations

impl PartialEq<Cgats> for Cgats[src]

impl Default for Cgats[src]

impl Clone for Cgats[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Cgats[src]

impl Debug for Cgats[src]

Auto Trait Implementations

impl Send for Cgats

impl Sync for Cgats

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.