bio.std.hts.bam.reference

Each BAM file contains reads aligned to different reference sequences.

These sequences have unique identifiers in BAM file, starting from 0. Unmapped reads are associated with id = -1.

If BAI file is available, fast region queries are available, that is, getting all reads that overlap given region. This is achieved via opSlice method.

Public Imports

bio.std.hts.bam.referenceinfo
public import bio.std.hts.bam.referenceinfo;

Members

Structs

ReferenceSequence
struct ReferenceSequence

Examples

import bio.std.hts.bam.reader, std.stdio;
...
auto bam = new BamReader("file.bam");
auto refseq = bam["chr17"];
writeln(refseq.name, " - length ", refseq.length);
foreach (read; refseq[1234 .. 5678])
    if (read.cigar.length > 1)
        writeln(read.name, " ", read.cigarString());

Meta