NDEx CX API (indra.sources.ndex_cx.api)

indra.sources.ndex_cx.api.process_cx(cx_json, summary=None, require_grounding=True)[source]

Process a CX JSON object into Statements.

Parameters:
  • cx_json (list) – CX JSON object.
  • summary (Optional[dict]) – The network summary object which can be obtained via get_network_summary through the web service. THis contains metadata such as the owner and the creation time of the network.
  • require_grounding (bool) – Whether network nodes lacking grounding information should be included among the extracted Statements (default is True).
Returns:

Processor containing Statements.

Return type:

NdexCxProcessor

indra.sources.ndex_cx.api.process_cx_file(file_name, require_grounding=True)[source]

Process a CX JSON file into Statements.

Parameters:
  • file_name (str) – Path to file containing CX JSON.
  • require_grounding (bool) – Whether network nodes lacking grounding information should be included among the extracted Statements (default is True).
Returns:

Processor containing Statements.

Return type:

NdexCxProcessor

indra.sources.ndex_cx.api.process_ndex_network(network_id, username=None, password=None, require_grounding=True)[source]

Process an NDEx network into Statements.

Parameters:
  • network_id (str) – NDEx network ID.
  • username (str) – NDEx username.
  • password (str) – NDEx password.
  • require_grounding (bool) – Whether network nodes lacking grounding information should be included among the extracted Statements (default is True).
Returns:

Processor containing Statements. Returns None if there if the HTTP status code indicates an unsuccessful request.

Return type:

NdexCxProcessor

NDEx CX Processor (indra.sources.ndex_cx.processor)

class indra.sources.ndex_cx.processor.NdexCxProcessor(cx, summary=None, require_grounding=True)[source]

The NdexCxProcessor extracts INDRA Statements from Cytoscape CX JSON.

Parameters:
  • cx (list of dicts) – JSON content containing the Cytoscape network in CX format.
  • summary (Optional[dict]) – The network summary object which can be obtained via get_network_summary through the web service. THis contains metadata such as the owner and the creation time of the network.
statements

A list of extracted INDRA Statements. Not all edges in the network may be converted into Statements.

Type:list
get_agents()[source]

Get list of grounded nodes in the network as Agents.

Returns:Only nodes containing sufficient information to be grounded will be contained in this list.
Return type:list of Agents
get_node_names()[source]

Get list of all nodes in the network by name.

get_pmids()[source]

Get list of all PMIDs associated with edges in the network.

get_statements()[source]

Convert network edges into Statements.

Returns:Converted INDRA Statements.
Return type:list of Statements