STRING

class openomics.database.interaction.STRING(path='https://stringdb-static.org/download/', file_resources=None, species_id='9606', source_col_name='item_id_a', target_col_name='item_id_b', source_index='protein_name', target_index='protein_name', edge_attr=['score'], directed=False, relabel_nodes=None, verbose=False)[source][source]

Bases: openomics.database.interaction.Interactions, openomics.database.sequence.SequenceDatabase

Attributes Summary

Methods Summary

get_sequences([index, omic, agg_sequences])

Returns a dictionary where keys are ‘index’ and values are sequence(s).

load_network(file_resources, …)

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

Attributes Documentation

COLUMNS_RENAME_DICT = {'preferred_name': 'protein_name', 'protein_external_id': 'protein_id'}[source]

Methods Documentation

get_sequences(index='protein_name', omic=None, agg_sequences=None)[source][source]

Returns a dictionary where keys are ‘index’ and values are sequence(s).

Parameters
  • index (str) – {“gene_id”, “gene_name”, “transcript_id”, “transcript_name”}

  • omic (str) – {“lncRNA”, “microRNA”, “messengerRNA”}

  • agg_sequences (str) – {“all”, “shortest”, “longest”}

  • **kwargs – any additional argument to pass to SequenceDataset.get_sequences()

load_network(file_resources, source_col_name, target_col_name, edge_attr, directed, filters)[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

Returns

a NetworkX Graph or DiGraph

Return type

network