]> git.donarmstrong.com Git - samtools.git/blobdiff - bcftools/prob1.c
* rename vcfout.c as call1.c
[samtools.git] / bcftools / prob1.c
index 4611af1f995fff8832300af10f733bffa41dd29d..e124b0f8f7810114f47c5d7eed3178681849877c 100644 (file)
@@ -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) {