[][src]Struct rust_htslib::bam::record::Record

pub struct Record {
    pub inner: bam1_t,
    // some fields omitted
}

A BAM record.

Fields

inner: bam1_t

Methods

impl Record[src]

pub fn new() -> Self[src]

Create an empty BAM record.

pub fn from_inner(from: *mut bam1_t) -> Self[src]

pub fn from_sam(header_view: &mut HeaderView, sam: &[u8]) -> Result<Record>[src]

pub fn inner_mut(&mut self) -> &mut bam1_t[src]

pub fn inner(&self) -> &bam1_t[src]

pub fn tid(&self) -> i32[src]

Get target id.

pub fn set_tid(&mut self, tid: i32)[src]

Set target id.

pub fn pos(&self) -> i64[src]

Get position (0-based).

pub fn set_pos(&mut self, pos: i64)[src]

Set position (0-based).

pub fn bin(&self) -> u16[src]

pub fn set_bin(&mut self, bin: u16)[src]

pub fn mapq(&self) -> u8[src]

Get MAPQ.

pub fn set_mapq(&mut self, mapq: u8)[src]

Set MAPQ.

pub fn flags(&self) -> u16[src]

Get raw flags.

pub fn set_flags(&mut self, flags: u16)[src]

Set raw flags.

pub fn unset_flags(&mut self)[src]

Unset all flags.

pub fn mtid(&self) -> i32[src]

Get target id of mate.

pub fn set_mtid(&mut self, mtid: i32)[src]

Set target id of mate.

pub fn mpos(&self) -> i64[src]

Get mate position.

pub fn set_mpos(&mut self, mpos: i64)[src]

Set mate position.

pub fn insert_size(&self) -> i64[src]

Get insert size.

pub fn set_insert_size(&mut self, insert_size: i64)[src]

Set insert size.

pub fn qname(&self) -> &[u8][src]

Get qname (read name). Complexity: O(1).

pub fn set_data(&mut self, new_data: &[u8])[src]

Set the variable length data buffer

pub fn set(
    &mut self,
    qname: &[u8],
    cigar: Option<&CigarString>,
    seq: &[u8],
    qual: &[u8]
)
[src]

Set variable length data (qname, cigar, seq, qual). The aux data is left unchanged. qual is Phred-scaled quality values, without any offset. NOTE: seq.len() must equal qual.len() or this method will panic. If you don't have quality values use let quals = vec![ 255 as u8; seq.len()]; as a placeholder that will be recognized as missing QVs by samtools.

pub fn set_qname(&mut self, new_qname: &[u8])[src]

Replace current qname with a new one.

pub fn cigar_len(&self) -> usize[src]

pub fn raw_cigar(&self) -> &[u32][src]

Get reference to raw cigar string representation (as stored in BAM file). Usually, the method Record::cigar should be used instead.

pub fn cigar(&self) -> CigarStringView[src]

Return unpacked cigar string. This will create a fresh copy the Cigar data.

pub fn cigar_cached(&self) -> Option<&CigarStringView>[src]

pub fn cache_cigar(&mut self)[src]

Decode the cigar string and cache it inside the Record

pub fn seq(&self) -> Seq[src]

Get read sequence. Complexity: O(1).

pub fn qual(&self) -> &[u8][src]

Get base qualities (PHRED-scaled probability that base is wrong). This does not entail any offsets, hence the qualities can be used directly without e.g. subtracting 33. Complexity: O(1).

pub fn aux(&self, tag: &[u8]) -> Option<Aux>[src]

Get auxiliary data (tags).

pub fn push_aux(&mut self, tag: &[u8], value: &Aux)[src]

Add auxiliary data.

pub fn remove_aux(&mut self, tag: &[u8]) -> bool[src]

pub fn is_paired(&self) -> bool[src]

pub fn set_paired(&mut self)[src]

pub fn unset_paired(&mut self)[src]

pub fn is_proper_pair(&self) -> bool[src]

pub fn set_proper_pair(&mut self)[src]

pub fn unset_proper_pair(&mut self)[src]

pub fn is_unmapped(&self) -> bool[src]

pub fn set_unmapped(&mut self)[src]

pub fn unset_unmapped(&mut self)[src]

pub fn is_mate_unmapped(&self) -> bool[src]

pub fn set_mate_unmapped(&mut self)[src]

pub fn unset_mate_unmapped(&mut self)[src]

pub fn is_reverse(&self) -> bool[src]

pub fn set_reverse(&mut self)[src]

pub fn unset_reverse(&mut self)[src]

pub fn is_mate_reverse(&self) -> bool[src]

pub fn set_mate_reverse(&mut self)[src]

pub fn unset_mate_reverse(&mut self)[src]

pub fn is_first_in_template(&self) -> bool[src]

pub fn set_first_in_template(&mut self)[src]

pub fn unset_first_in_template(&mut self)[src]

pub fn is_last_in_template(&self) -> bool[src]

pub fn set_last_in_template(&mut self)[src]

pub fn unset_last_in_template(&mut self)[src]

pub fn is_secondary(&self) -> bool[src]

pub fn set_secondary(&mut self)[src]

pub fn unset_secondary(&mut self)[src]

pub fn is_quality_check_failed(&self) -> bool[src]

pub fn set_quality_check_failed(&mut self)[src]

pub fn unset_quality_check_failed(&mut self)[src]

pub fn is_duplicate(&self) -> bool[src]

pub fn set_duplicate(&mut self)[src]

pub fn unset_duplicate(&mut self)[src]

pub fn is_supplementary(&self) -> bool[src]

pub fn set_supplementary(&mut self)[src]

pub fn unset_supplementary(&mut self)[src]

Trait Implementations

impl BamRecordExtensions for Record[src]

impl Clone for Record[src]

impl Debug for Record[src]

impl Default for Record[src]

impl Drop for Record[src]

impl Eq for Record[src]

impl PartialEq<Record> for Record[src]

impl Send for Record[src]

impl SequenceRead for Record[src]

impl Sync for Record[src]

Auto Trait Implementations

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, 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.