Commit 1f6b2afc authored by aurelien beliard's avatar aurelien beliard Committed by Mathieu Giraud

remove to_100 normalization method

parent d2d3c5d8
...@@ -474,7 +474,7 @@ Clone.prototype = { ...@@ -474,7 +474,7 @@ Clone.prototype = {
if (this.m.reads.segmented[time] === 0 ) return 0 if (this.m.reads.segmented[time] === 0 ) return 0
var result = this.getReads(time) / this.m.reads.segmented[time] var result = this.getReads(time) / this.m.reads.segmented[time]
if (this.m.norm && this.m.normalization.method!="constant") result = this.m.normalize(result, time) if (this.m.norm ) result = this.m.normalize(result, time)
return result return result
}, },
......
...@@ -971,7 +971,7 @@ Graph.prototype = { ...@@ -971,7 +971,7 @@ Graph.prototype = {
var max = this.m.precision*this.m.max_size var max = this.m.precision*this.m.max_size
//get ready for something really dirty //get ready for something really dirty
if (this.m.norm && this.m.normalization.method == "constant"){ if (this.m.norm){
for (var i=0; i<this.m.samples.order.length; i++) { for (var i=0; i<this.m.samples.order.length; i++) {
for (var j=0; j<this.m.clones.length; j++){ for (var j=0; j<this.m.clones.length; j++){
var size = this.m.precision*this.m.clone(j).getSize() var size = this.m.precision*this.m.clone(j).getSize()
......
...@@ -625,11 +625,12 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -625,11 +625,12 @@ changeAlleleNotation: function(alleleNotation) {
var A = this.normalization.A[time] /* standard/spike at point time */ var A = this.normalization.A[time] /* standard/spike at point time */
var B = this.normalization.B /* standard/spike expected value */ var B = this.normalization.B /* standard/spike expected value */
if (this.normalization.method=="constant" || original_size <= A){ if (original_size <= A){
normalized_size = (original_size * B) / A normalized_size = (original_size * B) / A
}else{
normalized_size = B + ( (original_size - A) * ( (1 - B) / (1 - A) ) )
} }
// }else{
// normalized_size = B + ( (original_size - A) * ( (1 - B) / (1 - A) ) )
// }
}else{ }else{
normalized_size = original_size normalized_size = original_size
...@@ -716,7 +717,7 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -716,7 +717,7 @@ changeAlleleNotation: function(alleleNotation) {
this.max_size = 1 this.max_size = 1
this.min_size = min_size this.min_size = min_size
if (this.norm && this.normalization.method=="constant"){ if (this.norm){
for (var j=0; j<this.samples.order.length; j++){ for (var j=0; j<this.samples.order.length; j++){
if(this.normalization.A[j]==0){ if(this.normalization.A[j]==0){
max = this.normalization.B max = this.normalization.B
...@@ -1932,20 +1933,8 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -1932,20 +1933,8 @@ changeAlleleNotation: function(alleleNotation) {
if (top>maxTop) top=maxTop; if (top>maxTop) top=maxTop;
this.tagSelector.style.top=top+"px"; this.tagSelector.style.top=top+"px";
}, },
/**
* change the strategy for normalization
* @param {string} method - can be 'constant' or 'to-100'
* */
changeNormMethod : function (method){
this.normalization.method=method;
if (this.normalization.type=="data" && method !="constant"){
this.normalization.method="constant";
}
this.update()
},
/** /**
* load a new germline and update * load a new germline and update
* @param {string} system - system string to load * @param {string} system - system string to load
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
"hide": [] "hide": []
}, },
"normalization": { "normalization": {
"method": "constant",
"A": [], "A": [],
"B": 0, "B": 0,
"id": -1 "id": -1
......
...@@ -68,7 +68,6 @@ analysis_data = { ...@@ -68,7 +68,6 @@ analysis_data = {
"hide": [] "hide": []
}, },
"normalization": { "normalization": {
"method": "constant",
"A": [], "A": [],
"B": 0, "B": 0,
"id": -1 "id": -1
......
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