Commit 44712843 authored by Thonier Florian's avatar Thonier Florian Committed by Mathieu Giraud

various browser files: update clone attribute usage

Link to #3945
parent 4450ccad
......@@ -446,7 +446,7 @@ Report.prototype = {
}
//remove virtual and disabled clones
if (i != norm && (this.m.clone(i).isVirtual() || !this.m.clone(i).isActive())) {
if (i != norm && (this.m.clone(i).isInScatterplot() || !this.m.clone(i).isActive())) {
polyline.parentNode.removeChild(polyline);
}
}
......@@ -524,7 +524,7 @@ Report.prototype = {
circle.setAttribute("stroke", color);
//remove virtual and disabled clones
if (this.m.clone(i).germline != system || this.m.clone(i).isVirtual() || !this.m.clone(i).isActive()) {
if (this.m.clone(i).germline != system || !this.m.clone(i).isInScatterplot() || !this.m.clone(i).isActive()) {
circle.parentNode.removeChild(circle);
}
}
......
......@@ -84,7 +84,7 @@ NumericalAxis.prototype = Object.create(GenericAxis.prototype);
if (this.ignore(this.values[i]))
continue;
if (! this.values[i].isVirtual()) {
if (!this.values[i].hasSizeOther()) {
var tmp = this.applyConverter(this.values[i]);
if ( typeof tmp != "undefined" && !isNaN(tmp)){
......
......@@ -638,6 +638,10 @@ Segment.prototype = {
* */
addToSegmenter: function (cloneID) {
var self = this;
if ( !this.m.clone(cloneID).hasSequence() ){
// This clone should not be added to the segmenter
return
}
this.aligned = false ;
this.resetAlign()
......@@ -657,14 +661,14 @@ Segment.prototype = {
var spanF = document.createElement('span');
spanF.id = "f" + cloneID;
this.div_elem(spanF, cloneID);
li.appendChild(spanF);
var spanM = document.createElement('span');
spanM.id = "m" + cloneID;
spanM.className = "seq-mobil";
spanM.innerHTML = this.sequence[cloneID].load().toString()
li.appendChild(spanF);
li.appendChild(spanM);
divParent.appendChild(li);
},
......@@ -1056,22 +1060,31 @@ Segment.prototype = {
var sumReads = 0;
var sumRawReads = 0;
var length = 0;
var nb_clones_not_constant = 0;
var lastActiveClone = 0;
//verifier que les points sélectionnés sont dans une germline courante
for (var i = 0; i < list.length ; i++){
if (this.m.clones[list[i]].isActive()) {
lastActiveClone = this.m.clones[list[i]]
length += 1;
sumPercentage += this.m.clone(list[i]).getSize();
sumReads+= this.m.clone(list[i]).getReads();
sumRawReads+= this.m.clone(list[i]).getRawReads();
if (lastActiveClone.hasSizeConstant()) {
length += 1;
} else {
var timepoint = this.m.t
nb_clones_not_constant += lastActiveClone.current_clones[timepoint];
}
sumPercentage += lastActiveClone.getSize();
sumReads+= lastActiveClone.getReads();
sumRawReads+= lastActiveClone.getRawReads();
}
}
var t = ""
if (sumRawReads > 0) {
t += length + " clone" + (length>1 ? "s" : "") + ", "
if (length) t += length ;
if (nb_clones_not_constant) t += '+' + nb_clones_not_constant;
t += " clone" + (length+nb_clones_not_constant>1 ? "s" : "") + ", "
t += this.m.toStringThousands(sumRawReads) + " read" + (sumRawReads>1 ? "s" : "")
......@@ -1081,8 +1094,11 @@ Segment.prototype = {
percentageStr = this.m.getStrAnySize(this.m.t, sumPercentage)
if (percentageStr != "+")
t += " (" + percentageStr + ")"
if (length == 1)
if (length == 1){
extra_info_system = lastActiveClone.getStrAllSystemSize(this.m.t, true)
} else {
extra_info_system = ""
}
t += " "
$(".focus_selected").css("display", "")
}
......@@ -1479,6 +1495,8 @@ Sequence.prototype = Object.create(genSeq.prototype);
var stop = -1;
var clone = this.m.clone(this.id);
if (!clone.hasSequence()) return
if (clone.hasSeg('cdr3')){
if (typeof clone.seg.cdr3.start != "undefined") {
start = this.pos[clone.seg.cdr3.start];
......
......@@ -80,7 +80,7 @@ function processResult(data) {
// Do not select virtual clones
var cloneIds = [];
for (var i = 0; i < model.clones.length; i++) {
if (! model.clones[i].isVirtual()) {
if (model.clones[i].isInteractable()) {
cloneIds.push(i);
}
}
......
......@@ -112,7 +112,7 @@ Url.prototype= {
var clones = this.url_dict.clone.split(',');
for (var j = 0; j < clones.length; j++) {
var c = this.m.clone(clones[j]);
if (typeof c !== "undefined" && !c.isVirtual()) {
if (typeof c !== "undefined" && c.isInteractable()) {
c.select = true;
}
}
......
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