Commit ea250407 authored by flothoni's avatar flothoni

tt

parent 0826b274
......@@ -333,6 +333,7 @@ Builder.prototype = {
var li = document.createElement('li');
li.appendChild(div)
var listTag = document.getElementById("tagList")
listTag.appendChild(li);
},
......@@ -357,8 +358,9 @@ Builder.prototype = {
// listGermline.appendChild(li);
},
/*complete displaySelector menu with correct info about current tagname / top
* */
/**
* complete displaySelector menu with correct info about current tagname / top
**/
build_displaySelector: function () {
var self = this;
......@@ -367,7 +369,9 @@ Builder.prototype = {
// var listGermline = document.getElementById("germline_list")
//reset
listTag.removeAllChildren();
if (listTag != null){
listTag.removeAllChildren();
}
// listGermline.removeAllChildren();
//init tag list
......
This diff is collapsed.
This diff is collapsed.
......@@ -260,7 +260,7 @@ Model_loader.prototype = {
var index = 0
for (var i = 0; i < data.clones.length; i++) {
if (data.clones[i].top <= limit) {
var clone = new Clone(data.clones[i], self, index)
var clone = new Clone(data.clones[i], self, index, "real")
self.mapID[data.clones[i].id] = index;
index++
}
......@@ -348,12 +348,13 @@ Model_loader.prototype = {
"reads": [],
"germline" : this.system_available[q],
};
new Clone(other, self, index, true);
new Clone(other, self, index, "virtual");
index++ ;
}
//remove incomplete similarity matrix (TODO: fix fuse.py)
this.similarity = undefined;
this.distributions = data.distributions
// this.init_distributions()
return this
......@@ -366,6 +367,7 @@ Model_loader.prototype = {
},
init_distributions: function(){
// Que faire dans cette fonction ?
// Il faut à priori prendre chaque clones et soustraire ses valeurs aux distributions concernés;
......
......@@ -41,31 +41,31 @@ function ScatterPlot(id, model, database, default_preset) {
this.id = id; //ID of the scatterPlot div
//size ( computed value -> resize() function)
this.resizeCoef = 1; //Multiplifying factor, application to nodes radius
this.resizeMinSize = 0.001; // Any clone with a non-null size is displayed as clones of this size
this.resizeW = 1; //scatterplot width
this.resizeH = 1; //scatterplot height
this.gridSizeW = 1; //grid width
this.gridSizeH = 1; //grid height
this.resizeCoef = 1; //Multiplifying factor, application to nodes radius
this.resizeMinSize = 0.001; // Any clone with a non-null size is displayed as clones of this size
this.resizeW = 1; //scatterplot width
this.resizeH = 1; //scatterplot height
this.gridSizeW = 1; //grid width
this.gridSizeH = 1; //grid height
//Margins (css style : top/right/bottom/left)
this.default_margin = [45,10,15,90];
this.graph_margin = [25,25,25,25];
this.margin = this.default_margin;
this.graph_margin = [25,25,25,25];
this.margin = this.default_margin;
this.max_precision = 9; //Precision max (default: 9)
this.max_precision = 9; //Precision max (default: 9)
/* EDIT DISTANCE ONLY
BEG --
*/
this.mouseZoom = 1; //Zoom (scroll wheel)
this['continue'] = false; //Boolean used for the nodes movements
this.allEdges = []; //Initial edges array
this.edgeSaved = []; //Edges array saved for the Edit Distance visualization
this.edge = []; //Edges array given to the engine
this.edgeContainer = null; //SVG element to save the container of graph distribution
this.active_move = false; //Boolean given to the nodes movements
this.reloadCharge = true; //Boolean allowing to reload the physic engine charge (reject)
this.mouseZoom = 1; //Zoom (scroll wheel)
this['continue'] = false; //Boolean used for the nodes movements
this.allEdges = []; //Initial edges array
this.edgeSaved = []; //Edges array saved for the Edit Distance visualization
this.edge = []; //Edges array given to the engine
this.edgeContainer = null; //SVG element to save the container of graph distribution
this.active_move = false; //Boolean given to the nodes movements
this.reloadCharge = true; //Boolean allowing to reload the physic engine charge (reject)
this.canSavePositions = true; //Boolean which allows to save initial positions of nodes
//Object which allows to save new position, and move all nodes according to the object's parameters
this.positionToMove = {
......@@ -309,7 +309,8 @@ ScatterPlot.prototype = {
.append("svg:circle"); //Ajout d'un élément SVG (cercle) à un node
this.node.exit()
.remove() //On efface tous les cercles non pris en compte
// this.updateNodes()
//Action concernant tous les nodes présents dans le ScatterPlot
this.plot_container.selectAll("circle")
.attr("stroke", "")
......@@ -343,6 +344,49 @@ ScatterPlot.prototype = {
},
updateNodes: function(bar){
//Initialisation of nodes
// console.error("previous")
// console.log( this.m.clones.length)
// console.log(this.nodes.length)
this.nodes = d3.range(this.m.clones.length)
.map(Object);
for (var i = 0; i < this.m.clones.length; i++) {
this.nodes[i].id = i; //L'id d'un cercle vaut le nombre de i dans la boucle
this.nodes[i].r1 = 0; // longueur du rayon1
this.nodes[i].r2 = 0; // longueur du rayon2
this.nodes[i].x = Math.random() * 500;
this.nodes[i].old_x = [0, 0, 0, 0, 0]
this.nodes[i].y = Math.random() * 250;
this.nodes[i].old_y = [0, 0, 0, 0, 0]
}
//Initialisation of the D3JS physic engine
this.force = d3.layout.force();
this.initMotor();
this.force
.nodes(this.nodes) //Nodes array initialisation
.on("tick", function(){self.tick()}); // on -> Listen updates compared to modified positions
//Création d'un element SVG pour chaque nodes (this.node.[...])
this.node = this.plot_container.selectAll("circle")
.data(this.nodes) //Ajout de données pour les cercles
this.node.enter()
.append("svg:circle"); //Ajout d'un élément SVG (cercle) à un node
this.node.exit()
.remove() //On efface tous les cercles non pris en compte
// console.log(this.nodes.length)
// this.updateClones()
if (bar){ this.initBar() }
},
/**
* Function which allows to return the number of active clones
* @return {integer}
......@@ -621,10 +665,18 @@ ScatterPlot.prototype = {
},
includeBar: function(clone) {
return ((!this.use_system_grid ||
(this.use_system_grid && this.m.germlineV.system == clone.get('germline') )) &&
clone.isActive() &&
!clone.isVirtual());
var system_grid = (!this.use_system_grid || (this.use_system_grid && this.m.germlineV.system == clone.get('germline') ))
var showVirtual;
// Set if the clone should be show on is virtual/distrib status
if (clone.isVirtual() ){
showVirtual = ( (this.m.distrib_inclusion) && clone.is_distrib() )
} else {
showVirtual = true
}
var include = (system_grid && (clone.isActive() || clone.is_distrib()) && showVirtual)
return include
},
/**
......@@ -655,7 +707,7 @@ ScatterPlot.prototype = {
var tab_length = Object.keys(this.axisX.value_mapping).length;
var width = Math.min(0.08, 0.8 / tab_length);
this.updateNodes(false)
//reset (TODO improve default position )
for (var n in this.nodes) {
this.nodes[n].bar_y = 0.5;
......@@ -1295,7 +1347,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.scatter_id)
this.m.change_active_distrib(elem.value, this.splitY, this.mode, this.id)
this.updateNodes(true)
this.m.update();
},
......@@ -1307,7 +1359,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.scatter_id)
this.m.change_active_distrib(this.splitY, elem.value, this.mode, this.id)
this.updateNodes(true)
this.m.update();
},
......
......@@ -1511,6 +1511,8 @@ Sequence.prototype = Object.create(genSeq.prototype);
var stop = -1;
var clone = this.m.clone(this.id);
if (!clone.sequence) return
if (clone.hasSeg('cdr3')){
if (typeof clone.seg.cdr3.start != "undefined") {
start = this.pos[clone.seg.cdr3.start];
......
......@@ -715,7 +715,6 @@ function openAndFillNewTab (content){
}
/**
* Function that allow to make comparison between two arrays.
*/
......
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