Commit 4a289a70 authored by flothoni's avatar flothoni

tt

parent ea250407
Pipeline #91404 failed with stages
in 6 seconds
......@@ -64,6 +64,7 @@ function Clone(data, model, index, type_clone) {
var key = Object.keys(data)
for (var i=0; i<key.length; i++ ){
if (key[i] == "axes") { console.log( "founded: axes;"); console.log( data[key[i]].toString() )}
this[key[i]]=data[key[i]]
}
......@@ -1697,10 +1698,11 @@ Clone.prototype = {
// "productive", //"junction_start", "junction_stop",
// "rearangment", "complete",
// ]
// console.log( "dclone axes: " + axes.toString() )
var values = []
for (var a = 0; a < axes.length; a++) {
var axe = axes[a]
if (axe == "germline") { values.push( this.get('germline') ) }
if (axe == "germline") { values.push( this.get('germline') ) }
else if (axe == "seg5") { values.push( this.getGene("5", false) ) }
else if (axe == "seg4") { values.push( this.getGene("4", false) ) }
else if (axe == "seg3") { values.push( this.getGene("3", false) ) }
......@@ -1776,24 +1778,24 @@ Clone.prototype = {
/// TODO; move it at another place
// List of axe that must be in an array format
this.distrib_axe_is_timmed = {
var distrib_axe_is_timmed = {
"lenSeqConsensus": true,
"lenSeqAverage": true,
"coverage": true,
}
// List of axe that must be returned as number
this.distrib_axe_as_number = {
var distrib_axe_as_number = {
"GCContent": true
}
/// TOdo : end
// Convert as number if needed
if (this.distrib_axe_as_number[axe]){ value = Number(value)}
if (distrib_axe_as_number[axe]){ value = Number(value)}
// Convert as a list if needed
if (this.distrib_axe_is_timmed[axe]) {
var timepoint = this.samples.order.indexOf(this.t)
var tmpValue = Array.apply(null, Array(this.samples.number))
if (distrib_axe_is_timmed[axe]) {
var timepoint = this.m.samples.order.indexOf(this.t)
var tmpValue = Array.apply(null, Array(this.m.samples.number))
tmpValue[timepoint] = value
value = tmpValue
}
......
......@@ -385,16 +385,20 @@ Graph.prototype = {
}
}else{
var list = []
for (var j = 0; j < this.m.clones.length; j++) list.push(j)
for (var j = 0; j < this.m.clones.length; j++) {
if (!this.m.clones[j].is_distrib()){
list.push(j)
}
}
this.updateElem(list)
}
return this
},
/* update a list of selected clones
*
* */
/**
* update a list of selected clones
**/
updateElem: function (list) {
if (this.mode == "stack"){
//in stack mode we can't update only a few clones whithout updating all of them
......
......@@ -1161,6 +1161,7 @@ changeAlleleNotation: function(alleleNotation) {
if (!this.clone(i).split) {
for (var j = 0; j < this.clusters[i].length; j++) {
seq = this.clusters[i][j]
console.log( i + " -- "+ j + "; '" + seq + "'")
var subclone = this.clone(seq);
subclone.disable();
if (seq != i && subclone.isSelected())
......@@ -1210,7 +1211,7 @@ changeAlleleNotation: function(alleleNotation) {
// Get current time
var current_pos = this.samples.order.indexOf(this.t)
console.error( " Timepoint: " + current_pos )
// console.error( " Timepoint: " + current_pos )
// update distrib clones current size
for (var m = 0; m < this.clones.length; m++) {
// recuperer le time pour être certain de la soustraction.
......@@ -2980,11 +2981,18 @@ changeAlleleNotation: function(alleleNotation) {
// Compute new index
var index = this.clones.length
// Minimal clone data content
var raw_data = {"reads": [reads], "sequence":0, "id": "distrib_"+index, "top":0, "germline": "distrib", "seg":{}, "scatter":scatter_id, "axes":distrib.axes}
// Increase data with specific content
var raw_data = {"reads": [reads], "sequence":0, "id": "distrib_"+index, "top":0, "germline": "distrib", "seg":{}}
// console.log( "raw_data:")
// console.log( raw_data.toString() )
// console.log( raw_data.axes.toString() )
// console.log( "====")
// console.log( "create a clone distrib: "+scatter_id)
dclone = new Clone(data, this, index, "distrib_"+ scatter_id)
dclone.augmented_distrib_clone_data(raw_data, content, distrib.axes)
// Increase data with specific content
dclone.augmented_distrib_clone_data(distrib.axes, content )
dclone.axes = distrib.axes
// console.log( dclone.axes.toString() )
// console.log( "+++++")
// console.log( this.clones[index].reads.toString(d) )
// console.log( "create a clone for index: "+ index.toString()+ " and scatter "+ scatter_id)
}
......@@ -3026,16 +3034,16 @@ changeAlleleNotation: function(alleleNotation) {
*/
resetDistribClones: function(scatter_id){
console.log( `Reset clone distrib: ${scatter_id}`)
// console.log( `Before reset clones: ${this.clones.length}`)
console.error( `Before reset clones: ${this.clones.length}`)
for (var pos = 0; pos < this.clones.length; pos++) {
var clone = this.clones[pos]
if (clone.is_distrib()){
if (scatter_id== undefined || clone.is_distrib == scatter_id){
this.clones.splice(pos, 1) // verif
if (scatter_id!= undefined && clone.scatter_id == scatter_id){
// this.clones.splice(pos, 1) // verif
}
}
}
// console.log( `After reset clones: ${this.clones.length}`)
console.error( `After reset clones: ${this.clones.length}`)
},
......
......@@ -37,7 +37,8 @@ function ScatterPlot(id, model, database, default_preset) {
View.call(this, model);
this.db = database;
this.view_type = "scatterplot"
this.id = id; //ID of the scatterPlot div
//size ( computed value -> resize() function)
......@@ -1180,7 +1181,11 @@ ScatterPlot.prototype = {
}
for (var i = 0; i < this.nodes.length; i++) {
this.updateClone(i);
try {
this.updateClone(i);
} catch(err) {
console.log("cannot update this clone from graph")
}
}
this.force.start();
this.updateElemStyle();
......@@ -1302,6 +1307,7 @@ ScatterPlot.prototype = {
* */
updateElemStyle: function() {
var self = this;
test = this.node
if (this.mode == this.MODE_BAR) {
this.updateBar();
} else {
......@@ -1347,7 +1353,7 @@ ScatterPlot.prototype = {
var elem = this.select_x;
this.changeSplitMethod(elem.value, this.splitY, this.mode);
this.cancelPreset()
this.m.change_active_distrib(elem.value, this.splitY, this.mode, this.id)
// this.m.change_active_distrib(elem.value, this.splitY, this.mode, this.id)
this.updateNodes(true)
this.m.update();
},
......@@ -1359,7 +1365,7 @@ ScatterPlot.prototype = {
var elem = this.select_y;
this.changeSplitMethod(this.splitX, elem.value, this.mode);
this.cancelPreset()
this.m.change_active_distrib(this.splitY, elem.value, this.mode, this.id)
// this.m.change_active_distrib(this.splitY, elem.value, this.mode, this.id)
this.updateNodes(true)
this.m.update();
},
......@@ -1370,6 +1376,7 @@ ScatterPlot.prototype = {
changePreset: function(){
var elem = this.select_preset;
this.changeSplitMethod(this.preset[elem.value].x, this.preset[elem.value].y, this.preset[elem.value].mode);
// this.m.change_active_distrib(this.splitY, elem.value, this.mode, this.id)
},
updatePreset: function(){
......@@ -1770,6 +1777,8 @@ ScatterPlot.prototype = {
this.m.graph.setOtherVisibility(this.otherVisibility)
}
// this.changeSplitMethod(this.preset[elem.value].x, this.preset[elem.value].y, this.preset[elem.value].mode);
this.m.change_active_distrib(splitX, splitY, mode, this.id)
},
/**
......
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