Expand description
Convert BAM alignments to BED6 format.
§Algorithm
For each mapped alignment, emit one BED6 record:
chrom start end name score strand
startis 0-based (BED convention), sourced directly from the BAMposfield which is also 0-based.end= start + reference span of the alignment.scoreis the mapping quality (MAPQ) unlessuse_edit_distanceis set, in which case the NM auxiliary tag value is used.strandis+for forward,-for reverse-complemented reads.
With split, any spliced alignment (containing N CIGAR operations) is
broken into individual exon blocks — one BED record per block. The name and
score come from the read; blocks are non-overlapping and non-adjacent.
Unmapped reads (FLAG & 0x4) are always skipped.
§Reference
BEDTools bamtobed — Quinlan & Hall (2010). Bioinformatics 26(6): 841–842.
DOI: 10.1093/bioinformatics/btq033