HtslibIterator

HtslibIterator is an abstraction for htslib's hts_itr_t using dhtslib.memory for reference counting. HtslibIterator can be used to iterate VCF/BCF/SAM/BAM/Text files using a BAI/CSI/TBX index or by simply iterating the file.

This struct adapts htslib's iterators into ForwardRange. It is paired with and relies on HtslibFile.

Constructors

this
this(HtslibFile f)

ctor using only HtslibFile without an iterator

this
this(HtslibFile f, HtsItr itr)

ctor using an HtslibFile and an iterator

Members

Functions

dup
HtslibIterator dup()

Duplicate the iterator must fully duplicate hts_itr_t

front
T front()

Get front of the iterator, returns Bam1, Bcf1, or Kstring Backing bam1_t, bcf1_t, kstring_t is re-used If you keep the result around it should be duplicated

popFront
void popFront()

popFront to move range forward is destructive

save
typeof(this) save()

Needed to be ForwardRange

Properties

empty
bool empty [@property getter]

InputRange interface

Variables

f
HtslibFile f;

HtslibFile

itr
HtsItr itr;

refcounted hts_itr_t

rec
T rec;

refcounted bam1_t, bcf1_t, or kstring_t

Meta