Unbiased Candidate Mechanism Generation

The Unbiased Candidate Mechanism Generation workflow addresses the inconsistency in the definitions of the boundaries of pathways, mechanisms, subgraphs, etc. in networks and systems biology that are introduced during curation due to a variety of reasons.

A simple approach for generating unbiased candidate mechanisms is to take the upstream controlles

This module provides functions for generating subgraphs based around a single node, most likely a biological process.

Subgraphs induced around biological processes should prove to be subgraphs of the NeuroMMSig/canonical mechanisms and provide an even more rich mechanism inventory.

Examples

This method has been applied in the following Jupyter Notebooks:

pybel_tools.generation.remove_unweighted_leaves(graph, key=None)[source]

Remove nodes that are leaves and that don’t have a weight (or other key) attribute set.

Parameters:
  • graph (pybel.BELGraph) – A BEL graph
  • key (Optional[str]) – The key in the node data dictionary representing the experimental data. Defaults to pybel_tools.constants.WEIGHT.
pybel_tools.generation.is_unweighted_source(graph, node, key)[source]

Check if the node is both a source and also has an annotation.

Parameters:
  • graph (pybel.BELGraph) – A BEL graph
  • node (tuple) – A BEL node
  • key (str) – The key in the node data dictionary representing the experimental data
pybel_tools.generation.get_unweighted_sources(graph, key=None)[source]

Get nodes on the periphery of the subgraph that do not have a annotation for the given key.

Parameters:
  • graph (pybel.BELGraph) – A BEL graph
  • key (str) – The key in the node data dictionary representing the experimental data
Returns:

An iterator over BEL nodes that are unannotated and on the periphery of this subgraph

Return type:

iter[tuple]

pybel_tools.generation.remove_unweighted_sources(graph, key=None)[source]

Prunes unannotated nodes on the periphery of the subgraph

Parameters:
  • graph (pybel.BELGraph) – A BEL graph
  • key (Optional[str]) – The key in the node data dictionary representing the experimental data. Defaults to pybel_tools.constants.WEIGHT.
pybel_tools.generation.prune_mechanism_by_data(graph, key=None)[source]

Removes all leaves and source nodes that don’t have weights. Is a thin wrapper around remove_unweighted_leaves() and remove_unweighted_sources()

Parameters:
  • graph (pybel.BELGraph) – A BEL graph
  • key (Optional[str]) – The key in the node data dictionary representing the experimental data. Defaults to pybel_tools.constants.WEIGHT.

Equivalent to:

>>> remove_unweighted_leaves(graph)
>>> remove_unweighted_sources(graph)
pybel_tools.generation.generate_mechanism(graph, node, key=None)[source]

Generates a mechanistic subgraph upstream of the given node

Parameters:
  • graph (pybel.BELGraph) – A BEL Graph
  • node (tuple) – The target BEL node for generation
  • key (Optional[str]) – The key in the node data dictionary representing the experimental data. Defaults to pybel_tools.constants.WEIGHT.
Returns:

A subgraph grown around the target BEL node

Return type:

pybel.BELGraph

pybel_tools.generation.generate_bioprocess_mechanisms(graph, key=None)[source]

Generate a mechanistic subgraph for each biological process in the graph using generate_mechanism()

Parameters:
  • graph (pybel.BELGraph) – A BEL Graph
  • key (Optional[str]) – The key in the node data dictionary representing the experimental data. Defaults to pybel_tools.constants.WEIGHT
Returns:

A dictionary from {tuple bioprocess node: BELGraph candidate mechanism}

Return type:

dict[tuple, pybel.BELGraph]