Class CytoscapeUtils


  • public class CytoscapeUtils
    extends Object
    • Constructor Detail

      • CytoscapeUtils

        public CytoscapeUtils()
    • Method Detail

      • getNodesWithValue

        public static Set<org.cytoscape.model.CyNode> getNodesWithValue​(org.cytoscape.model.CyNetwork net,
                                                                        org.cytoscape.model.CyTable table,
                                                                        String colname,
                                                                        Object value)
        From the APP Developer Cookbook: Get all the nodes with a given attribute value. This method is effectively a wrapper around CyTable.getMatchingRows(java.lang.String, java.lang.Object). It converts the table's primary keys (assuming they are node SUIDs) back to nodes in the network. Here is an example of using this method to find all nodes with a given name: CyNetwork net = ...; String nodeNameToSearchFor = ...; Set<CyNode> nodes = getNodesWithValue(net, net.getDefaultNodeTable(), "name", nodeNameToSearchFor); // nodes now contains all CyNodes with the name specified by nodeNameToSearchFor
        Parameters:
        net - The network that contains the nodes you are looking for.
        table - The node table that has the attribute value you are looking for; the primary keys of this table must be SUIDs of nodes in net.
        colname - The name of the column with the attribute value
        value - The attribute value
        Returns:
        A set of CyNodes with a matching value, or an empty set if no nodes match.