Trackster: bug fixes for read filtering.

This commit is contained in:
Jeremy Goecks
2012-03-08 12:29:13 -05:00
parent 047c1bff2f
commit b393ea6bbe
2 changed files with 20 additions and 7 deletions
@@ -718,7 +718,7 @@ class BamDataProvider( TracksDataProvider, FilterableMixin ):
else:
results.append( [ "%i_%s" % ( read.pos, qname ),
read.pos, read.pos + read_len, qname,
read.cigar, strand, read.seq, [read.mapq, 125] ] )
read.cigar, strand, read.seq, read.mapq ] )
# Take care of reads whose mates are out of range.
# TODO: count paired reads when adhering to max_vals?
+19 -6
View File
@@ -2480,14 +2480,27 @@ extend(NumberFilter.prototype, {
return updated;
}
//
// Update filter's min, max based on element values.
if (element[this.index] < this.min) {
this.min = Math.floor(element[this.index]);
updated = true;
//
// Make value(s) into an Array.
var values = element[this.index];
if (!(values instanceof Array)) {
values = [values];
}
if (element[this.index] > this.max) {
this.max = Math.ceil(element[this.index]);
updated = true;
// Loop through values and update min, max.
for (var i = 0; i < values.length; i++) {
var value = values[i];
if (value < this.min) {
this.min = Math.floor(value);
updated = true;
}
if (value > this.max) {
this.max = Math.ceil(value);
updated = true;
}
}
return updated;
},