Commit 6eadc191 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

tests: add tests to check both old (1-based) and new (0-based) 5/4/3 fields

parent 23a787d6
......@@ -11,7 +11,7 @@
"4" : "IGHD2*03",
'_evalue': 1e-2,
"3start" : 15,
"5" : {'start': 1, 'end': 5},
"5" : {'start': 1, 'end': 5}, // 0-based (old format, with 'end')
"cdr3": {
"start": 11,
"stop": 16,
......@@ -34,6 +34,10 @@
"reads" : [10,10,15,15] ,
"top" : 2,
"germline" : "TRG",
"seg" : {
"5" : {'start': 2, 'stop': 6}, // 1-based (current format)
}
}
var json_clone3 = {
......
......@@ -21,6 +21,9 @@ test("model: convert", function () {
deepEqual(m.convertSeg(json_clone3.seg), {"5": {"stop": 5}, "4": {"name": "IGHD2*03"}, "3": {"name": "IGHV4*01", "start": 15}, "junction": {"productive": false, "start": 2, "stop": 13}}, "convertSeg: Ok");
deepEqual(m.convertSeg(seg), {"3": {"name": "J", "start": 3}, "4": {"name": "D", "start": 1, "stop": 2}, "5": {"name": "V", "stop": 0}, "score": {"val": 42}, "cdr3": {"start": 0, "stop": 3}, "foo": {"start": 17, "stop": 42}}, "convertSeg: Ok");
deepEqual(m.convertSeg(json_clone1.seg)['5'], {"start": 1, "stop": 5}, "convertSeg on old 0-based 5/4/3 fields");
deepEqual(m.convertSeg(json_clone2.seg)['5'], {"start": 1, "stop": 5}, "convertSeg on current 1-based fields");
});
test("model : load", function() {
......
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