Manage two or more net in an only session

0 views
Skip to first unread message

Franktwis

unread,
Dec 12, 2009, 6:58:59 AM12/12/09
to cytoscape-discuss
Hi all,
I write code to create two nets that I would view in an only session
on cytoscape.

CyNetwork graph1 = Cytoscape.createNetwork("graph1", false);//Il
nostro grafo
final CyNetworkView cyView;

CyNetwork graph2 = Cytoscape.createNetwork("graph2", false);//
Il nostro grafo
final CyNetworkView cyViewGraphDown;

I add nodes then open some files to find relations between them to add
some edges. During the edge creation other nodes are created. In
particular nodes from the second net were added to the first net. In
the file of connections there are names of nodes of both networks and
I believe that adding edges cytoscape not distinguish between nodes
belonging to the first and the second net.
I create nodes using:

CyNode node=Cytoscape.getCyNode(geneSets.get(index).toString(),
true);
graph1.addNode(node);

and

CyNode node=Cytoscape.getCyNode(geneSets.get(index).toString(),
true);
graph1.addNode(node);

Maybe all the nodes are manteined in the Cytoscape object for all the
nets. And when I use to create edges:

CyNode node0=Cytoscape.getCyNode("nodeY");
CyNode node1=Cytoscape.getCyNode("nodeX");
edge0 = Cytoscape.getCyEdge(node0, node1, Semantics.INTERACTION, "pp",
true,false);

it searchs for node in all the Cytoscape. So... How can I search forn
nodes only in a net?
thanks

Franktwis

unread,
Dec 14, 2009, 5:47:43 PM12/14/09
to cytoscape-discuss
Problem Solved!
when you find the node... control that it belongs to the correct net!

CyNetwork graph=....;
...

...
CyNode node1=Cytoscape.getCyNode("nodeX");
if (graph.containsNode(node1))

...do something
Reply all
Reply to author
Forward
0 new messages