Struct fqtk_lib::samples::SampleGroup
source · pub struct SampleGroup {
pub samples: Vec<Sample>,
}Expand description
Struct for storing information about multiple samples and for defining functions associated
with groups of Samples, rather than individual structs.
Fields§
§samples: Vec<Sample>A group of samples
Implementations§
source§impl SampleGroup
impl SampleGroup
sourcepub fn from_samples(samples: &[Sample]) -> Self
pub fn from_samples(samples: &[Sample]) -> Self
Validates a group of Samples and instantiates a Self struct if they are
valid. Will clone the Sample structs and change the number on the ordinal field on
those cloneto match the order in which they are stored in this Self
Panics
- Will panic if sample metadata sheet is improperly formatted
- Will panic if there are duplicate sample names provided
- Will panic if there are duplicate barcodes provided
- Will panic if barcodes don’t all have the same length
sourcepub fn from_file<P: AsRef<Path>>(path: &P) -> Result<SampleGroup, FgError>
pub fn from_file<P: AsRef<Path>>(path: &P) -> Result<SampleGroup, FgError>
Attempts to load a Self object from a file. File should be delimeted with
delimiter, should have a header with name and barcode fields present.
Errors
- Will error if file cannot be read, either due to not the file not existing or due to the format being different from the format expected.
Panics
- Will panic if sample metadata sheet is improperly formatted
- Will panic if a different number of names and barcodes are provided
- Will panic if each
Trait Implementations§
source§impl Clone for SampleGroup
impl Clone for SampleGroup
source§fn clone(&self) -> SampleGroup
fn clone(&self) -> SampleGroup
Returns a copy 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 Debug for SampleGroup
impl Debug for SampleGroup
source§impl Display for SampleGroup
impl Display for SampleGroup
source§impl PartialEq<SampleGroup> for SampleGroup
impl PartialEq<SampleGroup> for SampleGroup
source§fn eq(&self, other: &SampleGroup) -> bool
fn eq(&self, other: &SampleGroup) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for SampleGroup
impl StructuralEq for SampleGroup
impl StructuralPartialEq for SampleGroup
Auto Trait Implementations§
impl RefUnwindSafe for SampleGroup
impl Send for SampleGroup
impl Sync for SampleGroup
impl Unpin for SampleGroup
impl UnwindSafe for SampleGroup
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