+ // call the consensus and indel
+ if (d->format & BAM_PLF_CNS) // call consensus
+ cns = bam_maqcns_call(n, pu, d->c);
+ if ((d->format & (BAM_PLF_CNS|BAM_PLF_INDEL_ONLY)) && d->ref) { // call indels
+ if (proposed_indels) // the first element gives the size of the array
+ r = bam_maqindel(n, pos, d->ido, pu, d->ref, proposed_indels[0], proposed_indels+1);
+ else r = bam_maqindel(n, pos, d->ido, pu, d->ref, 0, 0);
+ }
+ // when only variant sites are asked for, test if the site is a variant
+ if ((d->format & BAM_PLF_CNS) && (d->format & BAM_PLF_VAR_ONLY)) {
+ if (!(bam_nt16_table[rb] != 15 && cns>>28 != bam_nt16_table[rb])) { // not a SNP
+ if (!(r && (r->gt == 2 || strcmp(r->s[r->gt], "*")))) // not an indel
+ return 0;
+ }
+ }
+ // print the first 3 columns