Commit dba8ee31 authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-c/3513-export-vers-imgt-et-igblast-avec-sequences-unexpected' into 'dev'

Resolve "Export vers IMGT et IgBlast avec séquences unexpected"

Closes #3513

See merge request !307
parents 67bce190 9609aad7
Pipeline #48423 failed with stages
in 1 minute and 23 seconds
......@@ -443,6 +443,24 @@ Clone.prototype = {
return this.m.clusters[this.index]
},
/**
* @return {string} locus (at least the locus of the 5' gene)cluster number
*/
getLocus: function () {
var locus = this.get('germline')
if (typeof this.m.germline[locus] === "undefined") {
var loci = [this.getGene("5").substring(0,3), this.getGene("3").substring(0,3) ]
locus = loci[0]
if (loci[0] != loci[1]) {
console.log("Clone " + this.getName() + "recombines sequences from two separate loci. Using: " + locus)
}
}
return locus
},
/**
* compute the clone size ( ratio of all clones clustered ) at a given time
* @param {integer} time - tracking point (default value : current tracking point)
......
......@@ -814,23 +814,25 @@ Segment.prototype = {
for (var i = 0; i < list.length; i++) {
if (this.isClone(list[i])) {
var c = this.m.clone(list[i])
if (typeof (c.getSequence()) !== 0){
request += ">" + c.index + "#" + c.getName() + "\n" + c.getSequence() + "\n";
}else{
request += ">" + c.index + "#" + c.getName() + "\n" + c.id + "\n";
var c = this.m.clone(list[i])
if (typeof (c.getSequence()) !== 0){
request += ">" + c.index + "#" + c.getName() + "\n" + c.getSequence() + "\n";
} else {
request += ">" + c.index + "#" + c.getName() + "\n" + c.id + "\n";
}
if (c.getSize()>max){
system = c.getLocus()
max=c.getSize()
}
}
if (c.getSize()>max){
system=c.get('germline')
max=c.getSize()
else if (typeof this.germline[list[i]]) {
request += ">" +list[i] + "\n" +this.germline[this.sequence[list[i]].locus][list[i]] + "\n";
}
}
else if (typeof this.germline[list[i]]) {
request += ">" +list[i] + "\n" +this.germline[this.sequence[list[i]].locus][list[i]] + "\n";
}
}
if (address == 'IMGT') imgtPost(this.m.species, request, system);
if (address == 'IMGT') {
imgtPost(this.m.species, request, system);
}
if (address == 'IMGTSeg') {
imgtPostForSegmenter(this.m.species, request, system, this);
var change_options = {'l01p01c47' : 'N', // Deactivate default output
......
......@@ -35,7 +35,7 @@ QUnit.module("Clone", {
"name" : some_name,
"reads" : [10,10,30,0] ,
"top" : 2,
"germline" : "TRG",
"germline" : "IGH",
"warn": [{
"code": "Wxx",
"msg": "a warning that is only an information",
......@@ -139,6 +139,9 @@ QUnit.test("name, informations, getHtmlInfo", function(assert) {
assert.equal(c2.getName(), some_name, "clone2, .getName()");
assert.equal(c2.getShortName(), "IGHV3-23 6/ACGTG/4 D1-1 5/12/4 J5*02", "clone2, .getShortName()");
assert.equal(c1.getLocus(), "TRG")
assert.equal(c2.getLocus(), "IGH")
assert.equal(c1.isWarned(), 'warn', "clone1 is warned (client, bad e-value)")
assert.equal(c2.isWarned(), false, "clone2 is not warned (only 'info')")
assert.equal(c3.isWarned(), 'warn', "clone3 is warned with 'warn'")
......
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