Commit 300389bb authored by Ryan Herbert's avatar Ryan Herbert

QUnit tests: test new analysis sample identification

Adds a test that ensures deleting a sample will not overwrite the wrong
information when loading the analysis.
parent 793721fe
......@@ -223,6 +223,16 @@ QUnit.test("system selection", function(assert) {
assert.notEqual(m.system_selected.indexOf("IGH"), 1, "IGH selected")
});
test("model: analysis sample data application", function() {
var m = new Model();
m.parseJsonData(json_data, 100);
m.parseJsonAnalysis(analysis_data);
console.log("###############################################");
console.log("samples: " + m.samples.names);
notEqual(m.samples.names[1], "fu0", "missing sample successfully ignored");
equal(m.samples.names[1], "fu1", "correctly shifted samples");
});
......
analysis_data = {
"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-25 14:00:32",
"2014-11-20 14:03:13"
],
"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-1.fa ",
"./vidjil -c clones -g germline/ -r 1 -o ./out2 -z 200 -n 5 Fu-2.fa "
],
"number": 4,
"order": [
0,
1,
2,
3
],
"names": [
"diag",
"fu0",
"fu1",
"fu2"
]
},
"clones": [
{
"id": "id1",
"sequence": "aaaaaaaaaaaaaaaaaaaag",
"tag": "0"
}
],
"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": {
"method": "constant",
"A": [],
"B": 0,
"id": -1
}
}
......@@ -53,6 +53,7 @@
<script type="text/javascript" src='../../js/speed_test.js' data-cover></script>
<script type="text/javascript" src="./testFiles/data_test.js"></script>
<script type="text/javascript" src="./testFiles/test2.analysis"></script>
<!-- needed to load form with jQuery -->
<script>QUnit.config.autostart=false;</script>
</head>
......
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