Struct rust_htslib::bam::record::Record
[−]
[src]
pub struct Record { pub inner: *mut bam1_t, // some fields omitted }
A BAM record.
Fields
inner: *mut bam1_t
Methods
impl Record
[src]
pub fn new() -> Self
[src]
Create an empty BAM record.
pub fn from_inner(inner: *mut bam1_t) -> Self
[src]
pub fn from_sam(
header_view: &HeaderView,
sam: &[u8]
) -> Result<Record, ReadError>
[src]
header_view: &HeaderView,
sam: &[u8]
) -> Result<Record, ReadError>
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) -> i32
[src]
Get position (0-based).
pub fn set_pos(&mut self, pos: i32)
[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) -> i32
[src]
Get mate position.
pub fn set_mpos(&mut self, mpos: i32)
[src]
Set mate position.
pub fn insert_size(&self) -> i32
[src]
Get insert size.
pub fn set_insert_size(&mut self, insert_size: i32)
[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: &CigarString,
seq: &[u8],
qual: &[u8]
)
[src]
&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().
pub fn set_qname(&mut self, new_qname: &[u8])
[src]
Replace current qname with a new one. Unlike set(), this preserves all the variable length data including the aux.
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]
Get cigar string. Complexity: O(k) with k being the length of the cigar string.
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) -> Result<(), AuxWriteError>
[src]
Add auxiliary data. push_aux() should never be called before set().
pub fn remove_aux(&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 Send for Record
[src]
impl Sync for Record
[src]
impl Clone for Record
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Record
[src]
fn eq(&self, other: &Record) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Record
[src]
impl Debug for Record
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more