Browse code

bam tally no longer crashes when NM exceeds maximum bin

Michael Lawrence authored on 05/02/2019 19:08:08
Showing1 changed files

... ...
@@ -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