Struct rust_htslib::bam::record::Record
source · Expand description
A BAM record.
Fields§
§inner: *mut bam1_t
Implementations§
source§impl Record
impl Record
pub fn from_inner(inner: *mut bam1_t) -> Self
pub fn from_sam(
header_view: &HeaderView,
sam: &[u8]
) -> Result<Record, ReadError>
pub fn inner_mut(&mut self) -> &mut bam1_t
pub fn inner(&self) -> &bam1_t
pub fn bin(&self) -> u16
pub fn set_bin(&mut self, bin: u16)
sourcepub fn unset_flags(&mut self)
pub fn unset_flags(&mut self)
Unset all flags.
sourcepub fn insert_size(&self) -> i32
pub fn insert_size(&self) -> i32
Get insert size.
sourcepub fn set_insert_size(&mut self, insert_size: i32)
pub fn set_insert_size(&mut self, insert_size: i32)
Set insert size.
sourcepub fn set(&mut self, qname: &[u8], cigar: &CigarString, seq: &[u8], qual: &[u8])
pub fn set(&mut self, qname: &[u8], cigar: &CigarString, seq: &[u8], qual: &[u8])
Set variable length data (qname, cigar, seq, qual). Note: Pre-existing aux data will be invalidated if called on an existing record. For this reason, never call push_aux() before set().
sourcepub fn set_qname(&mut self, new_qname: &[u8])
pub fn set_qname(&mut self, new_qname: &[u8])
Replace current qname with a new one. Unlike set(), this preserves all the variable length data including the aux.
pub fn cigar_len(&self) -> usize
sourcepub fn raw_cigar(&self) -> &[u32]
pub fn raw_cigar(&self) -> &[u32]
Get reference to raw cigar string representation (as stored in BAM file).
Usually, the method Record::cigar
should be used instead.
sourcepub fn cigar(&self) -> CigarStringView
pub fn cigar(&self) -> CigarStringView
Return unpacked cigar string. This will create a fresh copy the Cigar data.
pub fn cigar_cached(&self) -> Option<&CigarStringView>
sourcepub fn cache_cigar(&mut self)
pub fn cache_cigar(&mut self)
Decode the cigar string and cache it inside the Record
sourcepub fn qual(&self) -> &[u8] ⓘ
pub fn qual(&self) -> &[u8] ⓘ
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).
sourcepub fn push_aux(
&mut self,
tag: &[u8],
value: &Aux<'_>
) -> Result<(), AuxWriteError>
pub fn push_aux(
&mut self,
tag: &[u8],
value: &Aux<'_>
) -> Result<(), AuxWriteError>
Add auxiliary data. push_aux() should never be called before set().