Commit 81f150f4 authored by Mikaël Salson's avatar Mikaël Salson

segmenter.js: Add is_clone property to know if a sequence is a clone

parent ecb9652f
...@@ -1194,6 +1194,7 @@ function genSeq(id, locus, model, segmenter) { ...@@ -1194,6 +1194,7 @@ function genSeq(id, locus, model, segmenter) {
this.pos = []; this.pos = [];
this.locus = locus this.locus = locus
this.use_marge = true; this.use_marge = true;
this.is_clone = false;
} }
genSeq.prototype= { genSeq.prototype= {
...@@ -1338,6 +1339,7 @@ function Sequence(id, model, segmenter) { ...@@ -1338,6 +1339,7 @@ function Sequence(id, model, segmenter) {
this.seq = []; this.seq = [];
this.pos = []; this.pos = [];
this.use_marge = true; this.use_marge = true;
this.is_clone = true;
this.locus = this.m.clone(id).germline; this.locus = this.m.clone(id).germline;
} }
......
...@@ -117,6 +117,8 @@ QUnit.test("segt", function (assert) { ...@@ -117,6 +117,8 @@ QUnit.test("segt", function (assert) {
// assert.deepEqual(m.clone(3).getSegFeature("cdr3"),{"seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 94, "stop": 124}, "feature sequence 4") // assert.deepEqual(m.clone(3).getSegFeature("cdr3"),{"seq": "CACCCAGGAGGTGGAGCTGGATATTGAGACT", "start": 94, "stop": 124}, "feature sequence 4")
assert.notEqual(segment.sequence[3].toString(),"ATCCT", "unsegmented sequence"); assert.notEqual(segment.sequence[3].toString(),"ATCCT", "unsegmented sequence");
assert.equal(segment.sequence[3].toString().indexOf(">cattcta<"),-1, "part of segmented seq"); assert.equal(segment.sequence[3].toString().indexOf(">cattcta<"),-1, "part of segmented seq");
assert.equal(segment.sequence[3].is_clone, true);
assert.equal(segment.sequence[1].is_clone, true);
var clone3 = m.clone(3); var clone3 = m.clone(3);
assert.deepEqual(segment.sequence[3].getVdjStartEnd(clone3), {"3": {"start": 183,"stop": 241}, "4": {}, "4a": {}, "4b": {}, "5": {"start": 0, "stop": 179}}, "vdj start end"); assert.deepEqual(segment.sequence[3].getVdjStartEnd(clone3), {"3": {"start": 183,"stop": 241}, "4": {}, "4a": {}, "4b": {}, "5": {"start": 0, "stop": 179}}, "vdj start end");
var h = segment.sequence[3].get_positionned_highlight('f1',''); var h = segment.sequence[3].get_positionned_highlight('f1','');
...@@ -143,6 +145,7 @@ QUnit.test("segt", function (assert) { ...@@ -143,6 +145,7 @@ QUnit.test("segt", function (assert) {
segment.init(); segment.init();
segment.addGermlineToSegmenter("IGHD1-1*01","IGH"); segment.addGermlineToSegmenter("IGHD1-1*01","IGH");
assert.equal(segment.sequence["IGHD1-1*01"].seq.join(""), "GGGCGCCGGGGCAGATTCTGAACAGCCCCGAGTCACGGTGGGTACAACTGGAACGAC") assert.equal(segment.sequence["IGHD1-1*01"].seq.join(""), "GGGCGCCGGGGCAGATTCTGAACAGCCCCGAGTCACGGTGGGTACAACTGGAACGAC")
assert.equal(segment.sequence["IGHD1-1*01"].is_clone, false);
m.select(2) m.select(2)
segment.addToSegmenter(2); segment.addToSegmenter(2);
segment.add_all_germline_to_segmenter(); segment.add_all_germline_to_segmenter();
...@@ -154,4 +157,5 @@ QUnit.test("segt", function (assert) { ...@@ -154,4 +157,5 @@ QUnit.test("segt", function (assert) {
segment.addSequenceTosegmenter("test","igh", "accccccgtgtagtagtcc") segment.addSequenceTosegmenter("test","igh", "accccccgtgtagtagtcc")
assert.equal(segment.sequence["test"].seq.join(""),"accccccgtgtagtagtcc"," test sequence ") assert.equal(segment.sequence["test"].seq.join(""),"accccccgtgtagtagtcc"," test sequence ")
}) assert.equal(segment.sequence["test"].is_clone, false);
\ No newline at end of file })
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