X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bam2bcf_indel.c;h=954e43e8f85a404704b48fb5a6191c247baaaf6d;hb=4ec3d44869c8aac4db819d48a230b00e05691a57;hp=a930cba03b57f5aee2f59e869be04c7ccb530fad;hpb=a499d2adac8cbc9c8e38b85ccc392bac0ade8661;p=samtools.git diff --git a/bam2bcf_indel.c b/bam2bcf_indel.c index a930cba..954e43e 100644 --- a/bam2bcf_indel.c +++ b/bam2bcf_indel.c @@ -480,9 +480,6 @@ int bcf_call_mnp_prep(int n, int *n_plp, bam_pileup1_t **plp, int pos, bcf_calla // squeeze out indentical types for (i = 1, n_types = 1; i < m; ++i) if (aux[i] != aux[i-1]) ++n_types; - if (n_types == 1) { // no indels - free(aux); return -1; - } // count reads for each type cnt = alloca(n_types * 4); cnt[0] = 1<<8 | aux[0]; @@ -495,6 +492,8 @@ int bcf_call_mnp_prep(int n, int *n_plp, bam_pileup1_t **plp, int pos, bcf_calla free(aux); // collect types ks_introsort(uint32_t, n_types, cnt); + if (n_types == 1 || (cnt[n_types-1]>>8) * MIN_SUPPORT_COEF < N) // no MNPs or too few supporting reads + return -1; types = (int*)calloc(2, sizeof(int)); types[0] = ref_seq; types[1] = cnt[n_types-1]&0xff; ref_type = 0; n_types = 2;