Browse code

stream past XS counts for indels (even when XS counting is disabled)

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/gmapR@113152 bc3139a8-67e5-0310-9ffc-ced21a209358

Michael Lawrence authored on 01/02/2016 20:11:05
Showing 2 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.13.9
12
+Version: 1.13.10
13 13
 Depends: R (>= 2.15.0), methods, GenomeInfoDb (>= 1.1.3),
14 14
         GenomicRanges (>= 1.17.12)
15 15
 Imports: S4Vectors (>= 0.9.25), IRanges, Rsamtools (>= 1.17.8),
... ...
@@ -195,19 +195,20 @@ read_xs_counts(unsigned char **bytes, int row, int *count_xs_plus,
195 195
                int *count_xs_minus)
196 196
 {
197 197
     int n_xs = read_int(bytes);
198
-    if (count_xs_plus == NULL) {
199
-        return;
198
+    if (count_xs_plus != NULL) {
199
+        count_xs_plus[row] = 0;
200
+        count_xs_minus[row] = 0;        
200 201
     }
201
-    count_xs_plus[row] = 0;
202
-    count_xs_minus[row] = 0;
203 202
     for (int index = 0; index < n_xs; index++) {
204 203
 	int xs = read_int(bytes);
205 204
 	int count = read_int(bytes);
206
-	if (xs == 1) {
207
-	    count_xs_plus[row] = count;
208
-	} else if (xs == 2) {
209
-	    count_xs_minus[row] = count;
210
-	} 
205
+        if (count_xs_plus != NULL) {
206
+            if (xs == 1) {
207
+                count_xs_plus[row] = count;
208
+            } else if (xs == 2) {
209
+                count_xs_minus[row] = count;
210
+            }
211
+        }
211 212
     }
212 213
 }
213 214