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]

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>

Notable traits for CigarIter<'a>

impl<'a> Iterator for CigarIter<'a> type Item = (u32, Operation);
[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

impl Clone for Cigar[src]

impl Display for Cigar[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.