]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_plcmd.c
* samtools-0.1.12-1 (r873)
[samtools.git] / bam_plcmd.c
index e3f73aaddd03a14343a82084ee060d9c41ba42d4..29fbb9cd6219a9803488e07b32c8e648b835d1c2 100644 (file)
@@ -563,9 +563,10 @@ static int mplp_func(void *data, bam1_t *b)
        mplp_aux_t *ma = (mplp_aux_t*)data;
        int ret, skip = 0;
        do {
-               int has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0;
+               int has_ref;
                ret = ma->iter? bam_iter_read(ma->fp, ma->iter, b) : bam_read1(ma->fp, b);
                if (ret < 0) break;
+               has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0;
                skip = 0;
                if (has_ref && (ma->flag&MPLP_REALN)) bam_prob_realn_core(b, ma->ref, 1);
                if (has_ref && ma->capQ_thres > 10) {
@@ -849,7 +850,7 @@ int bam_mpileup(int argc, char *argv[])
        int c;
     const char *file_list = NULL;
     char **fn = NULL;
-    int nfiles = 0;
+    int nfiles = 0, use_orphan = 0;
        mplp_conf_t mplp;
        memset(&mplp, 0, sizeof(mplp_conf_t));
        mplp.max_mq = 60;
@@ -858,7 +859,7 @@ int bam_mpileup(int argc, char *argv[])
        mplp.max_depth = 250;
        mplp.openQ = 40; mplp.extQ = 20; mplp.tandemQ = 100;
        mplp.flag = MPLP_NO_ORPHAN | MPLP_REALN;
-       while ((c = getopt(argc, argv, "gf:r:l:M:q:Q:uaORC:BDSd:b:P:o:e:h:I")) >= 0) {
+       while ((c = getopt(argc, argv, "Agf:r:l:M:q:Q:uaRC:BDSd:b:P:o:e:h:I")) >= 0) {
                switch (c) {
                case 'f':
                        mplp.fai = fai_load(optarg);
@@ -872,7 +873,6 @@ int bam_mpileup(int argc, char *argv[])
                case 'u': mplp.flag |= MPLP_NO_COMP | MPLP_GLF; break;
                case 'a': mplp.flag |= MPLP_NO_ORPHAN | MPLP_REALN; break;
                case 'B': mplp.flag &= ~MPLP_REALN & ~MPLP_NO_ORPHAN; break;
-               case 'O': mplp.flag |= MPLP_NO_ORPHAN; break;
                case 'R': mplp.flag |= MPLP_REALN; break;
                case 'D': mplp.flag |= MPLP_FMT_DP; break;
                case 'S': mplp.flag |= MPLP_FMT_SP; break;
@@ -885,8 +885,10 @@ int bam_mpileup(int argc, char *argv[])
                case 'o': mplp.openQ = atoi(optarg); break;
                case 'e': mplp.extQ = atoi(optarg); break;
                case 'h': mplp.tandemQ = atoi(optarg); break;
+               case 'A': use_orphan = 1; break;
                }
        }
+       if (use_orphan) mplp.flag &= ~MPLP_NO_ORPHAN;
        if (argc == 1) {
                fprintf(stderr, "\n");
                fprintf(stderr, "Usage:   samtools mpileup [options] in1.bam [in2.bam [...]]\n\n");
@@ -902,6 +904,7 @@ int bam_mpileup(int argc, char *argv[])
                fprintf(stderr, "         -o INT      Phred-scaled gap open sequencing error probability [%d]\n", mplp.openQ);
                fprintf(stderr, "         -e INT      Phred-scaled gap extension seq error probability [%d]\n", mplp.extQ);
                fprintf(stderr, "         -h INT      coefficient for homopolyer errors [%d]\n", mplp.tandemQ);
+               fprintf(stderr, "         -A          use anomolous read pairs in SNP/INDEL calling\n");
                fprintf(stderr, "         -g          generate BCF output\n");
                fprintf(stderr, "         -u          do not compress BCF output\n");
                fprintf(stderr, "         -B          disable BAQ computation\n");