Browse code

bam tally no longer crashes when NM exceeds maximum bin

Michael Lawrence authored on 05/02/2019 19:11:42
Showing2 changed files

... ...
@@ -9,7 +9,7 @@ Description: GSNAP and GMAP are a pair of tools to align short-read
9 9
         methods to work with GMAP and GSNAP from within R. In addition,
10 10
         it provides methods to tally alignment results on a
11 11
         per-nucleotide basis using the bam_tally tool.
12
-Version: 1.25.1
12
+Version: 1.25.2
13 13
 Depends: R (>= 2.15.0), methods, GenomeInfoDb (>= 1.1.3),
14 14
         GenomicRanges (>= 1.31.8), Rsamtools (>= 1.31.2)
15 15
 Imports: S4Vectors (>= 0.17.25), IRanges (>= 2.13.12), BiocGenerics (>= 0.25.1),
... ...
@@ -5782,7 +5782,9 @@ revise_position (char querynt, char genomicnt, int nm, int xs, int signed_shift,
5782 5782
 	this->matches_byshift_minus[-signed_shift] += n_passing_counts;
5783 5783
       }
5784 5784
 
5785
-      this->matches_bynm[nm] += n_passing_counts;
5785
+      if (nm < this->n_matches_bynm) {
5786
+	  this->matches_bynm[nm] += n_passing_counts;
5787
+      }
5786 5788
       this->matches_byxs[xs] += n_passing_counts;
5787 5789
     }
5788 5790