Struct bam::record::cigar::Cigar [−][src]
pub struct Cigar(_);
A wrapper around raw Cigar.
Implementations
impl Cigar
[src]
pub fn new() -> Self
[src]
Creates a new empty CIGAR.
pub fn from_raw(raw: &[u32]) -> Self
[src]
Creates a cigar from raw data.
pub fn clear(&mut self)
[src]
Clears the contents but does not touch capacity.
pub fn extend_from_raw<I: IntoIterator<Item = u32>>(&mut self, iter: I)
[src]
Extends CIGAR from raw data.
pub fn push(&mut self, len: u32, operation: Operation)
[src]
Pushes a single operation to the end of the CIGAR. Does nothing if len
is 0.
pub fn extend_from_text<I: IntoIterator<Item = u8>>(
&mut self,
text: I
) -> Result<(), String>
[src]
&mut self,
text: I
) -> Result<(), String>
Extends Cigar from text representation. If an error occured, the cigar may be filled partially.
pub fn at(&self, index: usize) -> (u32, Operation)
[src]
Returns a pair (length, operation)
by its index.
pub fn iter<'a>(&'a self) -> CigarIter<'a>ⓘ
[src]
Returns an iterator over typles (length, operation)
.
pub fn len(&self) -> usize
[src]
Cigar length.
pub fn is_empty(&self) -> bool
[src]
Returns true
if Cigar is empty.
pub fn raw(&self) -> &[u32]
[src]
Returns raw Cigar. Each u32
value represents length << 4 | operation
, where
operations are encoded from 0 to 8.
pub fn calculate_ref_len(&self) -> u32
[src]
Calculates reference alignment length. Consider using Record::calculate_end, as the record alignment end is stored once calculated.
pub fn calculate_query_len(&self) -> u32
[src]
Calculates query length.
pub fn shrink_to_fit(&mut self)
[src]
Shrinks inner vector.
pub fn write_readable<W: Write>(&self, f: &mut W) -> Result<()>
[src]
Writes to f
in a human readable format. Write *
if empty.
pub fn hard_clipping(&self, left_side: bool) -> u32
[src]
Returns the size of the hard clipping
on the left side if left_side
and on the right side otherwise.
pub fn soft_clipping(&self, left_side: bool) -> u32
[src]
Returns the size of the soft clipping
on the left side if left_side
and on the right side otherwise.
The function ignores any hard clipping in the process.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cigar
impl Send for Cigar
impl Sync for Cigar
impl Unpin for Cigar
impl UnwindSafe for Cigar
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,