Struct noodles_sam::alignment::record_buf::Cigar
source · pub struct Cigar(/* private fields */);
Expand description
An alignment record CIGAR operations buffer.
Implementations§
source§impl Cigar
impl Cigar
sourcepub fn alignment_span(&self) -> usize
pub fn alignment_span(&self) -> usize
Calculates the alignment span over the reference sequence.
This sums the lengths of the CIGAR operations that consume the reference sequence, i.e.,
alignment matches (M
), deletions from the reference (D
), skipped reference regions
(S
), sequence matches (=
), and sequence mismatches (X
).
§Examples
use noodles_sam::alignment::{
record::cigar::{op::Kind, Op},
record_buf::Cigar,
};
let cigar: Cigar = [
Op::new(Kind::Match, 36),
Op::new(Kind::Deletion, 4),
Op::new(Kind::SoftClip, 8),
]
.into_iter()
.collect();
assert_eq!(cigar.alignment_span(), 40);
sourcepub fn read_length(&self) -> usize
pub fn read_length(&self) -> usize
Calculates the read length.
This sums the lengths of the CIGAR operations that consume the read, i.e., alignment
matches (M
), insertions to the reference (I
), soft clips (S
), sequence matches (=
),
and sequence mismatches (X
).
§Examples
use noodles_sam::alignment::{
record::cigar::{op::Kind, Op},
record_buf::Cigar,
};
let cigar: Cigar = [
Op::new(Kind::Match, 36),
Op::new(Kind::Deletion, 4),
Op::new(Kind::SoftClip, 8),
]
.into_iter()
.collect();
assert_eq!(cigar.read_length(), 44);
Trait Implementations§
source§impl Cigar for &Cigar
impl Cigar for &Cigar
source§impl Cigar for Cigar
impl Cigar for Cigar
source§impl Extend<Op> for Cigar
impl Extend<Op> for Cigar
source§fn extend<T: IntoIterator<Item = Op>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Op>>(&mut self, iter: T)
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<Op> for Cigar
impl FromIterator<Op> for Cigar
source§impl PartialEq for Cigar
impl PartialEq for Cigar
impl Eq for Cigar
impl StructuralPartialEq for Cigar
Auto Trait Implementations§
impl Freeze for Cigar
impl RefUnwindSafe for Cigar
impl Send for Cigar
impl Sync for Cigar
impl Unpin for Cigar
impl UnwindSafe for Cigar
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.