]> git.donarmstrong.com Git - samtools.git/blobdiff - padding.c
Update 'samtools depad' help text regarding FASTA reference file
[samtools.git] / padding.c
index a8da562d0872e8b0930bb2bdd3dcc9abb58bab7b..71dfc25957bf38214e899cbd92b653bd729f3373 100644 (file)
--- a/padding.c
+++ b/padding.c
@@ -195,6 +195,7 @@ int bam_pad2unpad(samfile_t *in, samfile_t *out, faidx_t *fai)
                        write_cigar(cigar2, n2, m2, bam_cigar_gen(b->core.l_qseq, BAM_CMATCH));
                        replace_cigar(b, n2, cigar2);
                        posmap = update_posmap(posmap, r);
+                       b->core.bin = bam_reg2bin(0, bam_calend(&b->core, bam1_cigar(b)));
                } else if (b->core.n_cigar > 0) {
                        int i, k, op;
                        if (b->core.tid < 0) {
@@ -272,6 +273,7 @@ int bam_pad2unpad(samfile_t *in, samfile_t *out, faidx_t *fai)
                        n2 = k;
                        replace_cigar(b, n2, cigar2);
                        b->core.pos = posmap[b->core.pos];
+                       b->core.bin = bam_reg2bin(b->core.pos, bam_calend(&b->core.pos, bam1_cigar(b)));
                        if (b->core.mtid < 0 || b->core.mpos < 0) {
                                /* Nice case, no mate to worry about*/
                                // fprintf(stderr, "[depad] Read '%s' mate not mapped\n", bam1_qname(b));
@@ -463,7 +465,7 @@ static int usage(int is_long_help)
        fprintf(stderr, "         -S       input is SAM (default is BAM)\n");
        fprintf(stderr, "         -u       uncompressed BAM output (can't use with -s)\n");
        fprintf(stderr, "         -1       fast compression BAM output (can't use with -s)\n");
-       fprintf(stderr, "         -T FILE  reference sequence file [null]\n");
+       fprintf(stderr, "         -T FILE  padded reference sequence file [null]\n");
        fprintf(stderr, "         -o FILE  output file name [stdout]\n");
        fprintf(stderr, "         -?       longer help\n");
        fprintf(stderr, "\n");
@@ -471,7 +473,7 @@ static int usage(int is_long_help)
                fprintf(stderr, "Notes:\n\
 \n\
   1. Requires embedded reference sequences (before the reads for that reference),\n\
-     with the future aim to also support a FASTA padded reference sequence file.\n\
+     or ideally a FASTA file of the padded reference sequences (via the -T argument).\n\
 \n\
   2. The input padded alignment read's CIGAR strings must not use P or I operators.\n\
 \n");