bio.std.hts.bam.reader

Writing a script/tool for processing BAM data often starts this way:

import bio.std.hts.bam.reader;

void main(string[] args) {
    auto bam = new BamReader(args[1]); // open BAM file
    foreach (read; bam.reads) {        // iterate through its reads
        if (read.is_unmapped)
            continue;                  // maybe skip unmapped ones
        ...
    }
}

Or, if a specific interval on the reference sequence is to be explored:

import bio.std.hts.bam.pileup;
...
auto reads = bam["chr7"][50_000 .. 60_000]; // BAI index is required
foreach (column; makePileup(reads)) { ... } // see $(PMODULE pileup) docs

Public Imports

bio.std.hts.sam.header
public import bio.std.hts.sam.header;
bio.std.hts.bam.reference
public import bio.std.hts.bam.reference;
bio.std.hts.bam.region
public import bio.std.hts.bam.region;
bio.std.hts.bam.read
public import bio.std.hts.bam.read;
bio.std.hts.bam.tagvalue
public import bio.std.hts.bam.tagvalue;
bio.std.hts.bam.readrange
public import bio.std.hts.bam.readrange;
bio.core.bgzf.virtualoffset
public import bio.core.bgzf.virtualoffset;

Members

Classes

BamReader
class BamReader

BAM file reader, featuring parallel decompression of BGZF blocks.

Meta