Package org.cytoscape.command
Interface StringToModel
public interface StringToModel
The service implementing StringToModel provides a common mechanism for converting
command arguments into Cytoscape model elements. For example, the command:
nodes select network=current nodelist="name:gene1,name:gene2"could be handled as follows:
@Tunable(description="Network to select", context="nongui") String network; @Tunable(description="List of nodes to select", context="nongui") String nodelist; public run(TaskMonitor mon) { CyNetwork net = stringToModel.getNetwork(network); List<CyNode> nodeList = stringToModel.getNodeList(net, nodelist); // Actually select the nodes... }
Module: command-executor-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>command-executor-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
Group termsstatic String
static String
static String
static String
static String
static String
static String
static String
static String
-
Method Summary
Modifier and TypeMethodDescriptiongetEdgeList(CyNetwork net, String edgelist)
Convert a string request for a edgelist into a list ofCyEdge
s.getNetwork(String strNet)
Convert a string request for a network into aCyNetwork
.getNetworkView(String strNetView)
Convert a string request for a network view into aCyNetworkView
.getNodeList(CyNetwork net, String nodelist)
Convert a string request for a nodelist into a list ofCyNode
s.getRowList(CyTable table, String rowlist)
Convert a string request for a rowlist into a list ofCyRow
s.Convert a string request for a table into aCyTable
.
-
Field Details
-
_CY_NETWORK_DESC
- See Also:
- Constant Field Values
-
_CY_NETWORK_VIEW_DESC
- See Also:
- Constant Field Values
-
_CY_LIST_DESC
- See Also:
- Constant Field Values
-
_CY_ROW_DESC
- See Also:
- Constant Field Values
-
CY_NETWORK_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
CY_NETWORK_EXAMPLE_STRING
- See Also:
- Constant Field Values
-
CY_NETWORK_VIEW_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
CY_NETWORK_VIEW_EXAMPLE_STRING
- See Also:
- Constant Field Values
-
TABLE_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
ROW_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
COLUMN_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
VALUE_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
ROW_EXAMPLE
- See Also:
- Constant Field Values
-
COLUMN_EXAMPLE
- See Also:
- Constant Field Values
-
VALUE_EXAMPLE
- See Also:
- Constant Field Values
-
TABLE_TITLE_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
TABLE_TITLE_EXAMPLE
- See Also:
- Constant Field Values
-
KEY_TYPE_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
KEY_TYPE_EXAMPLE
- See Also:
- Constant Field Values
-
CY_NODE_LIST_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
CY_NODE_LIST_EXAMPLE_STRING
- See Also:
- Constant Field Values
-
CY_EDGE_LIST_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
CY_EDGE_LIST_EXAMPLE_STRING
- See Also:
- Constant Field Values
-
CY_ROW_LIST_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
GROUP_NAME_LONG_DESCRIPTION
Group terms- See Also:
- Constant Field Values
-
GROUP_NAME_EXAMPLE_STRING
- See Also:
- Constant Field Values
-
GROUP_NAME_EXAMPLE_STRING2
- See Also:
- Constant Field Values
-
GROUP_LIST_LONG_DESCRIPTION
- See Also:
- Constant Field Values
-
GROUP_LIST_EXAMPLE_STRING
- See Also:
- Constant Field Values
-
-
Method Details
-
getNetwork
Convert a string request for a network into aCyNetwork
. This method may be used to find a network with a given name or the current network. Future implementations might accept other columns to search on.- Parameters:
strNet
- the name of the network to return or "current"- Returns:
- the returned CyNetwork or null if the name doesn't exist
-
getNetworkView
Convert a string request for a network view into aCyNetworkView
. This method may be used to find a network view with a given name or the current network view. Future implementations might accept other columns to search on.- Parameters:
strNetView
- the name of the network view to return or "current"- Returns:
- the returned CyNetworkView or null if the name doesn't exist
-
getTable
Convert a string request for a table into aCyTable
. This method may be used to find a table with a given name or the current table. Future implementations might accept other columns to search on.- Parameters:
strTable
- the name of the table to return or "current"- Returns:
- the returned CyTable or null if the name doesn't exist
-
getNodeList
Convert a string request for a nodelist into a list ofCyNode
s. This method may be used to find selected nodes, or nodes matching a particular column by using the pattern "column:value". If no column is specified, it is assumed that the column is the NAME column. No wildcarding or regular expression matching is supported at this time. The following special keywords are also recognized: all return all nodes in this network selected return all selected nodes in this network unselected return all unselected nodes in this network- Parameters:
net
- the CyNetwork to search through. If null, use the current networknodelist
- the string representing the nodelist- Returns:
- a list of CyNodes or null if nothing matched
-
getEdgeList
Convert a string request for a edgelist into a list ofCyEdge
s. This method may be used to find selected edges, or edges matching a particular column by using the pattern "column:value". If no column is specified, it is assumed that the column is the NAME column. No wildcarding or regular expression matching is supported at this time. The following special keywords are also recognized: all return all edges in this network selected return all selected edges in this network unselected return all unselected edges in this network- Parameters:
net
- the CyNetwork to search through. If null, use the current networkedgelist
- the string representing the edgelist- Returns:
- a list of CyEdges or null if nothing matched
-
getRowList
Convert a string request for a rowlist into a list ofCyRow
s. This method may be used to find all rows, or rows matching a particular column by using the pattern "column:value". If no column is specified, it is assumed that the column is the NAME column. No wildcarding or regular expression matching is supported at this time. The following special keywords are also recognized: all return all edges in this network- Parameters:
table
- the CyTable to search through.rowlist
- the string representing the rowlist- Returns:
- a list of CyRows or null if nothing matched
-