"CXX" and "YX" represent the nodes while "p2" and "p1" are the edge
label.
As shown above, the data of network1 is:
CAA p2 CNN
CAA p2 CQQ
CAA p2 CZZ
CBB p2 CDD
CBB p2 CHH
CBB p2 CJJ
CBB p2 CQQ
CCC p2 CMM
CCC p2 CNN
CCC p2 CZZ
CDD p2 COO
CDD p2 CWW
the data of network2 is:
YA p1 YB
YA p1 YC
YA p1 YD
YB p1 YD
YB p1 YG
YB p1 YI
YC p1 YF
YC p1 YG
YD p1 YE
YD p1 YF
YE p1 YI
YG p1 YH
YI p1 YJ
YI p1 YK
YI p1 YL
Now my task is that when I click one button of my plugin,Cytoscape
shows the network1' view and network2' view in Cytoscape.
I have tried my best to achieve this functionality,but the result is
failed.
The key point of the trouble is that how to select the corresponding
nodes according to the edge
label?
Could anyone show me the example codes of how to select the
corresponding nodes according to the edge label? Many thanks.
> Now my task is that when I click one button of my plugin,Cytoscape
> shows the network1' view and network2' view in Cytoscape.
>
> I have tried my best to achieve this functionality,but the result is
> failed.
> The key point of the trouble is that how to select the corresponding
> nodes according to the edge
> label?
> Could anyone show me the example codes of how to select the
> corresponding nodes according to the edge label? Many thanks.
R: I'm not quite sure what the problem is here. By 'when I click one
button of my plugin,Cytoscape
shows the network1' view and network2' view in Cytoscape', do you
mean you want to view two networks at the same time within Cytoscape
because this can be done using View->Arrange Network Windows->Tiled.
Or, is the problem that you start with a single network containing all
your nodes and edges and you want to split this network into two
separate networks based on the edge label?
Regards
Russ
It goes something like
CyNetwork inputNet = Cytoscape.getCurrentNetwork(); //the network you
importted from .sif
CyNetwork outputNet1 = Cytoscape.createNetwork(String title1);
CyAttributes edgeAtt = Cytoscape.getEdgeAttributes();
Iterator edgeIt = inputNet.edgesIterator();
while(edgeIt.hasNext()){
CyEdge edge = edgeIt.next();
if(edgeAtt.getStringAttribute(edge.getIdentifier() ,
"interaction" ).equals("p1")){outputNet1.addEdge(edge); /** not sure
if you have to have already added the relevant nodes to outputNet1 */
}
}
Similarly for your 'p2' attribvalue
To do this non-programmatically is really easy using the cytoscape
edge filters
R
javacookie