Construct alignment from basic information about it.
Associates read with BAM reader. This is done automatically if this read is obtained through BamReader/Reference methods.
The number of reference bases covered by this read.
Returns 0 if the read is unmapped.
Human-readable representation of CIGAR string (same as in SAM format)
Deep copy of the record.
Extended CIGAR where M operators are replaced with =/X based on information from MD tag. Throws if the read doesn't have MD tag.
Compare two alignments, including tags (the tags must follow in the same order for equality).
Raw representation of the read. Occasionally useful for dirty hacks!
Raw representation of the read. Occasionally useful for dirty hacks!
Associated BAM/SAM reader.
JSON representation
Packs message in the following format:
MsgPack array with elements
String representation.
Possible formats are SAM ("%s") and JSON ("%j")
String representation.
Possible formats are SAM ("%s") and JSON ("%j")
Quality data (phred-based scores)
Set quality data - array length must be of the same length as the sequence.
Indexing bin which this read belongs to. Recalculated when position is changed.
List of CIGAR operations
Not passing quality controls
Flag bits (should be used on very rare occasions, see flag getters/setters below)
PCR or optical duplicate
The first segment in the template
Template having multiple segments in sequencing
Sequence being reverse complemented
The last segment in the template
Secondary alignment
Supplementary alignment
Segment unmapped
Mapping quality. Equals to 255 if not available, otherwise equals to rounded -10 * log10(P {mapping position is wrong}).
Sequence of the next segment in the template being reversed
Next segment in the template unmapped
Mate position
Mate reference ID
Mate reference sequence name ('*' for unmapped mates)
Read name, length must be in 1..255 interval.
0-based leftmost coordinate of the first matching base
Each segment properly aligned according to the aligner
Reference index in BAM file header
Reference sequence name ('*' for unmapped reads)
Random-access range of characters
Sets query sequence. Sets all base qualities to 255 (i.e. unknown).
Sequence length. In fact, sequence.length can be used instead, but that might be slower if the compiler is not smart enough to optimize away unrelated stuff.
Size of the alignment record when output to stream in BAM format. Includes block_size as well (see SAM/BAM specification)
Convenience function, returns '+' or '-' indicating the strand.
Template length
Read-only random-access range for access to sequence data.
Hash-like access to tags. Time complexity is O(number of tags).
If tag with such key is not found, returned value 'is nothing'.
If key length is different from 2, exception is thrown.
Special case when value represents nothing is used for removing tag
(assuming that no more than one with this key is presented in the record).
Append new tag to the end, skipping check if it already exists. O(1)
Remove all tags
Number of tags. O(number of tags)
Provides opportunity to iterate over tags.
Returns the number of tags. Time complexity is O(number of tags)
BAM record representation.