bcf1_t

The bcf1_t structure corresponds to one VCF/BCF line. Reading from VCF file is slower because the string is first to be parsed, packed into BCF line (done in vcf_parse), then unpacked into internal bcf1_t structure. If it is known in advance that some of the fields will not be required (notably the sample columns), parsing of these can be skipped by setting max_unpack appropriately. Similarly, it is fast to output a BCF line because the columns (kept in shared.s, indiv.s, etc.) are written directly by bcf_write, whereas a VCF line must be formatted in vcf_format.

Members

Variables

_shared
kstring_t _shared;

??? (name mangled due to D reserved keyword shared)

d
bcf_dec_t d;

lazy evaluation: $d is not generated by bcf_read(), but by explicitly calling bcf_unpack()

errcode
int errcode;

one of BCF_ERR_* codes (TODO: make enum)

indiv
kstring_t indiv;

???

max_unpack
int max_unpack;

Set to BCF_UN_STR, BCF_UN_FLT, or BCF_UN_INFO to boost performance of vcf_parse when some of the fields won't be needed

pos
int32_t pos;

POS

qual
float qual;

QUAL

rid
int32_t rid;

CHROM

rlen
int32_t rlen;

length of REF

unpack_size
int[3] unpack_size;

the original block size of ID, REF+ALT and FILTER

unpacked
int unpacked;

remember what has been unpacked to allow calling bcf_unpack() repeatedly without redoing the work

Meta