Commit 771a3027 authored by Mathieu Giraud's avatar Mathieu Giraud

js/clone.js, js/segmenter.js: extract clone.getLocus()

See #3513.
parent 6e6a47ec
...@@ -443,6 +443,24 @@ Clone.prototype = { ...@@ -443,6 +443,24 @@ Clone.prototype = {
return this.m.clusters[this.index] return this.m.clusters[this.index]
}, },
/**
* @return {string} locus (at least the locus of the 5' gene)cluster number
*/
getLocus: function () {
locus = this.get('germline')
if (locus == "unexpected") {
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 * compute the clone size ( ratio of all clones clustered ) at a given time
* @param {integer} time - tracking point (default value : current tracking point) * @param {integer} time - tracking point (default value : current tracking point)
......
...@@ -822,15 +822,7 @@ Segment.prototype = { ...@@ -822,15 +822,7 @@ Segment.prototype = {
request += ">" + c.index + "#" + c.getName() + "\n" + c.id + "\n"; request += ">" + c.index + "#" + c.getName() + "\n" + c.id + "\n";
} }
if (c.getSize()>max){ if (c.getSize()>max){
system=c.get('germline') system = c.getLocus()
if (system == "unexpected"){
var loci = [c.getGene("5").substring(0,3), c.getGene("3").substring(0,3) ]
system = loci[0]
if (loci[0] != loci[1]){
console.log("Clone " + c.getName() + "recombines sequences from two separate loci. Using: " + system)
}
}
max=c.getSize() max=c.getSize()
} }
} }
......
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