Commit 95be4e07 authored by Francois Dubiez's avatar Francois Dubiez Committed by Mathieu Giraud

Updated Qunit test for

- tools lib functions tests
- highlight menu new options
parent c9a44d6c
json_data = { json_data = {
"vidjil_json_version": ["2014.09"], "vidjil_json_version": ["2014.09"],
"reads": { "reads": {
"segmented": [200,100,200,100], "segmented": [200,100,200,100],
"total": [200,100,200,100], "total": [200,100,200,100],
"germline": { "germline": {
"TRG": [100,50,100,50], "TRG": [100,50,100,50],
"IGH": [100,50,100,50] "IGH": [100,50,100,50]
} }
}, },
"samples": { "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"], "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": [ "commandline": [
"./vidjil -c clones -g germline/ -r 1 -o ./out0 -z 200 -n 5 Diag.fa ", "./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-1.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 ", "./vidjil -c clones -g germline/ -r 1 -o ./out2 -z 200 -n 5 Fu-2.fa ",
"./vidjil -c clones -g germline/ -r 1 -o ./out3 -z 200 -n 5 Fu-3.fa " "./vidjil -c clones -g germline/ -r 1 -o ./out3 -z 200 -n 5 Fu-3.fa "
], ],
"number": 4, "number": 4,
"original_names": [ "original_names": [
"Diag.fa", "Diag.fa",
"Fu-1.fa", "Fu-1.fa",
"Fu-2.fa", "Fu-2.fa",
"Fu-3.fa" "Fu-3.fa"
], ],
"log": [ "log": [
" ==> segmented 362296 reads (38.7%)\n ==> found 11526 40-windows in 335725 segments (35.8%) inside 937164 sequences\n ", " ==> segmented 362296 reads (38.7%)\n ==> found 11526 40-windows in 335725 segments (35.8%) inside 937164 sequences\n ",
" ==> segmented 407095 reads (56.5%)\n ==> found 35801 40-windows in 396776 segments (55.1%) inside 720531 sequences\n ", " ==> segmented 407095 reads (56.5%)\n ==> found 35801 40-windows in 396776 segments (55.1%) inside 720531 sequences\n ",
" ==> segmented 419506 reads (46.2%)\n ==> found 19567 40-windows in 400435 segments (44.1%) inside 908909 sequences\n ", " ==> segmented 419506 reads (46.2%)\n ==> found 19567 40-windows in 400435 segments (44.1%) inside 908909 sequences\n ",
" ==> segmented 448435 reads (48.2%)\n ==> found 43444 40-windows in 418595 segments (45%) inside 929901 sequences\n " " ==> segmented 448435 reads (48.2%)\n ==> found 43444 40-windows in 418595 segments (45%) inside 929901 sequences\n "
], ],
"producer": ["ha","hi","ho","hu"], "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"] "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": { "data": {
"dataTest1" : [45,60,52,60], "dataTest1" : [45,60,52,60],
"dataTest2" : [2,1,2,20] "dataTest2" : [2,1,2,20]
}, },
"clones": [ "clones": [
{ {
"sequence" : "aaaaaaaaaaaaaaaaaaaAG", "sequence" : "aaaaaaaaaaaaaaaaaaaAG",
"name" : "test1", "name" : "test1",
"id" : "id1", "id" : "id1",
...@@ -52,7 +52,7 @@ json_data = { ...@@ -52,7 +52,7 @@ json_data = {
"cdr3" : "AG" "cdr3" : "AG"
} }
}, },
{ {
"sequence" : "ccccccccccccccccca", "sequence" : "ccccccccccccccccca",
"name" : "test2", "name" : "test2",
"id" : "id2", "id" : "id2",
...@@ -67,7 +67,7 @@ json_data = { ...@@ -67,7 +67,7 @@ json_data = {
"fr1" : {"start" :2, "stop":5} "fr1" : {"start" :2, "stop":5}
} }
}, },
{ {
"sequence" : "cccccccccccccccccccc", "sequence" : "cccccccccccccccccccc",
"name" : "test3", "name" : "test3",
"id" : "id3", "id" : "id3",
...@@ -81,6 +81,106 @@ json_data = { ...@@ -81,6 +81,106 @@ json_data = {
"3start" : 15, "3start" : 15,
"5end" : 5 "5end" : 5
} }
},
{
"id": "id4",
"sequence": "GGAAGGCCCCACAGCGTCTTCTGTACTATGACGTCTCCACCGCAAGGGATGTGTTGGAATCAGGACTCAGTCCAGGAAAGTATTATACTCATACACCCAGGAGGTGGAGCTGGATATTGAGACTGCAAAATCTAATTGAAAATGATTCTGGGGTCTATTACTGTGCCACCTGGGACAGGCTGAAGGATTGGATCAAGACGTTTGCAAAAGGGACTAGGCTCATAGTAACTTCGCCTGGTAA",
"name": "test4",
"germline": "TRG",
"seg": {
"3": "TRGJP2*01",
"5": "TRGV3*01",
"3del": 5,
"3start": 183,
"5del": 0,
"5end": 178,
"5start": 0,
"N": 4,
"imgt": {
"Sequence ID": "TRGV3*01_-0/4/-5_TRGJP2*01",
"Functionality": "productive",
"V-GENE and allele": "Homsap TRGV3*01 F",
"J-GENE and allele": "Homsap TRGJP2*01 F",
"D-GENE and allele": "",
"JUNCTION frame": "in-frame",
"JUNCTION": "tgtgccacctgggacaggctgaaggattggatcaagacgttt",
"JUNCTION (with frameshift)": "",
"3'V-REGION": "tgtgccacctgggacagg",
"P3'V": "c",
"N-REGION": "tgaag",
"N1-REGION": "",
"P5'D": "",
"D-REGION": "",
"P3'D": "",
"P5'D1": "",
"D1-REGION": "",
"P3'D1": "",
"N2-REGION": "",
"P5'D2": "",
"D2-REGION": "",
"P3'D2": "",
"N3-REGION": "",
"P5'D3": "",
"D3-REGION": "",
"P3'D3": "",
"N4-REGION": "",
"P5'J": "",
"5'J-REGION": "gattggatcaagacgttt",
"JUNCTION-nt nb": "42",
"3'V-REGION-nt nb": "18",
"P3'V-nt nb": "1",
"N-REGION-nt nb": "5",
"N1-REGION-nt nb": "0",
"P5'D-nt nb": "0",
"D-REGION-nt nb": "0",
"P3'D-nt nb": "0",
"P5'D1-nt nb": "0",
"D1-REGION-nt nb": "0",
"P3'D1-nt nb": "0",
"N2-REGION-nt nb": "0",
"P5'D2-nt nb": "0",
"D2-REGION-nt nb": "0",
"P3'D2-nt nb": "0",
"N3-REGION-nt nb": "0",
"P5'D3-nt nb": "0",
"D3-REGION-nt nb": "0",
"N4-REGION-nt nb": "0",
"P5'J-nt nb": "0",
"5'J-REGION-nt nb": "18",
"3'V-REGION trimmed-nt nb": "0",
"5'D-REGION trimmed-nt nb": "0",
"3'D-REGION trimmed-nt nb": "0",
"5'D1-REGION trimmed-nt nb": "0",
"3'D1-REGION trimmed-nt nb": "0",
"5'D2-REGION trimmed-nt nb": "0",
"3'D2-REGION trimmed-nt nb": "0",
"5'D3-REGION trimmed-nt nb": "0",
"3'D3-REGION trimmed-nt nb": "0",
"5'J-REGION trimmed-nt nb": "8",
"3'V-REGION mut-nt nb": "0",
"D-REGION mut-nt nb": "0",
"D1-REGION mut-nt nb": "0",
"D2-REGION mut-nt nb": "0",
"D3-REGION mut-nt nb": "0",
"5'J-REGION mut-nt nb": "0",
"D-REGION reading frame": "",
"Ngc": "2/5",
"CDR3-IMGT length": "12",
"Molecular mass": "1783.0844800000002",
"pI": "8.2191162109375",
"3'V-REGION accepted mut nb": "0",
"D-REGION accepted mut nb": "0",
"5'J-REGION accepted mut nb": "0",
"Accepted D-GENE nb": "0",
"CDR3-IMGT": "gccacctgggacaggctgaaggattggatcaagacg",
"CDR3-IMGT-nt nb": "36",
"CDR3-IMGT (with frameshift)": "",
"CDR3-IMGT (AA)": "ATWDRLKDWIKT",
"CDR3-IMGT (AA) (with frameshift)": "",
"JUNCTION (AA)": "CATWDRLKDWIKTF",
"JUNCTION (AA) (with frameshift)": ""
},
}
} }
] ]
} };
\ No newline at end of file \ No newline at end of file
//Framework assertion example
module("tools", {
// setup:function(){alert("setup money individual test");},
// teardown:function(){alert("teardown money individual test");}
});
test("test nth_ocurrence", function () {
var str = "needle needle needle needle";
var m = nth_ocurrence(str, 'n', 3);
ok(m === 14, "Looking for the 3rd occurence of n in " + str);
var m = nth_ocurrence(str, 'E', 3);
ok(m === false, "search is casesensitive: no E in " + str);
var m = nth_ocurrence(str, 'z', 3);
ok(m === false, "No z in " + str);
}
);
test("test tsvToArray", function () {
var tabstring = "head1\thead2\thead3\thead4\nLine 1 data1\tLine 1 data2\tLine 1 data3\tLine 1 data4\n";
tabstring += "Line 2 data1\tLine 2 data2\tLine 2 data3\tLine 2 data4";
var aTest = tsvToArray(tabstring);
ok(aTest[0].head3 === "Line 1 data3", "Array[0].head3 =='Line 1 data3'");
ok(aTest[1].head2 === "Line 2 data2", "Array[1].head2=='Line 2 head2'");
ok(typeof(aTest[5]) === 'undefined', "Tis is only a 2 lines array, no line #5");
}
);
asyncTest("processImgtContents(IMGTresponse,tag)", function () {
expect(5);
var xhr = $.ajax({
url: 'testFiles/vquest_imgt.html',
dataType: 'html'
})
.done(function (html, status) {
ok(html.length > 0, "Test file was injected, html code received");
var imgtArray = processImgtContents(html, "pre");
ok(imgtArray[0]["Sequence number"] == "1", "first line is sequence 1");
ok(imgtArray[0]["CDR3-IMGT"] == "gcggcggaaactc", "CDR3-IMGT's seq 1 is gcggcggaaactc");
ok(imgtArray[3]["Sequence number"] == "4", "4th ligne is seq 4");
ok(imgtArray.length == 5, "5 sequences were identified");
QUnit.start(); // ...tell QUnit you're ready to go
});
}
);
test("computeStartStop(arrayToProcess,sequence)", function () {
var imgt2displayCheck = {
"3'V-REGION": {
"seq": "",
"tooltip": "Homsap TRGV3*01 F",
"start": 161,
"stop": 179
},
"5'J-REGION": {
"seq": "",
"tooltip": "Homsap TRGJP2*01 F",
"start": 185,
"stop": 203
},
"CDR3-IMGT": {
"seq": "",
"tooltip": "CDR3-IMGT",
"start": 164,
"stop": 200
}
};
var imgt2display = computeStartStop(json_data.clones[3].seg.imgt, json_data.clones[3].sequence);
ok(typeof imgt2display != 'undefined', "function returned a not null array");
deepEqual(imgt2display, imgt2displayCheck, "Processed array is similar to expected array");
}
);
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- saved from url=(0038)http://www.imgt.org/IMGT_vquest/vquest -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>IMGT/V-QUEST</title>
<link type="text/css" href="./vquest_files/VQUEST.css" rel="stylesheet">
<link type="text/css" href="./vquest_files/styleFoot.css" rel="stylesheet">
</head>
<body bgcolor="#FFFFFF">
<table cols="2" width="100%">
<tbody><tr>
<td align="LEFT" nowrap="" valign="middle" width="70%">
<font size="+3" color="#000099"><b>THANK YOU</b><br>
<b> for using
<a href="http://www.imgt.org/IMGT_vquest/share/textes/imgtvquest.html">
IMGT/V-QUEST</a></b>
</font><br>
<p>
<font color="#000099">THE<br>
INTERNATIONAL<br>
IMMUNOGENETICS<br>
INFORMATION SYSTEM</font></p></td>
<td align="RIGHT" valign="TOP" width="30%">
<img src="./vquest_files/logoIMGT.png" alt="WELCOME !"><p>
<font size="+1" color="#000099">
http://www.imgt.org</font>
</p></td>
</tr>
</tbody></table>
<p>
<!-- VQUEST/l02p01.html -->
</p><hr>
<pre>Date Sun Nov 08 18:24:53 CET 2015
IMGT/V-QUEST program version 3.3.5
IMGT/V-QUEST reference directory release 201544-3
Species Homo sapiens
Receptor type or locus TR
IMGT directory reference set F+ORF+ in-frame P
Search for insertions and deletions yes
CSV file: 2_IMGT-gapped-nt-sequences
Sequence number Sequence ID Functionality V-GENE and allele J-GENE and allele D-GENE and allele V-D-J-REGION V-J-REGION V-REGION FR1-IMGT CDR1-IMGT FR2-IMGT CDR2-IMGT FR3-IMGT CDR3-IMGT JUNCTION J-REGION FR4-IMGT
1 TRGV3*01_-13/4/-9_TRGJ1*02 unproductive Homsap TRGV3*01 F Homsap TRGJ1*01 F, or Homsap TRGJ1*02 F or Homsap TRGJ2*01 F ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgcggcggaaactctttggcagtggaacaacac ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgc .............................................................................. .................................... .........................ggaaggccccacagcgtcttctgtac tatgacgtctcc......accgcaagggat gtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgt gcggcggaaactc tgtgcggcggaaactcttt gaaactctttggcagtggaacaacac tttggcagtggaacaacac
2 TRGV3*01_-0/2/-0_TRGJ1*02 productive Homsap TRGV3*01 F Homsap TRGJ1*02 F ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacaggtgttattataagaaactctttggcagtggaacaacac ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacagg .............................................................................. .................................... .........................ggaaggccccacagcgtcttctgtac tatgacgtctcc......accgcaagggat gtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgt gccacctgggacaggtgttattataagaaactc tgtgccacctgggacaggtgttattataagaaactcttt ttattataagaaactctttggcagtggaacaacac tttggcagtggaacaacac
3 TRGV3*01_-1/4/-0_TRGJ1*02 unproductive Homsap TRGV3*01 F Homsap TRGJ1*02 F ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacagcgctttattataagaaactctttggcagtggaacaacac ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacag .............................................................................. .................................... .........................ggaaggccccacagcgtcttctgtac tatgacgtctcc......accgcaagggat gtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgt gccacctgggacagcgctttattataagaaactc tgtgccacctgggacagcgctttattataagaaactcttt ttattataagaaactctttggcagtggaacaacac tttggcagtggaacaacac
4 TRGV3*01_-0/9/-5_TRGJ1*02 unproductive Homsap TRGV3*01 F Homsap TRGJ1*02 F ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacaggctcaagggaataagaaactctttggcagtggaacaacac ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacagg .............................................................................. .................................... .........................ggaaggccccacagcgtcttctgtac tatgacgtctcc......accgcaagggat gtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgt gccacctgggacaggctcaagggaataagaaactc tgtgccacctgggacaggctcaagggaataagaaactcttt ataagaaactctttggcagtggaacaacac tttggcagtggaacaacac
5 TRGV3*01_-2/5/-2_TRGJ1*01 unproductive Homsap TRGV3*01 F Homsap TRGJ1*01 F, or Homsap TRGJ2*01 F ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggacatggggattattataagaaactctttggcagtggaacaacac ...........................................................................................................................................ggaaggccccacagcgtcttctgtactatgacgtctcc......accgcaagggatgtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgtgccacctgggaca .............................................................................. .................................... .........................ggaaggccccacagcgtcttctgtac tatgacgtctcc......accgcaagggat gtgttggaatcaggactcagtccaggaaagtattatactcatacaccc...aggaggtggagctggatattgagactgcaaaatctaattgaaaatgattctggggtctattactgt gccacctgggacatggggattattataagaaactc tgtgccacctgggacatggggattattataagaaactcttt attattataagaaactctttggcagtggaacaacac tttggcagtggaacaacac
</pre>
<hr><p>
<a href="http://www.imgt.org/IMGT_vquest/share/textes/imgtvquest.html">-&gt; IMGT/V-QUEST Documentation</a><br>
<a href="http://www.imgt.org/IMGT_vquest/share/textes/">-&gt; IMGT/V-QUEST Search page</a>
</p><p>
</p></body></html>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>QUnit - The Vidjil Project</title> <title>QUnit - The Vidjil Project</title>
<link rel="stylesheet" href="../../css/qunit-1.15.0.css"> <link rel="stylesheet" href="../../css/qunit-1.21.0.css">
<style> <style>
.flash_container, .log_container, .popup_container, .data-container, .info-container, .dataMenu, .tagSelector{ .flash_container, .log_container, .popup_container, .data-container, .info-container, .dataMenu, .tagSelector{
display:none !important; display:none !important;
...@@ -49,8 +49,11 @@ ...@@ -49,8 +49,11 @@
<script type="text/javascript" src='../../js/crossDomain.js' data-cover></script> <script type="text/javascript" src='../../js/crossDomain.js' data-cover></script>
<script type="text/javascript" src='../../js/pdf.js'></script> <script type="text/javascript" src='../../js/pdf.js'></script>
<script type="text/javascript" src='../../js/database.js' data-cover></script> <script type="text/javascript" src='../../js/database.js' data-cover></script>
<script type="text/javascript" src='../../js/tools.js' data-cover></script>
<script type="text/javascript" src="./testFiles/data_test.js"></script> <script type="text/javascript" src="./testFiles/data_test.js"></script>
<!-- needed to load form with jQuery -->
<script>QUnit.config.autostart=false;</script>
</head> </head>
<body> <body>
...@@ -66,9 +69,9 @@ ...@@ -66,9 +69,9 @@
<div id="qunit"></div> <div id="qunit"></div>
<div id="qunit-fixture"></div> <div id="qunit-fixture"></div>
<script src="../../js/lib/qunit-1.14.0.js"></script> <script src="../../js/lib/qunit-1.21.0.js"></script>
<script type="text/javascript" src="../../js/lib/qunit-tap.js"></script> <script type="text/javascript" src="../../js/lib/qunit-tap.1.5.0.js"></script>
<script src="../../js/lib/blanket.min.js"></script> <script src="../../js/lib/blanket.1.1.9.js"></script>
<script> <script>
...@@ -97,5 +100,6 @@ ...@@ -97,5 +100,6 @@
<script src="./testFiles/com_test.js"></script> <script src="./testFiles/com_test.js"></script>
<script src="./testFiles/list_test.js"></script> <script src="./testFiles/list_test.js"></script>
<script src="./testFiles/segmenter_test.js"></script> <script src="./testFiles/segmenter_test.js"></script>
<script src="./testFiles/tools_test.js"></script>
</body> </body>
</html> </html>
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