]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.8-7 (r639)
authorHeng Li <lh3@live.co.uk>
Mon, 26 Jul 2010 02:18:38 +0000 (02:18 +0000)
committerHeng Li <lh3@live.co.uk>
Mon, 26 Jul 2010 02:18:38 +0000 (02:18 +0000)
 * fixed the reference allele assignment

bam_mcns.c
bam_plcmd.c
bamtk.c

index 7ef9f0f44702d9f6e4b499681f328ffe594b5afd..40335ee37cac09735f6f7722ccb4e5e7caeea19f 100644 (file)
@@ -115,9 +115,11 @@ static void set_allele(int ref, mc_aux_t *ma)
                for (j = i; j > 0 && sum[j] < sum[j-1]; --j)
                        tmp = sum[j], sum[j] = sum[j-1], sum[j-1] = tmp;
        ma->ref = sum[3]&3; ma->alt = sum[2]&3; ma->alt2 = -1;
-       if (ma->ref != ref) {
-               if (ma->alt == ref) tmp = ma->ref, ma->ref = ma->alt, ma->alt = tmp;
-               else ma->alt2 = ma->alt, ma->alt = ma->ref, ma->ref = ref;
+       if (ma->ref != ref) { // the best base is not ref
+               if (ref >= 0 && ref <= 3) { // ref is not N
+                       if (ma->alt == ref) tmp = ma->ref, ma->ref = ma->alt, ma->alt = tmp; // then switch alt and ref
+                       else ma->alt2 = ma->alt, ma->alt = ma->ref, ma->ref = ref; // then set ref as ref
+               } else ma->alt2 = ma->alt, ma->alt = ma->ref, ma->ref = sum[0]&3; // then set the weakest as ref
        }
 }
 
index a1c87ab6f67831fe4f949a4625f5cd685b72317d..bbdca64d4cc38ac4edde1691f527a886880eac2b 100644 (file)
@@ -701,7 +701,7 @@ int bam_mpileup(int argc, char *argv[])
                fprintf(stderr, "         -M INT      cap mapping quality at INT [%d]\n", mplp.max_mq);
                fprintf(stderr, "         -q INT      filter out alignment with MQ smaller than INT [%d]\n", mplp.min_mq);
                fprintf(stderr, "         -t FLOAT    scaled mutation rate [%lg]\n", mplp.theta);
-               fprintf(stderr, "         -P STR      prior: full, flat, cond2 [full]");
+               fprintf(stderr, "         -P STR      prior: full, flat, cond2 [full]\n");
                fprintf(stderr, "         -c          generate VCF output (consensus calling)\n");
                fprintf(stderr, "         -v          show variant sites only\n");
                fprintf(stderr, "         -S          calculate AFS (slow, to stderr)\n");
diff --git a/bamtk.c b/bamtk.c
index e80d04224f08cf48a37b824b982f8c0134f580bd..c70b41d34c793afe23b57b63d9f33ba892f01617 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -9,7 +9,7 @@
 #endif
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.8-6 (r638)"
+#define PACKAGE_VERSION "0.1.8-7 (r639)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);