py4cytoscape.cy_ndex.import_network_from_ndex

import_network_from_ndex(ndex_id, username=None, password=None, access_key=None, ndex_url='http://ndexbio.org', ndex_version='v2', base_url='http://127.0.0.1:1234/v1')[source]

Import a network from the NDEx database into Cytoscape.

Parameters
  • ndex_id (str) – Network externalId provided by NDEx. This is not the same as a Cytoscape SUID.

  • username (str) – NDEx account username; required for private content

  • password (str) – NDEx account password; required for private content

  • access_key (str) – NDEx accessKey; alternate acccess to private content

  • ndex_url (str) – NDEX website url; Default is http://ndexbio.org

  • ndex_version (str) – NDEX version number; Default is v2

  • base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://localhost:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.

Returns

SUID of imported network

Return type

int

Raises
  • CyError – if credentials, NDEx ID or access_key are invalid

  • requests.exceptions.RequestException – if can’t connect to Cytoscape or Cytoscape returns an error

Examples

>>> import_network_from_ndex(galFiltered_uuid, 'userid', 'password')
52
>>> import_network_from_ndex(galFiltered_uuid, access_key=test_key)
52

Note

Importing a network that has recently been stored on NDEx may result in an error if NDEx has not finished indexing it. Lags can range from a few seconds to a few minutes.