Commit 313def56 authored by flothoni's avatar flothoni

model_loader; add test for load analysis and stock_order usage

Link to #4354
parent 1f3f508a
Pipeline #152353 failed with stages
in 13 minutes and 2 seconds
......@@ -593,6 +593,7 @@ Model_loader.prototype = {
}
}
this.toggle_all_systems(true);
this.t = this.samples.order[0]
}else{
console.log({"type": "flash", "msg": "invalid version for this .analysis file" , "priority": 1});
......
......@@ -311,3 +311,72 @@ data_distributions = {
}]
}
}
analysis_data_stock_order = {
"producer": "browser",
"timestamp": "2017-2-13 10:41:25",
"vidjil_json_version": "2014.09",
"samples": {
"id": [
"Diag.fa",
"Fu-0.fa",
"Fu-1.fa",
"Fu-2.fa"
],
"timestamp": [
"2014-10-20 13:59:02",
"2014-10-22 11:00:32",
"2014-10-22 11:00:32",
"2014-10-25 14:00:32"
],
"commandline": [
"./vidjil -c clones -g germline/ -r 1 -o ./out0 -z 200 -n 5 Diag.fa ",
"./vidjil -c clones -g germline/ -r 1 -o ./out1 -z 200 -n 5 Fu-0.fa ",
"./vidjil -c clones -g germline/ -r 1 -o ./out1 -z 200 -n 5 Fu-0.fa ",
"./vidjil -c clones -g germline/ -r 1 -o ./out2 -z 200 -n 5 Fu-1.fa "
],
"number": 4,
"order": [
3,
0,
1
],
"stock_order": [
2,
3,
0,
1
],
"names": [
"diag",
"fu0",
"fu1",
"fu2"
]
},
"clones": [
],
"clusters": [],
"tags": {
"names": {
"0": "clone 1",
"1": "clone 2",
"2": "clone 3",
"3": "standard",
"4": "standard (noise)",
"5": "custom 1",
"6": "custom 2",
"7": "custom 3",
"8": "-/-"
},
"hide": []
},
"normalization": {
"A": [],
"B": 0,
"id": -1
}
}
......@@ -62,6 +62,23 @@ QUnit.test("load", function(assert) {
});
QUnit.test("load with new order && stock_order", function(assert) {
var m = new Model();
m.parseJsonData(json_data, 100)
m.initClones()
m.parseJsonAnalysis(analysis_data_stock_order)
m.initClones()
assert.deepEqual(m.samples.order, [3,0,1], "Correct order after loading" )
assert.deepEqual(m.samples.stock_order, [2,3,0,1], "Correct stock_order after loading" )
assert.equal(m.t, 3, "Correct time selected after analysis loading")
// Note, respective clone 0 size: 0.05, 0.1, 0.075, 0.15
assert.equal( m.clones[0].getSize(), m.clones[0].getSize(3), "clone 0 hve size corresponding to timepoint 3 (loading order)")
});
QUnit.test("time control", function(assert) {
var m = new Model();
m.parseJsonData(json_data)
......
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