Commit 7fab37d0 authored by Thonier Florian's avatar Thonier Florian

test of clone, model and segmenter; update positons after fix of computeSegFeatureFromSeq fct

link to #3488
parent 54200a08
Pipeline #78281 passed with stages
in 5 minutes and 37 seconds
......@@ -311,7 +311,7 @@ QUnit.test("clone : feature defined by a nucleotide sequence", function(assert)
assert.deepEqual(c3.getSegStartStop('somefeature'), null, "start/stop positions are not present")
c3.computeSegFeatureFromSeq('somefeature')
assert.deepEqual(c3.getSegStartStop('somefeature'), {"start": 7, "stop": 13}, "start/stop positions, computed from sequence")
assert.deepEqual(c3.getSegStartStop('somefeature'), {"start": 6, "stop": 12}, "start/stop positions, computed from sequence")
assert.equal(c3.getSegLength('somefeature'), 7, "length of the feature");
});
......
......@@ -349,8 +349,8 @@ QUnit.test("model: primer detection", function(assert) {
// primer found inside clones
assert.equal(typeof m.clones[2]["seg"]["primer5"], "undefined", "Control neg primer 5 not in sequence")
assert.equal(typeof m.clones[2]["seg"]["primer3"], "undefined", "Control neg primer 3 not in sequence")
assert.deepEqual(m.clones[3]["seg"]["primer5"], { seq: "GGAAGGCCCCACAGCG", start: 1, stop: 16 }, "Found primer 5")
assert.deepEqual(m.clones[3]["seg"]["primer3"], { seq: "AACTTCGCCTGGTAA", start: 227, stop: 241 }, "Found primer 3")
assert.deepEqual(m.clones[3]["seg"]["primer5"], { seq: "GGAAGGCCCCACAGCG", start: 0, stop: 15 }, "Found primer 5")
assert.deepEqual(m.clones[3]["seg"]["primer3"], { seq: "AACTTCGCCTGGTAA", start: 226, stop: 240 }, "Found primer 3")
m.cleanPreviousFeature("primer3")
......
......@@ -111,8 +111,8 @@ QUnit.test("sequence", function(assert) {
assert.equal(h.stop, 6, '"f1" feature, stop')
h = seq1.get_positionned_highlight('f2', '')
assert.equal(h.start, 15, '"f2" feature, start')
assert.equal(h.stop, 20, '"f2" feature, stop')
assert.equal(h.start, 14, '"f2" feature, start')
assert.equal(h.stop, 19, '"f2" feature, stop')
segment.updateElemStyle([4]) /* Will remove sequence 4 from the segmenter
* as it is not really selected
......@@ -138,11 +138,11 @@ QUnit.test("segt", function (assert) {
assert.equal(m.clone(3).getSequence(),"GGAAGGCCCCACAGCGTCTTCTGTACTATGACGTCTCCACCGCAAGGGATGTGTTGGAATCAGGACTCAGTCCAGGAAAGTATTATACTCATACACCCAGGAGGTGGAGCTGGATATTGAGACTGCAAAATCTAATTGAAAATGATTCTGGGGTCTATTACTGTGCCACCTGGGACAGGCTGAAGGATTGGATCAAGACGTTTGCAAAAGGGACTAGGCTCATAGTAACTTCGCCTGGTAA","sequence")
m.clone(3).addSegFeatureFromSeq('test_feature','CACCCAGGAGGTGGAGCTGGATATTGAGACT');
f1 = segment.sequence[3].get_positionned_highlight('test_feature','');
assert.equal(f1.start, 94 , "feature start");
assert.equal(f1.stop, 124, "feature stop");
assert.equal(f1.start, 93 , "feature start");
assert.equal(f1.stop, 123, "feature stop");
assert.equal(f1.seq,'CACCCAGGAGGTGGAGCTGGATATTGAGACT', "feature sequence");
assert.equal(m.clone(3).getSegNtSequence("test_feature"), "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "feature sequence 3");
assert.deepEqual(m.clone(3).getSegFeature("test_feature"),{"seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 94, "stop": 124}, "feature sequence 4");
assert.deepEqual(m.clone(3).getSegFeature("test_feature"),{"seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 93, "stop": 123}, "feature sequence 4");
// segment.sequence[3].computeAAseq()
// assert.equal(m.clone(3).getSegAASequence("cdr3"),"AKDILKSLKQQLATPNWFDP","feature sequence 2")
......@@ -156,7 +156,7 @@ QUnit.test("segt", function (assert) {
var h = segment.sequence[3].get_positionned_highlight('f1','');
assert.equal(h.start,-1, " start feature value");
assert.equal(h.stop, -1, "stop feature value");
assert.deepEqual(segment.sequence[3].get_positionned_highlight("test_feature",""),{"color": "", "css": "highlight_seq", "seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 94, "stop": 124, "tooltip": ""}, "test feature value")
assert.deepEqual(segment.sequence[3].get_positionned_highlight("test_feature",""),{"color": "", "css": "highlight_seq", "seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 93, "stop": 123, "tooltip": ""}, "test feature value")
assert.equal(m.clone(3).getSegLength('test_feature'),31, "feature length");
m.unselectAll();
assert.equal(segment.toFasta(), "");
......
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