py4cytoscape.style_values.get_node_position
-
get_node_position
(node_names=None, network=None, base_url='http://127.0.0.1:1234/v1')[source] Retrieve the actual x,y position of specified nodes.
- Parameters
nodes_names (str or list or int or None) – List of nodes or None. If node list:
list
of node names or SUIDs, comma-separated string of node names or SUIDs, or scalar node name or SUID. Node names should be found in thename
column of thenode table
. If list is None, default is all nodes.network (SUID or str or None) – Name or SUID of a network. Default is the “current” network active in Cytoscape.
base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://127.0.0.1:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.
- Returns
with index as node_names values and columns x and y containing coordinates
- Return type
dataframe
- Raises
CyError – if network name or node doesn’t exist
requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error
Examples
>>> get_node_position() x y YIL052C 2628.866343678256 1180.9601936051579 YDL215C 1723.7108261001308 2230.935871095392 YLR432W 1660.9524948013027 2387.6488532731264 ... >>> get_node_position(['YDR429C', 'YMR005W', 'YDR142C']) x y YDR429C 2628.866343678256 1180.9601936051579 YMR005W 1723.7108261001308 2230.935871095392 YDR142C 1660.9524948013027 2387.6488532731264 >>> get_node_position([432646, 432647, 432644]) x y 432646 2628.866343678256 1180.9601936051579 432647 1723.7108261001308 2230.935871095392 432644 1660.9524948013027 2387.6488532731264 >>> get_node_position(node_names='YER112W', network='galFiltered.sif') x y YER112W 2151.8481399429043 2326.677814454767
Note
To identify a node whose name contains a comma, use ‘\’ to escape the comma. For example, ‘node1, node\,2’ identifies ‘node1’ and ‘node,2’.