From 8757ce44be2f13944b075e42ded2e92ee6e464fb Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 18 Nov 2010 16:09:23 +0000 Subject: [PATCH] * samtools-r836 * initiate MNP realignment when the MNP has at least 0.2% frequency (otherwise too slow) --- bam2bcf_indel.c | 5 ++--- bamtk.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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; diff --git a/bamtk.c b/bamtk.c index ba02dd4..7b27e21 100644 --- a/bamtk.c +++ b/bamtk.c @@ -9,7 +9,7 @@ #endif #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.10-4 (r834)" +#define PACKAGE_VERSION "0.1.10-5 (r836)" #endif int bam_taf2baf(int argc, char *argv[]); -- 2.39.5