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

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

A BAM record.

Fields

inner: bam1_t

Implementations

Create an empty BAM record.

Get target id.

Set target id.

Get position (0-based).

Set position (0-based).

Get MAPQ.

Set MAPQ.

Get strand information from record flags.

Get raw flags.

Set raw flags.

Unset all flags.

Get target id of mate.

Set target id of mate.

Get mate position.

Set mate position.

Get insert size.

Set insert size.

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

Set the variable length data buffer

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.

Replace current qname with a new one.

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

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

Decode the cigar string and cache it inside the Record

Get read sequence. Complexity: O(1).

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

Look up an auxiliary field by its tag.

Only the first two bytes of a given tag are used for the look-up of a field. See Aux for more details.

Returns an iterator over the auxiliary fields of the record.

When an error occurs, the Err variant will be returned and the iterator will not be able to advance anymore.

Add auxiliary data.

Infer read pair orientation from record. Returns SequenceReadPairOrientation::None if record is not paired, mates are not mapping to the same contig, or mates start at the same position.

Trait Implementations

Return contig name. Panics if record does not know its header (which happens if it has not been read from a file).

Return genomic range covered by alignment. Panics if Record::cache_cigar() has not been called first or Record::pos() is less than zero.

Return true if interval contains given locus.

iterator over start and end positions of aligned gapless blocks Read more

This scans the CIGAR for reference skips and reports their positions. It does not inspect the reported regions for actual splice sites. pysam: get_introns Read more

Iter over <([read_start, read_stop], [genome_start, genome_stop]) blocks of continously aligned reads. Read more

iter aligned read and reference positions on a basepair level Read more

iter list of read and reference positions on a basepair level. Read more

the number of nucleotides covered by each Cigar::* variant. Read more

the number of occurrences of each each Cigar::* variant Read more

iter over reference positions that this read aligns to Read more

iter over reference positions that this read aligns to Read more

left most aligned reference position of the read on the reference genome.

right most aligned reference position of the read on the reference genome.

infer the query length from the cigar string, optionally include hard clipped bases Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Read name.

Base at position i in the read.

Base quality at position i in the read.

Read length.

Return true if read is empty.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.