Struct noodles_sam::header::read_group::ReadGroup
source · [−]pub struct ReadGroup { /* private fields */ }
Expand description
A SAM header read group.
A read group typically defines the set of reads that came from the same run on a sequencing instrument. The read group ID is guaranteed to be set.
Implementations
sourceimpl ReadGroup
impl ReadGroup
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a SAM header read group builder.
Examples
use noodles_sam::header::ReadGroup;
let builder = ReadGroup::builder();
sourcepub fn new<I>(id: I) -> Self where
I: Into<String>,
pub fn new<I>(id: I) -> Self where
I: Into<String>,
Creates a read group with an ID.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert_eq!(read_group.id(), "rg0");
sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
Returns the read group ID.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert_eq!(read_group.id(), "rg0");
sourcepub fn id_mut(&mut self) -> &mut String
pub fn id_mut(&mut self) -> &mut String
Returns a mutable reference to the read group ID.
Examples
use noodles_sam::header::ReadGroup;
let mut read_group = ReadGroup::new("rg0");
assert_eq!(read_group.id(), "rg0");
*read_group.id_mut() = String::from("rg1");
assert_eq!(read_group.id(), "rg1");
sourcepub fn barcode(&self) -> Option<&str>
pub fn barcode(&self) -> Option<&str>
Returns the barcode sequence.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.barcode().is_none());
sourcepub fn sequencing_center(&self) -> Option<&str>
pub fn sequencing_center(&self) -> Option<&str>
Returns the sequencing center.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.sequencing_center().is_none());
sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Returns the description.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.description().is_none());
sourcepub fn produced_at(&self) -> Option<&str>
pub fn produced_at(&self) -> Option<&str>
Returns the datatime of run.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.produced_at().is_none());
sourcepub fn flow_order(&self) -> Option<&str>
pub fn flow_order(&self) -> Option<&str>
Returns the flow order.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.flow_order().is_none());
sourcepub fn key_sequence(&self) -> Option<&str>
pub fn key_sequence(&self) -> Option<&str>
Returns the key sequence.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.key_sequence().is_none());
sourcepub fn library(&self) -> Option<&str>
pub fn library(&self) -> Option<&str>
Returns the library.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.library().is_none());
sourcepub fn program(&self) -> Option<&str>
pub fn program(&self) -> Option<&str>
Returns the programs used.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.program().is_none());
sourcepub fn predicted_median_insert_size(&self) -> Option<i32>
pub fn predicted_median_insert_size(&self) -> Option<i32>
Returns the predicted median insert size.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.predicted_median_insert_size().is_none());
sourcepub fn platform(&self) -> Option<Platform>
pub fn platform(&self) -> Option<Platform>
Returns the platform used.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.platform().is_none());
sourcepub fn platform_model(&self) -> Option<&str>
pub fn platform_model(&self) -> Option<&str>
Returns the platform model.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.platform_model().is_none());
sourcepub fn platform_unit(&self) -> Option<&str>
pub fn platform_unit(&self) -> Option<&str>
Returns the platform unit.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.platform_unit().is_none());
sourcepub fn sample(&self) -> Option<&str>
pub fn sample(&self) -> Option<&str>
Returns the sample.
Examples
use noodles_sam::header::ReadGroup;
let read_group = ReadGroup::new("rg0");
assert!(read_group.sample().is_none());
sourcepub fn fields(&self) -> &HashMap<Tag, String>
pub fn fields(&self) -> &HashMap<Tag, String>
Returns the raw fields of the read group.
This includes any field that is not specially handled by the structure itself. For example,
this will not include the ID field, as it is parsed and available as Self::id
.
Examples
use noodles_sam::header::{read_group::Tag, ReadGroup};
let zn = Tag::Other([b'z', b'n']);
let read_group = ReadGroup::builder()
.set_id("rg0")
.insert(zn, String::from("noodles"))
.build()?;
let fields = read_group.fields();
assert_eq!(fields.len(), 1);
assert_eq!(fields.get(&zn), Some(&String::from("noodles")));
assert_eq!(fields.get(&Tag::Id), None);
assert_eq!(read_group.id(), "rg0");
Trait Implementations
impl Eq for ReadGroup
impl StructuralEq for ReadGroup
impl StructuralPartialEq for ReadGroup
Auto Trait Implementations
impl RefUnwindSafe for ReadGroup
impl Send for ReadGroup
impl Sync for ReadGroup
impl Unpin for ReadGroup
impl UnwindSafe for ReadGroup
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more