#pragma section-numbers on <> This guide is intended to provide code examples for using CytoscapeData to access all of your information. Any questions should be directed to cytoscape-discuss@googlegroups.com === Acessing Cytoscape Data === All attributes in Cytoscape are shared acrosss all CyNetworks. So there is only one global CytoscapeData instance for nodes and edges. These are available from the {{{cytoscape.Cytoscape}}} class. {{{#!java import cytoscape.Cytoscape; import cytoscape.data.CytoscapeData; public class MyDataClass { MyDataClass () { // get the node CytoscapeData Instance CytoscapeData node_data = Cytoscape.getNodeNetworkData(); // get the edge CytoscapeData Instance CytoscapeData edge_data = Cytoscape.getEdgeNetworkData(); } }}} (We will assume that these import statements are being used for all subsequent examples.) As discussed on the CytoscapeData description page, there are 3 ways of adding data. All are compatible, but based on how your data is structured, one might present itself as being more suitable. === Single Value Access === If you only have a single value for an attribute, i.e. the name of a node, the single access methods will work fine. {{{#!java // add a value to a node GraphObject object; // this can be a Node or Edge. String attribute_name = "test_attribute"; // an attribute name Object value = new Double( 5 ); // a Double of value "5" // get the node CytoscapeData Instance CytoscapeData data = Cytoscape.getNodeNetworkData(); // add the value data.setAttributeValue( object.getIdentifier(), attribute_name, value ); }}}