VCFWriter

Basic support for writing VCF, BCF files

Constructors

this
this()

Undocumented in source.

this
this(string fn)

open file or network resources for writing setup incl header allocation if mode==w: bcf_hdr_init automatically sets version string (##fileformat=VCFv4.2) bcf_hdr_init automatically adds the PASS filter

this
this(string fn, T other)

setup and copy a header from another BCF/VCF as template

Destructor

~this
~this()

dtor

Members

Functions

addFiledate
int addFiledate()

Add a filedate= headerline, which is not called out specifically in the spec, but appears in the spec's example files. We could consider allowing a param here.

addFilterTag
void addFilterTag(string id, string description)

Add FILTER tag (§1.2.3)

addHeaderLineKV
int addHeaderLineKV(string key, string value)

Add a new header line

addHeaderLineRaw
int addHeaderLineRaw(string line)

Add a new header line -- must be formatted ##key=value

addRecord
int addRecord(S contig, int pos, S id, S alleles, N qual, S[] filters)

Add a record

addSample
int addSample(string name)

Add sample to this VCF * int bcf_hdr_add_sample(bcf_hdr_t *hdr, const(char) *sample);

addTag
void addTag(string id, T number, string type, string description, string source, string _version)

Add INFO (§1.2.2) or FORMAT (§1.2.4) tag

addTag
void addTag(string id, string description)

Add FILTER tag (§1.2.3)

addTag
auto addTag(const(char)[] id, int length, string other)

Add contig definition (§1.2.7) to header meta-info

copyHeaderLines
void copyHeaderLines(bcf_hdr_t* other)

copy header lines from a template without overwiting existing lines

getHeader
VCFHeader* getHeader()

Undocumented in source. Be warned that the author may not have intended to support it.

writeHeader
int writeHeader()

as expected

writeRecord
int writeRecord(VCFRecord r)

as expected

writeRecord
int writeRecord(bcf_hdr_t* hdr, bcf1_t* rec)

as expected

Variables

fp
vcfFile* fp;

Undocumented in source.

rows
bcf1_t*[] rows;

Undocumented in source.

vcfhdr
VCFHeader* vcfhdr;

Undocumented in source.

Meta