Integration

This module contains functions that help add more data to the network

pybel_tools.integration.overlay_data(graph, data, label, overwrite=False)[source]

Overlays tabular data on the network

Parameters:
  • graph (pybel.BELGraph) – A BEL Graph
  • data (dict) – A dictionary of {tuple node: data for that node}
  • label (str) – The annotation label to put in the node dictionary
  • overwrite (bool) – Should old annotations be overwritten?
pybel_tools.integration.overlay_type_data(graph, data, label, func, namespace, overwrite=False, impute=None)[source]

Overlays tabular data on the network for data that comes from an data set with identifiers that lack namespaces.

For example, if you want to overlay differential gene expression data from a table, that table probably has HGNC identifiers, but no specific annotations that they are in the HGNC namespace or that the entities to which they refer are RNA.

Parameters:
  • graph (pybel.BELGraph) – A BEL Graph
  • dict data (dict[str,float]) – A dictionary of {name: data}
  • label (str) – The annotation label to put in the node dictionary
  • func (str) – The function of the keys in the data dictionary
  • namespace (str) – The namespace of the keys in the data dictionary
  • overwrite (bool) – Should old annotations be overwritten?
  • impute (Optional[float]) – The value to use for missing data