Interactions#

class openomics.database.interaction.Interactions(path, file_resources, source_col_name=None, target_col_name=None, edge_attr=None, filters=None, directed=True, relabel_nodes=None, blocksize=None, **kwargs)[source][source]#

Bases: openomics.database.base.Database

Methods Summary

get_interactions([nodelist, data, ...])

param nodelist

A list of nodes to fetch edges from

load_network(file_resources, ...[, blocksize])

Handles data processing from file_resources to a Pandas DataFrame which contain edgelist data, then constructs and return a NetworkX Graph.

name()

Methods Documentation

get_interactions(nodelist=None, data=False, inclusive=True, relabel_nodes=None)[source][source]#
Parameters
  • nodelist (list) – A list of nodes to fetch edges from

  • data (bool) – default False Whether to include edge attributes

  • inclusive (bool) – default False Whether to only retrieve edges from nodes inclusive in nodelist.

Returns

a NetworkX edgelist

Return type

edges (OutEdgeView)

abstract load_network(file_resources, source_col_name, target_col_name, edge_attr, directed, filters, blocksize=None)[source][source]#

Handles data processing from file_resources to a Pandas DataFrame which contain edgelist data, then constructs and return a NetworkX Graph. :param file_resources: a dict of file name and file path/object :param source_col_name: column name of the dataframe for source in the edge :type source_col_name: str :param target_col_name: column name of the dataframe for target in the edge :type target_col_name: str :param edge_attr: list of str for column data to include in each edge :type edge_attr: list :param directed: True to return a DiGraph(), else Graph() :type directed: bool :param filters: A dict of {column name: column values} to filter the dataframe :param blocksize ():

Returns

a NetworkX Graph or DiGraph

Return type

network

Return type

Graph

classmethod name()[source][source]#