SAMHeader

Undocumented in source.

Constructors

this
this(sam_hdr_t* h)

Undocumented in source.

Members

Functions

addLine
auto addLine(RecordType type, T kvargs)

Add a single line to an existing header

addLines
auto addLines(const(char)[] lines)

add multiple \n-terminated full SAM header records, eg "@SQ\tSN:foo\tLN:100" (passed line does not require \n)

lineById
const(char)[] lineById(RecordType type, string id_key, string id_val)

Return a complete line of formatted text for a given type and ID, or if no ID, first line matching type. Parameters: * type - enum * id_key - may be empty, in which case the first line matching type is returned * id_val - may be empty IFF id_key empty; otherwise must be value for key

numRecords
size_t numRecords(RecordType rt)

number of records (lines) of type e.g. SQ, RG, etc.

opBinaryRight
bool opBinaryRight(RecordType lhs)

'in' membership operator. usage: RecordType.SQ in hdr; => <bool>

opIndex
const(char)[] opIndex(RecordType rt, size_t pos, const(char)[] key)

For position-based lookups of key, e.g. a sample-name lookup in Pysam is ["RG"][0]["SM"] , while in dhtslib: [RecordType.RG, 0, "SN"]

valueByPos
const(char)[] valueByPos(RecordType type, size_t pos, const(char)[] key)

/ //// int sam_hdr_find_tag_id(sam_hdr_t *h, const char *type, const char *ID_key, const char *ID_value, const char *key, kstring_t *ks); Return the value associated with a key for a header line identified by position

Meta