stringdb package

Submodules

stringdb.api module

api module. Functions to access the STRING API

stringdb.api.build_request_url(method, output_format='tsv')[source]

Create url to query the string database

Allows us to create stubs for querying the string api with various methods

Parameters:
  • method (str) –
    options - get_string_ids, network, interaction_partners, homology, homology_best,
    enrichment, functional_annotation, ppi_enrichment, version
  • output_format (str, optional) – options - tsv, tsv-non-header, json, xml
Returns:

request URL

Return type:

str

stringdb.api.get_enrichment(identifiers, background_string_identifiers=None, species=9606, caller_identity='https://github.com/gpp-rnd/stringdb')[source]

Get functional enrichment for a list of proteins

Parameters:
  • identifiers (list) – list of string ids
  • background_string_identifiers (list) – list of string ids to use as background
  • species (int, optional) – species NCBI identifier
  • caller_identity (str, optional) – personal identifier for string
Returns:

enriched pathways

Return type:

DataFrame

stringdb.api.get_functional_annotation(identifiers, species=9606, caller_identity='https://github.com/gpp-rnd/stringdb', allow_pubmed=0)[source]

Get all pathways for a list of string ids

Parameters:
  • identifiers (list) – list of string ids
  • species (int, optional) – species NCBI identifier
  • caller_identity (str, optional) – personal identifier for string
  • allow_pubmed (int, optional) – include pubmed articles, options - 1 or 0
Returns:

mapping between string ids and gene pathways

Return type:

DataFrame

stringdb.api.get_interaction_partners(identifiers, species=9606, required_score=400, limit=None, caller_identity='https://github.com/gpp-rnd/stringdb')[source]

Get interactions for identified proteins and all other string proteins

Parameters:
  • identifiers (list) – list of string ids
  • species (int, optional) – species NCBI identifier
  • required_score (int, optional) – score cutoff for edges, corresponds to probability of belonging to same kegg pathway
  • limit (int, optional) – limit the number of interactors returned for each protein, ranked by score
  • caller_identity (str, optional) – personal identifier for string
Returns:

Return type:

DataFrame

stringdb.api.get_network(identifiers, species=9606, required_score=400, caller_identity='https://github.com/gpp-rnd/stringdb', add_nodes=0)[source]

Get the ppi network for a list of string ids

Parameters:
  • identifiers (list) – list of string ids
  • species (int, optional) – species NCBI identifier
  • required_score (int, optional) – score cutoff for edges, corresponds to probability of belonging to same kegg pathway
  • caller_identity (str, optional) – personal identifier for string
  • add_nodes (int, optional) – number of nodes to add to the network based on confidence
Returns:

network edges

Return type:

DataFrame

stringdb.api.get_ppi_enrichment(identifiers, species=9606, required_score=400, caller_identity='https://github.com/gpp-rnd/stringdb')[source]

Calculate ppi enrichment

Parameters:
  • identifiers (list) – list of string ids
  • species (int, optional) – species NCBI identifier
  • required_score (int, optional) – score cutoff for edges, corresponds to probability of belonging to same kegg pathway
  • caller_identity (str, optional) – personal identifier for string
Returns:

one row DataFrame with ppi enrichment stats

Return type:

DataFrame

stringdb.api.get_string_ids(identifiers, species=9606, limit=1, echo_query=1, caller_identity='https://github.com/gpp-rnd/stringdb')[source]

Map gene symbols to string ids

Parameters:
  • identifiers (list) – gene symbols to map to string ids
  • species (int, optional) – species identifier
  • limit (int, optional) – limits the number of matches per query (best match comes first)
  • echo_query (int, optional) – insert column with input identifiers. Takes values 0 or 1 (boolean)
  • caller_identity (str, optional) – personal identifier for string
Returns:

mapping of string ids

Return type:

DataFrame

stringdb.api.handle_results(results)[source]

Handle results returned from string

Module contents

Top-level package for stringdb. Imports the api module