X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bcftools%2Fprob1.c;h=ffa608e29d6408c03a858f3db3daba162a1e9ed2;hb=4773f0ea85f278fc544d762d707e92673232f1e4;hp=5051cc3cece3770e4e4e61e1934c8cfff79998dc;hpb=72d6457f7f361c323f62bd2d3170980132ba2113;p=samtools.git diff --git a/bcftools/prob1.c b/bcftools/prob1.c index 5051cc3..ffa608e 100644 --- a/bcftools/prob1.c +++ b/bcftools/prob1.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "prob1.h" #include "kstring.h" @@ -15,6 +16,8 @@ KSTREAM_INIT(gzFile, gzread, 16384) #define MC_EM_EPS 1e-5 #define MC_DEF_INDEL 0.15 +gzFile bcf_p1_fp_lk; + unsigned char seq_nt4_table[256] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, @@ -165,6 +168,8 @@ bcf_p1aux_t *bcf_p1_init(int n, uint8_t *ploidy) return ma; } +int bcf_p1_get_M(bcf_p1aux_t *b) { return b->M; } + int bcf_p1_set_n1(bcf_p1aux_t *b, int n1) { if (n1 == 0 || n1 >= b->n) return -1; @@ -598,6 +603,8 @@ static void mc_cal_y_core(bcf_p1aux_t *ma, int beg) } } if (z[0] != ma->z) memcpy(ma->z, z[0], sizeof(double) * (ma->M + 1)); + if (bcf_p1_fp_lk) + gzwrite(bcf_p1_fp_lk, ma->z, sizeof(double) * (ma->M + 1)); } static void mc_cal_y(bcf_p1aux_t *ma)