HeaderRecord

Struct for easy setting and getting of bcf_hrec_t values for VCFheader

Constructors

this
this(bcf_hrec_t* rec)

ctor from a bcf_hrec_t

Members

Functions

convert
bcf_hrec_t* convert(bcf_hdr_t* hdr)

convert to bcf_hrec_t for use with htslib functions

getDescription
string getDescription()

get Description field

getHeaderRecordType
HeaderRecordType getHeaderRecordType()

get Record Type i.e INFO, FORMAT ...

getID
string getID()

get ID field

getLength
string getLength()

get Value Type length

getValueType
HeaderTypes getValueType()

get Value Type i.e Integer, String, Float

opIndex
auto ref opIndex(string index)

get a value from the KV pairs if key isn't present thows exception

opIndexAssign
void opIndexAssign(string value, string index)

set a value from the KV pairs if key isn't present a new KV pair is added

setDescription
void setDescription(string des)

set Description field

setHeaderRecordType
void setHeaderRecordType(HeaderRecordType line)

set Record Type i.e INFO, FORMAT ...

setID
void setID(string id)

set ID field

setLength
void setLength(T number)

set Value Type length with integer

setLength
void setLength(HeaderLengths number)

set Value Type length i.e A, R, G, .

setValueType
void setValueType(HeaderTypes type)

set Value Type i.e Integer, String, Float

toString
string toString()

print a string representation of the header record

Variables

idx
int idx;

HDR IDX value

key
string key;

string of HeaderRecordType type i.e INFO, contig, FORMAT ? or could be ##source=program ======

keys
string[] keys;

kv pair keys

length
int length;

if HDR Length value is FIXED this is the number

lenthType
HeaderLengths lenthType;

HDR Length value A, R, G, ., FIXED

nkeys
int nkeys;

number kv pairs

recType
HeaderRecordType recType;

HeaderRecordType type i.e INFO, contig, FORMAT

vals
string[] vals;

kv pair values

value
string value;

mostly empty except for this ##source=program =======

valueType
HeaderTypes valueType;

HDR Length value INT, FLOAT, STRING

Meta