X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bcftools%2Fprob1.c;h=e124b0f8f7810114f47c5d7eed3178681849877c;hb=082c52f3cb5517db50987bf1dc43aef845c45fd8;hp=4611af1f995fff8832300af10f733bffa41dd29d;hpb=d8179b771ea4a62b22015dd89693470d52838471;p=samtools.git diff --git a/bcftools/prob1.c b/bcftools/prob1.c index 4611af1..e124b0f 100644 --- a/bcftools/prob1.c +++ b/bcftools/prob1.c @@ -32,7 +32,7 @@ unsigned char seq_nt4_table[256] = { }; struct __bcf_p1aux_t { - int n, M; + int n, M, n1; double *q2p, *pdg; // pdg -> P(D|g) double *phi; double *z, *zswap; // aux for afs @@ -100,6 +100,7 @@ bcf_p1aux_t *bcf_p1_init(int n) // FIXME: assuming diploid bcf_p1aux_t *ma; int i; ma = calloc(1, sizeof(bcf_p1aux_t)); + ma->n1 = -1; ma->n = n; ma->M = 2 * n; ma->q2p = calloc(256, sizeof(double)); ma->pdg = calloc(3 * ma->n, sizeof(double)); @@ -114,6 +115,13 @@ bcf_p1aux_t *bcf_p1_init(int n) // FIXME: assuming diploid return ma; } +int bcf_p1_set_n1(bcf_p1aux_t *b, int n1) +{ + if (n1 == 0 || n1 >= b->n) return -1; + b->n1 = n1; + return 0; +} + void bcf_p1_destroy(bcf_p1aux_t *ma) { if (ma) {