Commit 8cce9045 authored by Mathieu Giraud's avatar Mathieu Giraud

js/{model,clone}.js: clone.getRawReads(), bypass normalization

see #3662 and #3650.
parent de61fc3f
...@@ -688,21 +688,25 @@ Clone.prototype = { ...@@ -688,21 +688,25 @@ Clone.prototype = {
}, },
/* compute the clone reads number ( sum of all reads of clones clustered ) /* compute the clone reads number ( sum of all reads of clones clustered )
* @t : tracking point (default value : current tracking point) * @time : tracking point (default value : current tracking point)
* @raw: do not normalize
* */ * */
getReads: function (time) { getReads: function (time, raw) {
time = this.m.getTime(time) time = this.m.getTime(time)
var result = 0; var result = 0;
var cluster = this.getCluster() var cluster = this.getCluster()
for (var j = 0; j < cluster.length; j++) { for (var j = 0; j < cluster.length; j++) {
result += this.m.normalize_reads(this.m.clone(cluster[j]), time); result += this.m.normalize_reads(this.m.clone(cluster[j]), time, raw);
} }
return result return result
}, //end getSize },
getRawReads: function (time) {
return this.getReads(time, true)
},
/* return a list of read numbers (sum of all reads of clustered clones) for all samples /* return a list of read numbers (sum of all reads of clustered clones) for all samples
* */ * */
......
...@@ -689,10 +689,11 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -689,10 +689,11 @@ changeAlleleNotation: function(alleleNotation) {
}, },
/** /**
* normalize a number of reads * normalize a number of reads according to this.NORM_EXTERNAL
* if raw is defined, do not normalize
*/ */
normalize_reads: function(clone, time) { normalize_reads: function(clone, time, raw) {
if (this.normalization_mode == this.NORM_EXTERNAL && clone.normalized_reads != undefined) { if (this.normalization_mode == this.NORM_EXTERNAL && clone.normalized_reads != undefined && !(raw != undefined)) {
return clone.normalized_reads[time] ; return clone.normalized_reads[time] ;
} else { } else {
return clone.reads[time] ; return clone.reads[time] ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment