Commit 63e97333 authored by Maxime Chazalviel's avatar Maxime Chazalviel

remove duplication for each interaction

parent 7096b736
......@@ -1750,19 +1750,6 @@ metExploreD3.GraphNetwork = {
var identifier = theNodeId+"-"+reactionId;
var session = _metExploreViz.getSessionById(panel);
var networkData = session.getD3Data();
var force = session.getForce();
var metaboliteStyle = metExploreD3.getMetaboliteStyle();
var generalStyle = metExploreD3.getGeneralStyle();
/***************************/
// Var which permit to drag
/***************************/
var node_drag = d3.drag()
.on("start",_MyThisGraphNode.dragstart)
.on("drag",_MyThisGraphNode.dragmove)
.on("end", _MyThisGraphNode.dragend);
var scale = metExploreD3.getScaleById(panel);
metExploreD3.fireEventParentWebSite("sideCompound", theNode);
......@@ -1770,7 +1757,7 @@ metExploreD3.GraphNetwork = {
var newNode=networkData.addNode(
theNode.getName(),
theNode.getCompartment(),
theNode.getDbIdentifier(),
identifier,
identifier,
theNode.getReactionReversibility(),
theNode.getBiologicalType(),
......@@ -1788,9 +1775,7 @@ metExploreD3.GraphNetwork = {
theNode.getAlias(),
theNode.getLabel(),
undefined,
false);
//newNode.index = networkData.getNodes().indexOf(newNode);
theNode.isHidden());
if(theNode.getMappingDatasLength()!=0){
theNode.getMappingDatas().forEach(function(mapping){
......@@ -2422,24 +2407,16 @@ metExploreD3.GraphNetwork = {
reactionsProducingNode = [];
reactionsConsumingNode = [];
var vis = d3.select("#"+panel).select("#D3viz");
/***************************/
// Var which permit to drag
/***************************/
var node_drag = d3.drag()
.on("start",function(d){
_MyThisGraphNode.dragstart(d);
})
.on("drag",function(d){
_MyThisGraphNode.dragmove(d);
}).on("end", _MyThisGraphNode.dragend);
var scale = metExploreD3.getScaleById(panel);
//Create the list of nodes to duplicate.
//Two tables are created, one when side compounds are substrates and one when they are products
vis.selectAll("path.link.reaction")
.each(function(d) {
var source = d.source;
var target = d.target;
networkData.getLinks()
.filter(function(l){
return l.getSource().getBiologicalType()!=="pathway" && l.getTarget().getBiologicalType()!=="pathway";
})
.forEach(function(d) {
var source = d.getSource();
var target = d.getTarget();
if(source==theNode)
{
if(reactionsConsumingNode.indexOf(target)==-1)
......@@ -2505,7 +2482,6 @@ metExploreD3.GraphNetwork = {
if(panel==undefined) panel="viz";
var vis = d3.select("#"+panel).select("#D3viz");
var sideCompounds = [];
var session = _metExploreViz.getSessionById(panel);
......@@ -2516,16 +2492,14 @@ metExploreD3.GraphNetwork = {
metExploreD3.showMask(myMask);
metExploreD3.deferFunction(function() {
vis.selectAll("g.node")
netWorkData.getNodes()
.filter(function(d) {
return d.getIsSideCompound() && d.getBiologicalType()=="metabolite";
})
.filter(function(d){
if(this.getAttribute("duplicated")==undefined) return true;
else return !this.getAttribute("duplicated");
return !d.isDuplicated();
})
.each(function(node){
.forEach(function(node){
metExploreD3.GraphNetwork.duplicateSideCompound(node, panel);
sideCompounds.push(node);
});
......@@ -2865,8 +2839,6 @@ metExploreD3.GraphNetwork = {
metExploreD3.GraphFunction.removeCycleContainingNode(theNodeElement);
var session = _metExploreViz.getSessionById(panel);
var vis = d3.select("#"+panel).select("#D3viz");
if(session!=undefined)
{
// We stop the previous animation
......
......@@ -65,15 +65,15 @@ metExploreD3.GraphNode = {
});
metExploreD3.GraphNetwork.updateNetwork("viz", _metExploreViz.getSessionById("viz"));
// dupliquer les side compouunds
var sideCompounds = ["M_h", "M_h2o", "M_atp", "M_pi", "M_adp", "M_nadp", "M_ppi", "M_nad", "M_nadph", "M_nadh",
"M_co2", "M_ACP", "M_amp", "M_glyc3p", "M_PGPm1", "M_apoACP", "M_biomass", "M_malACP", "M_nh4", "M_hco3",
"M_fe3", "M_o2", "M_cu2", "M_so4", "M_fe2", "M_mg2", "M_k", "M_mn2", "M_so3", "M_PGP", "M_zn2", "M_palmACP",
"M_ca2", "M_h2o2", "M_cobalt2", "M_cl", "M_h2s", "M_pppi", "M_rnatrans", "M_proteinsynth", "M_dnarep", "M_na1",
"M_pb", "M_hg2", "M_cd2", "M_seln", "M_aso4", "M_o2s", "M_aso3"];
metExploreD3.GraphNode.loadSideCompounds(sideCompounds);
metExploreD3.GraphNetwork.duplicateSideCompounds();
// // dupliquer les side compouunds
// var sideCompounds = ["M_h", "M_h2o", "M_atp", "M_pi", "M_adp", "M_nadp", "M_ppi", "M_nad", "M_nadph", "M_nadh",
// "M_co2", "M_ACP", "M_amp", "M_glyc3p", "M_PGPm1", "M_apoACP", "M_biomass", "M_malACP", "M_nh4", "M_hco3",
// "M_fe3", "M_o2", "M_cu2", "M_so4", "M_fe2", "M_mg2", "M_k", "M_mn2", "M_so3", "M_PGP", "M_zn2", "M_palmACP",
// "M_ca2", "M_h2o2", "M_cobalt2", "M_cl", "M_h2s", "M_pppi", "M_rnatrans", "M_proteinsynth", "M_dnarep", "M_na1",
// "M_pb", "M_hg2", "M_cd2", "M_seln", "M_aso4", "M_o2s", "M_aso3"];
//
// metExploreD3.GraphNode.loadSideCompounds(sideCompounds);
// metExploreD3.GraphNetwork.duplicateSideCompounds();
},
initStrokeSeeds: function(){
......@@ -164,11 +164,11 @@ metExploreD3.GraphNode = {
}
metExploreD3.GraphNetwork.updateNetwork("viz", _metExploreViz.getSessionById("viz"));
// dupliquer les side compouunds
var sideCompounds = ["M_adp", "M_amp", "M_atp", "M_hco3", "M_co", "M_ppi", "M_fad", "M_fadh2", "M_gtp", "M_h2o2", "M_pi", "M_nad", "M_nadh", "M_nadp", "M_nadph", "M_o2", "M_h", "M_so4", "M_h2o"];
metExploreD3.GraphNode.loadSideCompounds(sideCompounds);
metExploreD3.GraphNetwork.duplicateSideCompounds();
// // dupliquer les side compouunds
// var sideCompounds = ["M_adp", "M_amp", "M_atp", "M_hco3", "M_co", "M_ppi", "M_fad", "M_fadh2", "M_gtp", "M_h2o2", "M_pi", "M_nad", "M_nadh", "M_nadp", "M_nadph", "M_o2", "M_h", "M_so4", "M_h2o"];
//
// metExploreD3.GraphNode.loadSideCompounds(sideCompounds);
// metExploreD3.GraphNetwork.duplicateSideCompounds();
},
addNbHidden : function(m, nbHidden){
......@@ -331,11 +331,11 @@ metExploreD3.GraphNode = {
}
metExploreD3.GraphNetwork.updateNetwork("viz", _metExploreViz.getSessionById("viz"));
// dupliquer les side compouunds
var sideCompounds = ["M_adp", "M_amp", "M_atp", "M_hco3", "M_co", "M_ppi", "M_fad", "M_fadh2", "M_gtp", "M_h2o2", "M_pi", "M_nad", "M_nadh", "M_nadp", "M_nadph", "M_o2", "M_h", "M_so4", "M_h2o"];
metExploreD3.GraphNode.loadSideCompounds(sideCompounds);
metExploreD3.GraphNetwork.duplicateSideCompounds();
// // dupliquer les side compouunds
// var sideCompounds = ["M_adp", "M_amp", "M_atp", "M_hco3", "M_co", "M_ppi", "M_fad", "M_fadh2", "M_gtp", "M_h2o2", "M_pi", "M_nad", "M_nadh", "M_nadp", "M_nadph", "M_o2", "M_h", "M_so4", "M_h2o"];
//
// metExploreD3.GraphNode.loadSideCompounds(sideCompounds);
// metExploreD3.GraphNetwork.duplicateSideCompounds();
},
hideNeighbours: function(node){
......
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