]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_plcmd.c
backup commit
[samtools.git] / bam_plcmd.c
index f77be0467e6442c12145a35ebb97259e237d5625..3f5d424826ddee9952b6c4f2fcf17e3c2c40688f 100644 (file)
@@ -210,7 +210,7 @@ static int mpileup(mplp_conf_t *conf, int n, char **fn)
                data[i]->fp = strcmp(fn[i], "-") == 0? bam_dopen(fileno(stdin), "r") : bam_open(fn[i], "r");
         if ( !data[i]->fp )
         {
-            fprintf(stderr, "[%s] failed to open %d-th input.\n", __func__, i+1);
+            fprintf(stderr, "[%s] failed to open %s: %s\n", __func__, fn[i], strerror(errno));
             exit(1);
         }
                data[i]->conf = conf;
@@ -223,11 +223,11 @@ static int mpileup(mplp_conf_t *conf, int n, char **fn)
                        bam_index_t *idx;
                        idx = bam_index_load(fn[i]);
                        if (idx == 0) {
-                               fprintf(stderr, "[%s] fail to load index for %d-th input.\n", __func__, i+1);
+                               fprintf(stderr, "[%s] fail to load index for %s\n", __func__, fn[i]);
                                exit(1);
                        }
                        if (bam_parse_region(h_tmp, conf->reg, &tid, &beg, &end) < 0) {
-                               fprintf(stderr, "[%s] malformatted region or wrong seqname for %d-th input.\n", __func__, i+1);
+                               fprintf(stderr, "[%s] malformatted region or wrong seqname for %s\n", __func__, fn[i]);
                                exit(1);
                        }
                        if (i == 0) tid0 = tid, beg0 = beg, end0 = end;
@@ -312,7 +312,7 @@ static int mpileup(mplp_conf_t *conf, int n, char **fn)
                        ref16 = bam_nt16_table[_ref0];
                        for (i = 0; i < gplp.n; ++i)
                                bcf_call_glfgen(gplp.n_plp[i], gplp.plp[i], ref16, bca, bcr + i);
-                       bcf_call_combine(gplp.n, bcr, ref16, &bc);
+                       bcf_call_combine(gplp.n, bcr, bca, ref16, &bc);
                        bcf_call2bcf(tid, pos, &bc, b, bcr, conf->fmt_flag, 0, 0);
                        bcf_write(bp, bh, b);
                        bcf_destroy(b);
@@ -320,7 +320,7 @@ static int mpileup(mplp_conf_t *conf, int n, char **fn)
                        if (!(conf->flag&MPLP_NO_INDEL) && total_depth < max_indel_depth && bcf_call_gap_prep(gplp.n, gplp.n_plp, gplp.plp, pos, bca, ref, rghash) >= 0) {
                                for (i = 0; i < gplp.n; ++i)
                                        bcf_call_glfgen(gplp.n_plp[i], gplp.plp[i], -1, bca, bcr + i);
-                               if (bcf_call_combine(gplp.n, bcr, -1, &bc) >= 0) {
+                               if (bcf_call_combine(gplp.n, bcr, bca, -1, &bc) >= 0) {
                                        b = calloc(1, sizeof(bcf1_t));
                                        bcf_call2bcf(tid, pos, &bc, b, bcr, conf->fmt_flag, bca, ref);
                                        bcf_write(bp, bh, b);