Commit 3109af79 authored by marc duez's avatar marc duez

screen_mrd.js : regroup screen_mrd functions in an object and extend clone prototype with it

parent 5b372f16
Pipeline #188588 passed with stages
in 19 minutes and 5 seconds
......@@ -84,7 +84,6 @@ function loadAfterConf() {
"../tips",
"../tokeniser",
"../indexedDom",
"../screen_MRD",
// Speed test
"../speed_test",
"../form_builder",
......@@ -92,6 +91,7 @@ function loadAfterConf() {
"../vidjil_vmi",
"../../test/QUnit/testFiles/data_test",
], function(){
if (typeof main == "undefined"){
require(["../main"]);
}else{
......@@ -100,6 +100,8 @@ function loadAfterConf() {
if (typeof config.addons !== "undefined") {
require(config.addons);
}
require(["../screen_MRD"]);
})
})
},
......
......@@ -36,10 +36,15 @@ UNIVERSAL_FAMILY = "UNI"
UNIVERSAL_COEFF = 'UNI_COEFF'
UNIVERSAL_R2 = 'UNI_R2'
/**
function ScreenMRD() {}
ScreenMRD.prototype = {
/**
* @return {string} the family used for fiting at the given time
*/
Clone.prototype.getFittingFamily = function(time) {
getFittingFamily : function(time) {
if (this.m.mrd.prevalent[time] == 0) {
// diagnostic sample
return "";
......@@ -49,13 +54,13 @@ Clone.prototype.getFittingFamily = function(time) {
// negative clone: report UNI
return UNIVERSAL_FAMILY;
}
};
},
/**
/**
* @return {string} the normalization coefficient at the given time
*/
Clone.prototype.getNormCoeff = function(time) {
getNormCoeff : function(time) {
if (this.m.mrd.prevalent[time] == 0) {
// diagnostic sample
return "";
......@@ -67,12 +72,12 @@ Clone.prototype.getNormCoeff = function(time) {
} else {
return "";
}
};
},
/**
/**
* @return {string} the Pearson R2 value for the spike-in fitting at the given time
*/
Clone.prototype.getR2 = function(time) {
getR2 : function(time) {
if (this.m.mrd.prevalent[time] == 0) {
// diagnostic sample
return "";
......@@ -84,27 +89,27 @@ Clone.prototype.getR2 = function(time) {
} else {
return "";
}
};
},
/**
/**
* @return {string} the prevalent germline at the given time
*/
Clone.prototype.getPrevalent = function(time) {
getPrevalent : function(time) {
if (this.m.mrd.prevalent[time] == 0) {
// diagnostic sample
return "";
} else {
return this.m.mrd.prevalent[time];
}
};
},
/**
/**
* @return {string} the amplification coefficient at the given time
* (ampl. coeff. = total prevalent / total spike)
*/
Clone.prototype.getAmplCoeff = function(time) {
getAmplCoeff : function(time) {
if (this.m.mrd.prevalent[time] == 0) {
// diagnostic sample
return "";
......@@ -113,13 +118,13 @@ Clone.prototype.getAmplCoeff = function(time) {
} else {
return "Please use version 6 or later of spike-normalization";
}
};
},
/**
/**
* Return info about a sequence/clone in html
*/
Clone.prototype.getHtmlInfo_prevalent = function () {
getHtmlInfo_prevalent : function () {
values = []
if ('mrd' in this) {
......@@ -156,4 +161,8 @@ Clone.prototype.getHtmlInfo_prevalent = function () {
}
return values
};
}
}
Clone.prototype = $.extend(Object.create(ScreenMRD.prototype), Clone.prototype);
\ No newline at end of file
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