BAM
Description
BAM is a binary counterpart of the SAM file format.
- Reader type:
BAM.Reader - Writer type:
BAM.Writer - Element type:
BAM.Record
When writing data in the BAM file format, the underlying output stream needs to be wrapped with a BGZFStream object provided from BGZFStreams.jl.
Examples
TODO
Accessors
#
BioAlignments.BAM.Reader — Type.
BAM.Reader(input::IO; index=nothing)
Create a data reader of the BAM file format.
Arguments
input: data sourceindex=nothing: filepath to a random access index (currently bai is Supported)
#
BioAlignments.BAM.header — Function.
header(reader::Reader; fillSQ::Bool=false)::SAM.Header
Get the header of reader.
If fillSQ is true, this function fills missing "SQ" metainfo in the header.
#
BioAlignments.BAM.Writer — Type.
BAM.Writer(output::BGZFStream, header::SAM.Header)
Create a data writer of the BAM file format.
Arguments
output: data sinkheader: SAM header object
#
BioAlignments.BAM.Record — Type.
BAM.Record()
Create an unfilled BAM record.
#
BioAlignments.BAM.flag — Function.
flag(record::Record)::UInt16
Get the bitwise flag of record.
#
BioAlignments.BAM.ismapped — Function.
ismapped(record::Record)::Bool
Test if record is mapped.
#
BioAlignments.BAM.isprimary — Function.
isprimary(record::Record)::Bool
Test if record is a primary line of the read.
This is equivalent to flag(record) & 0x900 == 0.
#
BioAlignments.BAM.refid — Function.
refid(record::Record)::Int
Get the reference sequence ID of record.
The ID is 1-based (i.e. the first sequence is 1) and is 0 for a record without a mapping position.
See also: BAM.rname
#
BioAlignments.BAM.refname — Function.
refname(record::Record)::String
Get the reference sequence name of record.
See also: BAM.refid
#
BioAlignments.BAM.position — Function.
position(record::Record)::Int
Get the 1-based leftmost mapping position of record.
#
BioAlignments.BAM.rightposition — Function.
rightposition(record::Record)::Int
Get the 1-based rightmost mapping position of record.
#
BioAlignments.BAM.isnextmapped — Function.
isnextmapped(record::Record)::Bool
Test if the mate/next read of record is mapped.
#
BioAlignments.BAM.nextrefid — Function.
nextrefid(record::Record)::Int
Get the next/mate reference sequence ID of record.
#
BioAlignments.BAM.nextrefname — Function.
nextrefname(record::Record)::String
Get the reference name of the mate/next read of record.
#
BioAlignments.BAM.nextposition — Function.
nextposition(record::Record)::Int
Get the 1-based leftmost mapping position of the next/mate read of record.
#
BioAlignments.BAM.mappingquality — Function.
mappingquality(record::Record)::UInt8
Get the mapping quality of record.
#
BioAlignments.BAM.cigar — Function.
cigar(record::Record)::String
Get the CIGAR string of record.
See also BAM.cigar_rle.
#
BioAlignments.BAM.cigar_rle — Function.
cigar_rle(record::Record)::Tuple{Vector{BioAlignments.Operation},Vector{Int}}
Get a run-length encoded tuple (ops, lens) of the CIGAR string in record.
See also BAM.cigar.
#
BioAlignments.BAM.alignment — Function.
alignment(record::Record)::BioAlignments.Alignment
Get the alignment of record.
#
BioAlignments.BAM.alignlength — Function.
alignlength(record::Record)::Int
Get the alignment length of record.
#
BioAlignments.BAM.tempname — Function.
tempname(record::Record)::String
Get the query template name of record.
#
BioAlignments.BAM.templength — Function.
templength(record::Record)::Int
Get the template length of record.
#
BioAlignments.BAM.sequence — Function.
sequence(record::Record)::BioSequences.DNASequence
Get the segment sequence of record.
#
BioAlignments.BAM.seqlength — Function.
seqlength(record::Record)::Int
Get the sequence length of record.
#
BioAlignments.BAM.quality — Function.
quality(record::Record)::Vector{UInt8}
Get the base quality of record.
#
BioAlignments.BAM.auxdata — Function.
auxdata(record::Record)::BAM.AuxData
Get the auxiliary data of record.