X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bcftools%2Fbcf.h;h=4666a96a05d3a2a8568931933cce2f6716218f59;hb=HEAD;hp=ba6dbe9b42ae033c6b3c179a730a48312cf927dd;hpb=d382711a770f67a72b9af3bfd98a88fbced34f64;p=samtools.git diff --git a/bcftools/bcf.h b/bcftools/bcf.h index ba6dbe9..4666a96 100644 --- a/bcftools/bcf.h +++ b/bcftools/bcf.h @@ -28,6 +28,12 @@ #ifndef BCF_H #define BCF_H +#ifndef VERSION +#define BCF_VERSION "0.1.19+" +#else +#define BCF_VERSION VERSION +#endif + #include #include @@ -71,6 +77,7 @@ typedef struct { bcf_ginfo_t *gi; // array of geno fields int n_alleles, n_smpl; // number of alleles and samples // derived info: ref, alt, flt, info, fmt (<-str), n_gi (<-fmt), n_alleles (<-alt), n_smpl (<-bcf_hdr_t::n_smpl) + uint8_t *ploidy; // ploidy of all samples; if NULL, ploidy of 2 is assumed. } bcf1_t; typedef struct { @@ -120,6 +127,10 @@ extern "C" { char *bcf_fmt(const bcf_hdr_t *h, bcf1_t *b); // append more info int bcf_append_info(bcf1_t *b, const char *info, int l); + // remove tag + int remove_tag(char *string, const char *tag, char delim); + // remove info tag, string is the kstring holder of bcf1_t.str + void rm_info(kstring_t *string, const char *key); // copy int bcf_cpy(bcf1_t *r, const bcf1_t *b); @@ -140,6 +151,8 @@ extern "C" { // keep the first n alleles and discard the rest int bcf_shrink_alt(bcf1_t *b, int n); + // keep the masked alleles and discard the rest + void bcf_fit_alt(bcf1_t *b, int mask); // convert GL to PL int bcf_gl2pl(bcf1_t *b); // if the site is an indel @@ -150,6 +163,10 @@ extern "C" { int bcf_fix_gt(bcf1_t *b); // update PL generated by old samtools int bcf_fix_pl(bcf1_t *b); + // convert PL to GLF-like 10-likelihood GL + int bcf_gl10(const bcf1_t *b, uint8_t *gl); + // convert up to 4 INDEL alleles to GLF-like 10-likelihood GL + int bcf_gl10_indel(const bcf1_t *b, uint8_t *gl); // string hash table void *bcf_build_refhash(bcf_hdr_t *h);