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
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.