Commit 271b2dd4 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-c/3989-afficher-des-informations-sur-tout-clone' into 'dev'

Resolve "Afficher des informations sur tout clone"

Closes #3989

See merge request !526
parents 0c0b01f3 2bcdfec7
Pipeline #101790 failed with stages
in 10 minutes and 34 seconds
......@@ -1350,9 +1350,11 @@ Clone.prototype = {
//sequence info (or cluster main sequence info)
html += row_1("sequence name", this.getSequenceName())
html += row_1("code", this.getCode())
html += row_1("length", this.getSequenceLength())
if (this.hasSequence()){
html += row_1("sequence name", this.getSequenceName())
html += row_1("code", this.getCode())
html += row_1("length", this.getSequenceLength())
}
//coverage info
if (typeof this.coverage != 'undefined') {
......@@ -1407,16 +1409,28 @@ Clone.prototype = {
}
}
html += row_1("sequence", this.sequence)
html += row_1("id", this.id)
html += row_1("locus", this.m.systemBox(this.germline).outerHTML + this.germline +
if (this.hasSequence()){
html += row_1("sequence", this.sequence)
}
if (this.id != undefined){
html += row_1("id", this.id)
}
if (this.id != undefined){
html += row_1("locus", this.m.systemBox(this.germline).outerHTML + this.germline +
"<div class='div-menu-selector' id='listLocus' style='display: none'>" + this.createLocusList() + "</div>")
html += row_1("V gene (or 5')", this.getGene("5") +
}
if (this.hasSizeConstant() || (this.hasSizeDistrib() && this.getGene("5") != "undefined V")){
html += row_1("V gene (or 5')", this.getGene("5") +
"<div class='div-menu-selector' id='listVsegment' style='display: none'>" + this.createSegmentList("Vsegment") + "</div>")
html += row_1("(D gene)", this.getGene("4") +
}
if (this.hasSizeConstant() || (this.hasSizeDistrib() && this.getGene("4") != "undefined D")){
html += row_1("(D gene)", this.getGene("4") +
"<div class='div-menu-selector' id='listDsegment' style='display: none'>" + this.createSegmentList("Dsegment") + "</div>")
html += row_1("J gene (or 3')", this.getGene("3") +
}
if (this.hasSizeConstant() || (this.hasSizeDistrib() && this.getGene("3") != "undefined J")){
html += row_1("J gene (or 3')", this.getGene("3") +
"<div class='div-menu-selector' id='listJsegment' style='display: none'>" + this.createSegmentList("Jsegment") + "</div>")
}
// Other seg info
var exclude_seg_info = ['affectSigns', 'affectValues', '5', '4', '3']
......
......@@ -255,9 +255,56 @@ QUnit.test("name, informations, getHtmlInfo", function(assert) {
"getHtmlInfo c3: junction info for non productive clone");
assert.includes(html, "<tr><td>junction (AA seq)</td><td colspan='4'>WKIC</td></tr>",
"getHtmlInfo c3: junction (AAseq) info for non productive clone");
// test sequence if not prsent
html = c5.getHtmlInfo();
var notinclude = html.includes("<td>sequence</td>")
assert.notOk(notinclude, "getHtmlInfo: if no sequence, no field sequence (even if real clone)");
////////////////////////////////////////////
// Test getHTMLinfo getted for distrib clone
// ("axes": ["lenSeqAverage", "seg5"])
m.t = 0
var raw_data = {
"id": "distrib_5", "top":0, "germline": "distrib",
"seg":{}, "sequence":0,
"reads": [100, 100, 100, 100],
"axes": ["lenSeqAverage", "seg5"], "clone_number": [20, 20, 20, 20],
"distrib_content": ["162", "segV"]
}
m = new Model();
m.samples = {"number":0, "order":[0], "original_names": ["file"]}
m.reads = {
"segmented": [200,100,200,100],
"total": [200,100,200,100],
"germline": {
"TRG": [100,50,100,50],
"IGH": [100,50,100,50]
}
}
dclone = new Clone(raw_data, m, 0, C_INTERACTABLE | C_IN_SCATTERPLOT | C_SIZE_DISTRIB)
dclone.augmentedDistribCloneData(raw_data.axes, raw_data.distrib_content )
dclone.axes = raw_data.axes
dclone.reads = raw_data.reads
dclone.clone_number = raw_data.clone_number
dclone.top = 0
dclone.active = true
dclone.current_reads = JSON.parse(JSON.stringify(raw_data.reads))
dclone.defineCompatibleClones()
dclone.updateReadsDistribClones()
html = m.clones[0].getHtmlInfo();
// Sequence
var notinclude = html.includes("<td>sequence</td>")
assert.notOk(notinclude, "getHtmlInfo: if no sequence, no field sequence");
// gene V
assert.includes(html, "<tr><td>V gene (or 5')</td>",
"getHtmlInfo: distrib clone with seg5 have field segment V");
// gene J
var notinclude = html.includes("<td>J gene (or 3')</td>")
assert.notOk(notinclude, "getHtmlInfo: if no seg3, no field segment J");
});
QUnit.test('clone: get info from seg', function(assert) {
var m = new Model();
m.parseJsonData(json_data)
......
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