]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-r836
authorHeng Li <lh3@live.co.uk>
Thu, 18 Nov 2010 16:09:23 +0000 (16:09 +0000)
committerHeng Li <lh3@live.co.uk>
Thu, 18 Nov 2010 16:09:23 +0000 (16:09 +0000)
 * initiate MNP realignment when the MNP has at least 0.2% frequency (otherwise too slow)

bam2bcf_indel.c
bamtk.c

index a930cba03b57f5aee2f59e869be04c7ccb530fad..954e43e8f85a404704b48fb5a6191c247baaaf6d 100644 (file)
@@ -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 ba02dd44f674bf31c4806825e24253af91707b09..7b27e2172cb756c0b34a0765a5677c48011a7ed3 100644 (file)
--- 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[]);