py4cytoscape.groups.get_group_info
-
get_group_info
(group, network=None, base_url='http://127.0.0.1:1234/v1')[source] Retrieve information about a group by name or identifier.
- Parameters
group_name (str or SUID) – Group name or SUID.
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
- {‘group’: SUID, ‘name’: name, ‘nodes’: [node SUIDs], ‘internalEdges’: [edge SUIDs], ‘externalEdges’: [edge SUIDs], ‘collapsed’: bool}
where
SUID
identifies the node corresponding to the group,name
is the name given to the group at create time,node SUIDs
is a list of nodes in the group,edge SUIDs
is a list of edges within or reaching out of the group, andcollapsed
is True if the group is collapsed.
- Return type
dict
- Raises
CyError – if network name or SUID doesn’t exist
requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error
Examples
>>> get_group_info('group 1') {'group': 95335, 'name': 'group 1', 'nodes': [94214, 94038, 94122], 'internalEdges': [], 'externalEdges': [94450, 94564, 94403, 94362, 94506, 94537], 'collapsed': False} >>> get_group_info(95335, network='My Network') {'group': 95335, 'name': 'group 1', 'nodes': [94214, 94038, 94122], 'internalEdges': [], 'externalEdges': [94450, 94564, 94403, 94362, 94506, 94537], 'collapsed': False}