edit

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

BAM.Reader(input::IO; index=nothing)

Create a data reader of the BAM file format.

Arguments

  • input: data source
  • index=nothing: filepath to a random access index (currently bai is Supported)

source

# BioAlignments.BAM.headerFunction.

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.

source

# BioAlignments.BAM.WriterType.

BAM.Writer(output::BGZFStream, header::SAM.Header)

Create a data writer of the BAM file format.

Arguments

  • output: data sink
  • header: SAM header object

source

# BioAlignments.BAM.RecordType.

BAM.Record()

Create an unfilled BAM record.

source

# BioAlignments.BAM.flagFunction.

flag(record::Record)::UInt16

Get the bitwise flag of record.

source

# BioAlignments.BAM.ismappedFunction.

ismapped(record::Record)::Bool

Test if record is mapped.

source

# BioAlignments.BAM.isprimaryFunction.

isprimary(record::Record)::Bool

Test if record is a primary line of the read.

This is equivalent to flag(record) & 0x900 == 0.

source

# BioAlignments.BAM.refidFunction.

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

source

# BioAlignments.BAM.refnameFunction.

refname(record::Record)::String

Get the reference sequence name of record.

See also: BAM.refid

source

# BioAlignments.BAM.positionFunction.

position(record::Record)::Int

Get the 1-based leftmost mapping position of record.

source

# BioAlignments.BAM.rightpositionFunction.

rightposition(record::Record)::Int

Get the 1-based rightmost mapping position of record.

source

# BioAlignments.BAM.isnextmappedFunction.

isnextmapped(record::Record)::Bool

Test if the mate/next read of record is mapped.

source

# BioAlignments.BAM.nextrefidFunction.

nextrefid(record::Record)::Int

Get the next/mate reference sequence ID of record.

source

# BioAlignments.BAM.nextrefnameFunction.

nextrefname(record::Record)::String

Get the reference name of the mate/next read of record.

source

# BioAlignments.BAM.nextpositionFunction.

nextposition(record::Record)::Int

Get the 1-based leftmost mapping position of the next/mate read of record.

source

# BioAlignments.BAM.mappingqualityFunction.

mappingquality(record::Record)::UInt8

Get the mapping quality of record.

source

# BioAlignments.BAM.cigarFunction.

cigar(record::Record)::String

Get the CIGAR string of record.

See also BAM.cigar_rle.

source

# BioAlignments.BAM.cigar_rleFunction.

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.

source

# BioAlignments.BAM.alignmentFunction.

alignment(record::Record)::BioAlignments.Alignment

Get the alignment of record.

source

# BioAlignments.BAM.alignlengthFunction.

alignlength(record::Record)::Int

Get the alignment length of record.

source

# BioAlignments.BAM.tempnameFunction.

tempname(record::Record)::String

Get the query template name of record.

source

# BioAlignments.BAM.templengthFunction.

templength(record::Record)::Int

Get the template length of record.

source

# BioAlignments.BAM.sequenceFunction.

sequence(record::Record)::BioSequences.DNASequence

Get the segment sequence of record.

source

# BioAlignments.BAM.seqlengthFunction.

seqlength(record::Record)::Int

Get the sequence length of record.

source

# BioAlignments.BAM.qualityFunction.

quality(record::Record)::Vector{UInt8}

Get the base quality of record.

source

# BioAlignments.BAM.auxdataFunction.

auxdata(record::Record)::BAM.AuxData

Get the auxiliary data of record.

source