Commit 7be1280e authored by Mathieu Giraud's avatar Mathieu Giraud

js/model.js: simplify m.normalize()

parent 846b0abb
......@@ -675,21 +675,18 @@ changeAlleleNotation: function(alleleNotation) {
normalize: function (original_size, time, normalized_reads) {
var normalized_size = 0;
if (this.normalization_mode == this.NORM_FALSE){
return original_size
} else if (this.normalization_mode == this.NORM_EXPECTED){
if (this.normalization_mode == this.NORM_EXPECTED){
if (this.normalization.size_list.length !== 0 && this.normalization.size_list[time] !== 0) {
var A = this.normalization.size_list[time] /* standard/spike at point time */
var B = this.normalization.expected_size /* standard/spike expected value */
normalized_size = (original_size * B) / A
return normalized_size
}else{
return original_size
}
} else if (this.normalization_mode == this.NORM_EXTERNAL && normalized_reads != undefined){
return Math.round(normalized_reads[time] / this.reads.segmented[time]) ;
}
// includes this.NORM_FALSE
return original_size
},
......
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