* negative if we are looking at an indel. */
int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t *bca, bcf_callret1_t *r)
{
* negative if we are looking at an indel. */
int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t *bca, bcf_callret1_t *r)
{
- int i, n, ref4, is_indel;
+ int i, n, ref4, is_indel, ori_depth = 0;
memset(r, 0, sizeof(bcf_callret1_t));
if (ref_base >= 0) {
ref4 = bam_nt16_nt4_table[ref_base];
memset(r, 0, sizeof(bcf_callret1_t));
if (ref_base >= 0) {
ref4 = bam_nt16_nt4_table[ref_base];
memset(r, 0, sizeof(bcf_callret1_t));
for (i = n = 0; i < _n; ++i) {
const bam_pileup1_t *p = pl + i;
memset(r, 0, sizeof(bcf_callret1_t));
for (i = n = 0; i < _n; ++i) {
const bam_pileup1_t *p = pl + i;
- int q, b, mapQ, baseQ, is_diff, min_dist;
+ int q, b, mapQ, baseQ, is_diff, min_dist, seqQ;
b = bam_nt16_nt4_table[b? b : ref_base]; // b is the 2-bit base
is_diff = (ref4 < 4 && b == ref4)? 0 : 1;
} else {
b = bam_nt16_nt4_table[b? b : ref_base]; // b is the 2-bit base
is_diff = (ref4 < 4 && b == ref4)? 0 : 1;
} else {
// glfgen
errmod_cal(bca->e, n, 5, bca->bases, r->p);
return r->depth;
// glfgen
errmod_cal(bca->e, n, 5, bca->bases, r->p);
return r->depth;
if (((ref4 < 4 && j < 4) || (ref4 == 4 && j < 5)) && i >= 0)
call->unseen = j, call->a[j++] = qsum[i]&3;
call->n_alleles = j;
if (((ref4 < 4 && j < 4) || (ref4 == 4 && j < 5)) && i >= 0)
call->unseen = j, call->a[j++] = qsum[i]&3;
call->n_alleles = j;