Commit b3b8a581 authored by marc duez's avatar marc duez
Browse files

qunit: segmenter_test.js, use another set of data for test align

to avoid breaking other tests
parent 7c065000
Pipeline #114598 failed with stages
in 37 seconds
......@@ -65,7 +65,7 @@ json_data = {
]
},
{
"sequence" : "ATGCATGCATGCATGCCCCCCCCCCCCCAAATTTTTTTTTTTTTTTTTTTGATCGATCGATCGATCGAT",
"sequence" : "cccccgtcccccccatca",
"name" : "test2",
"id" : "id2",
"reads" : [20,20,10,10] ,
......@@ -86,7 +86,7 @@ json_data = {
]
},
{
"sequence" : "ATGCATGCATGCATGCCCCCCCCCCCCCCCCCCAAATTTTTTTTTTTTTTGATCGATCGATCGATCGAT",
"sequence" : "cccccccccccccccccccc",
"name" : "test3",
"id" : "id3",
"reads" : [25,25,50,3],
......@@ -235,6 +235,55 @@ json_data = {
]
};
json_data_align = {
"vidjil_json_version": ["2014.09"],
"reads": {
"segmented": [200,100,200,100],
"total": [200,100,200,100],
"germline": {
"TRG": [100,50,100,50],
"IGH": [100,50,100,50]
}
},
"samples": {
"timestamp": ["2014-10-20 13:59:02", "2014-10-25 14:00:32", "2014-11-20 14:03:13", "2014-12-20 14:04:48"],
"commandline": [
"./vidjil -c clones -g germline/ -r 1 -o ./out0 -z 200 -n 5 Diag.fa ",
],
"number": 4,
"original_names": [
"Diag.fa",
],
"log": [
" ==> segmented 362296 reads (38.7%)\n ==> found 11526 40-windows in 335725 segments (35.8%) inside 937164 sequences\n ",
],
"producer": ["ha","hi","ho","hu"],
"run_timestamp": ["2015-10-20 13:59:02", "2015-10-25 14:00:32", "2015-11-20 14:03:13", "2015-12-20 14:04:48"]
},
"data": {
"dataTest1" : [45],
"dataTest2" : [2]
},
"clones": [
{
"sequence" : "ATGCATGCATGCATGCCCCCCCCCCCCCAAATTTTTTTTTTTTTTTTTTTGATCGATCGATCGATCGAT",
"name" : "testalign1",
"id" : "id0",
"reads" : [20] ,
"top" : 1,
"germline" : "TRG",
},
{
"sequence" : "ATGCATGCATGCATGCCCCCCCCCCCCCCCCCCAAATTTTTTTTTTTTTTGATCGATCGATCGATCGAT",
"name" : "testalign2",
"id" : "id1",
"reads" : [25],
"top" : 2,
"germline" : "IGH",
}
]
};
data_distributions = {
......
......@@ -281,15 +281,15 @@ QUnit.test("segt", function (assert) {
QUnit.test("align", function (assert) {
var m = new Model();
m.parseJsonData(json_data, 100);
m.parseJsonData(json_data_align, 100);
m.initClones();
var segment = new Segment("segment",m);
segment.init();
segment.update();
//select 2 clones
m.select(0)
m.select(1)
m.select(2)
var done = assert.async(3);
var delay = 0;
......@@ -302,10 +302,10 @@ QUnit.test("align", function (assert) {
//test align
setTimeout( function() {
var aligned_sequence1 = segment.index[1].getElement("seq-mobil").innerText
var aligned_sequence1 = segment.index[0].getElement("seq-mobil").innerText
assert.ok(aligned_sequence1.includes("-"), "aligned sequence should contains '-' " + aligned_sequence1 )
var aligned_sequence2 = segment.index[2].getElement("seq-mobil").innerText
var aligned_sequence2 = segment.index[1].getElement("seq-mobil").innerText
assert.ok(aligned_sequence2.includes("-"), "aligned sequence should contains '-'" + aligned_sequence2 )
segment.resetAlign()
......@@ -314,10 +314,10 @@ QUnit.test("align", function (assert) {
//test resetAlign
setTimeout( function() {
aligned_sequence1 = segment.index[1].getElement("seq-mobil").innerText
aligned_sequence1 = segment.index[0].getElement("seq-mobil").innerText
assert.ok(!aligned_sequence1.includes("-"), "sequence should not contains '-' " + aligned_sequence1 )
aligned_sequence2 = segment.index[2].getElement("seq-mobil").innerText
aligned_sequence2 = segment.index[1].getElement("seq-mobil").innerText
assert.ok(!aligned_sequence2.includes("-"), "sequence should not contains '-' " + aligned_sequence2 )
done()
}, delay+=step)
......
......@@ -20,6 +20,7 @@
<script type="text/javascript" src='../../js/lib/file.js'></script>
<script type="text/javascript" src='../../js/lib/jquery.zclip.js'></script>
<script type="text/javascript" src='../../js/conf.js' data-cover></script>
<script type="text/javascript" src='../../js/view.js' data-cover></script>
<script type="text/javascript" src='../../js/compare.js' data-cover></script>
<script type="text/javascript" src='../../js/menu.js' data-cover></script>
......
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