TagValue

This represents a SAM/BAM record tag value, as outlined in the SAM specs §1.5.

The struct itself stores only a pointer to the tag, and has member functions to parse into any of the tag types (but only if the tag matches that type) (TODO: is this true?)

Primary Types: A Printable character i Signed integer (see specs §1.5 footnote on size) f Single-precision float Z Printable string, including space H Byte array in the Hex format (network byte order / big-endian) B Integer or numeric array

Byte-array (B) types: c byte C ubyte s short S ushort i int32 I uint32 f float (spec does not indicate precision)

Memory layout pipes delimit byte boundaries in an array 8/9 are example values 2 is a count of the array the ubyte * starts at the type char c | 8| s | | 8| i | | | | 8| B |i | | | | 2| | | | 8| | | | 9|

More...

Constructors

this
this(bam1_t* b, char[2] tag)

Constructor

Members

Functions

check
bool check()

Check if tag type is type T

check
bool check()

Check if tag type is type T

check
bool check()

Check if tag type is type T

exists
bool exists()

check if empty/exists/null

to
string to()

Convert tag value

to
T to()

Convert tag value

to
T[] to()

Convert tag value

toFloatArray
float[] toFloatArray()

Convert tag value to float array

toInt
long toInt()

Convert tag value to integer

toIntArray
long[] toIntArray()

Convert tag value to integer array

toString
string toString()

Convert tag value to string

Detailed Description

Alias seq allows us to have an enum of types. https://forum.dlang.org/post/kmdjfzpugudmwfrdgson@forum.dlang.org Thanks Paul!

Usage: auto t = TagValue(b, 'XX') where b is bam1_t* BAM record and XX is tag

Meta