Package 'STRINGdb'

Title: STRINGdb - Protein-Protein Interaction Networks and Functional Enrichment Analysis
Description: The STRINGdb package provides an R interface to STRING, a protein-protein interaction database and functional enrichment analysis tool (https://string-db.org).
Authors: Andrea Franceschini <[email protected]>
Maintainer: Damian Szklarczyk <[email protected]>
License: GPL-2
Version: 2.27.0
Built: 2026-11-27 20:18:18 UTC
Source: https://github.com/bioc/STRINGdb

Help Index


add_diff_exp_color

Description

Take in input a dataframe containing a logFC column that reports the logarithm of the difference in expression level. Add a "color" column to the data frame such that strongly downregulated genes are colored in green and strong upregulated genes are in red. When the down or up-regulation is instead weak the intensity of the color gets weaker as well, accordingly.

Usage

## S4 method for signature 'STRINGdb'
add_diff_exp_color(screen, logFcColStr="logFC" )

Arguments

screen

Dataframe containing the results of the experiment (e.g. the analyzed results of a microarray or RNAseq experiment)

logFcColStr

name of the colum that contains the logFC of the expression

Value

The data frame with an added color column: red for up-regulated genes and green for down-regulated genes, paler for weaker changes. The rows with a positive logFC come first, then the others; rows without a logFC are left out.

Author(s)

Andrea Franceschini


add_proteins_description

Description

Add description coluns to the proteins that are present in the data frame given in input. The data frame must contain a column named "STRING_id".

Usage

## S4 method for signature 'STRINGdb'
add_proteins_description(screen)

Arguments

screen

Dataframe containing the results of the experiment (e.g. the analyzed results of a microarray or RNAseq experiment)

Value

returns the same dataframe given in input with an additional columns containing a description of the proteins.

Author(s)

Andrea Franceschini


coeffOfvar

Description

coefficient of variation

Usage

coeffOfvar(x)

Arguments

x

input number

Details

coefficient of variation

Value

coefficient of variation

Author(s)

Andrea Franceschini


delColDf

Description

delete a column in the data frame

Usage

delColDf(df, colName)

Arguments

df

data frame

colName

name of the column to be deleted

Value

data frame

Author(s)

Andrea Franceschini


example of microarray data (data processed from GEO GSE9008)

Description

example of microarray data (data processed from GEO GSE9008)

Usage

data(diff_exp_example1)

Format

Data frames with 20861 observations on the following 3 variables.

gene

a character vector

pvalue

a numeric vector

logFC

a numeric vector

Source

Whyte L, Huang YY, Torres K, Mehta RG. Molecular mechanisms of resveratrol action in lung cancer cells using dual protein and microarray analyses. Cancer Res 2007.


downloadAbsentFile

Description

download a file only if it is not present.

Usage

downloadAbsentFile(urlStr, oD = tempdir())

Arguments

urlStr

url from which to download the file

oD

directory where to store the file

Details

The file is saved in oD under the last part of urlStr. It is downloaded only when that file is absent or empty; otherwise the file in oD is used. The download is saved under a temporary name in oD and gets the file's name only when it has finished. A download that fails or is cut off part-way (for example by a timeout) stops with the error of download.file and leaves no file, so the next call downloads the whole file again. While it downloads, R's option timeout, which limits the whole transfer (60 seconds unless set), is raised to at least 300 seconds, as the help of download.file recommends for large files. A higher value is kept, and the option is restored afterwards. A download from STRING's servers adds the parameter caller_identity=STRINGdb-package to the address (the file keeps its name), and is made in binary mode.

Value

The path of the file, or NULL when the download gave no file (an error text is then printed).

Author(s)

Andrea Franceschini


downloadAbsentFileSTRING

Description

download a STRING file only if it is not present or if it is corrupted. It no longer works: the server it asks for the expected file size (string.uzh.ch) no longer exists. Use downloadAbsentFile instead.

Usage

downloadAbsentFileSTRING(urlStr, oD = tempdir())

Arguments

urlStr

url from which to download the file

oD

directory where to store the file

Author(s)

Andrea Franceschini


get_aliases

Description

Loads and returns STRING aliases. Depending on takeFirst, this returns either all alias mappings or a single preferred mapping for ambiguous aliases.

Usage

## S4 method for signature 'STRINGdb'
get_aliases(takeFirst=TRUE, usePreferredSources=TRUE)

Arguments

takeFirst

boolean indicating whether ambiguous aliases should be collapsed to a single STRING identifier. If FALSE, all alias mappings are returned. If TRUE, one mapping is returned for each ambiguous alias.

usePreferredSources

boolean indicating whether preferred alias sources should be used to disambiguate aliases when takeFirst=TRUE. This parameter is ignored when takeFirst=FALSE.

Value

a data frame containing STRING aliases. With takeFirst=FALSE, all alias mappings are returned. With takeFirst=TRUE, ambiguous aliases are collapsed to one STRING identifier.

Author(s)

Andrea Franceschini


get_annotations

Description

Returns the functional annotation of the given proteins: every term (for example from the Gene Ontology, UniProt keywords, Pfam and InterPro domains, or Reactome pathways) that is assigned to at least one of them. Unlike get_enrichment, it does not test which terms are enriched. PubMed publications are not included.

Usage

## S4 method for signature 'STRINGdb'
get_annotations(string_ids = NULL)

Arguments

string_ids

a vector of STRING identifiers (at most 2000).

Value

A data frame with one row per term, with columns category, term_id, number_of_genes (the number of input proteins with the term), ratio_in_set (their share of the input), species, string_ids and preferred_names (those proteins, comma-separated), and description.

Author(s)

Andrea Franceschini


get_api_key

Description

Returns the STRING API key of this computer. The values/ranks methods use this key. STRING gives the key without registration.

Usage

## S4 method for signature 'STRINGdb'
get_api_key()

Details

The key is taken from, in this order:

  1. the environment variable STRINGDB_API_KEY, if it is set;

  2. the key saved in tools::R_user_dir("STRINGdb", which = "config"), readable only by you;

  3. a new key, which the package requests from STRING and saves.

The values/ranks methods find the key in the same way. You need get_api_key only to see the key.

To use the key on other computers, e.g. a cluster, set STRINGDB_API_KEY there. To read the jobs of another key, set it in the R session: Sys.setenv(STRINGDB_API_KEY = "..."). Keep the key private: anyone with it can list your jobs and read their results.

A key requested by the package works at once. Other new keys can take up to 15 minutes to be activated.

Value

The API key (invisibly). A message shows the key and where it comes from.

Author(s)

Damian Szklarczyk

See Also

get_values_ranks_enrichment, submit_values_ranks_enrichment

Examples

if (interactive()) {
  string_db <- STRINGdb$new(version = "12.5", species = 9606)
  # the key of this computer (requested and saved the first time)
  string_db$get_api_key()
}

get_bioc_graph

Description

Returns the interaction graph as an object of the graph package in Bioconductor. For network_type="regulatory", the returned graphNEL object preserves edge direction.

Usage

## S4 method for signature 'STRINGdb'
get_bioc_graph()

Value

interaction graph as an object of the graph package in Bioconductor.

Author(s)

Andrea Franceschini


get_clusters

Description

Returns a list of clusters of interacting proteins. Clustering is not available for the directed network_type="regulatory" network. See the igraph documentation (https://igraph.org) for additional information on the algorithms.

Usage

## S4 method for signature 'STRINGdb'
get_clusters(string_ids, algorithm="fastgreedy")

Arguments

string_ids

a vector of STRING identifiers.

algorithm

algorithm to use for the clustering: "fastgreedy" (default), "walktrap" or "edge.betweenness". Any other value stops with an error.

Value

list of clusters of interacting proteins.

Author(s)

Andrea Franceschini


get_enrichment

Description

Returns the enrichment in pathways of the vector of STRING proteins that is given in input.

Usage

## S4 method for signature 'STRINGdb'
get_enrichment(string_ids, category = "All", methodMT = NULL, iea = NULL, minScore = NULL, max_fdr = NULL, min_gene_count = NULL, min_strength = NULL, min_signal = NULL, merge_similarity = NULL, add_scores = FALSE)

Arguments

string_ids

a vector of STRING identifiers.

category

category for which to return the enrichment (i.e. "Process", "Component", "Function", "KEGG", "Pfam", "InterPro"). The default "All" returns all categories.

methodMT

deprecated: only the FDR correction is available. A value is ignored, with a warning.

iea

deprecated: a value is ignored, with a warning.

minScore

deprecated: a value is ignored, with a warning.

max_fdr

optional filter: the highest FDR of a term, above 0 and at most 1.

min_gene_count

optional filter: the lowest number of input proteins annotated with a term, a whole number of at least 1.

min_strength

optional filter: the lowest strength of a term, log10(observed / expected).

min_signal

optional filter: the lowest signal of a term, STRING's balance of strength and FDR.

merge_similarity

optional: merges the terms whose protein sets overlap at least this much (above 0, at most 1; 1 merges identical sets only) into the most significant of them.

add_scores

TRUE adds STRING's strength and signal columns to the returned table, before p_value. The default FALSE returns the table without them.

Details

STRING applies the optional filters like the filters of the enrichment table on its website. Without them (the default NULL), no term is filtered.

By default the returned table has no strength and signal columns. With add_scores=TRUE, STRING inserts them before p_value, so that the columns are category, term, number_of_genes, number_of_genes_in_background, ncbiTaxonId, inputGenes, preferredNames, strength, signal, p_value, fdr and description. The strength of a term is log10(observed / expected); its signal is STRING's balance of strength and FDR.

The filters and add_scores need STRING version 12.5 or later. An older version, such as version="12.0", would ignore them, so they are not used there, with a warning.

Value

Data frame containing the enrichment in pathways of the vector of STRING proteins that is given in input. Its columns inputGenes and preferredNames list the term's proteins as comma-separated text.

Author(s)

Andrea Franceschini


get_enrichment_figure

Description

Returns a STRING enrichment figure for the given identifiers and enrichment category.

Usage

## S4 method for signature 'STRINGdb'
get_enrichment_figure(string_ids, category = "Process", file = NULL, output_format = "image", group_by_similarity = NULL, color_palette = "mint_blue", number_of_term_shown = NULL, x_axis = "signal", caller_identity = NULL, graph_type = "dotplot", sort_by = NULL, max_fdr = NULL, min_gene_count = NULL, min_strength = NULL, min_signal = NULL, merge_similarity = NULL)

Arguments

string_ids

a vector of STRING identifiers.

category

enrichment category to visualize. Supported categories are "Process", "Function", "Component", "Keyword", "KEGG", "RCTM", "HPO", "MPO", "DPO", "WPO", "ZPO", "FYPO", "GWAS", "Hallmark", "Pfam", "SMART", "InterPro", "PMID", "NetworkNeighborAL", "COMPARTMENTS", "TISSUES", "DISEASES", and "WikiPathways". "GWAS" and "Hallmark" need STRING version 12.5 or later.

file

file where to save the image output.

output_format

STRING image output format: "image", "highres_image" or "svg".

group_by_similarity

threshold for visually grouping related terms on the plot, from 0.1 to 1.

color_palette

color palette used to represent FDR values. Supported values are "mint_blue", "lime_emerald", "green_blue", "peach_purple", "straw_navy", "yellow_pink", and "red_blue". "red_blue" needs STRING version 12.5 or later.

number_of_term_shown

maximum number of terms displayed on the plot. STRING shows at most 100.

x_axis

variable used on the x-axis and, without sort_by, for ranking the terms: "signal", "strength", "FDR", "gene_count", or "count", which STRING treats as "gene_count". "count" needs STRING version 12.5 or later.

caller_identity

ignored, with a warning; it will stop with an error in the next Bioconductor release, so do not specify it.

graph_type

the kind of plot: "dotplot" (default) or "barplot".

sort_by

variable that decides which terms are shown and in which order: "signal", "strength", "FDR", "gene_count", or "count" (as "gene_count"). The default NULL uses the x_axis variable.

max_fdr

optional filter: the highest FDR of a term, above 0 and at most 1.

min_gene_count

optional filter: the lowest number of input proteins annotated with a term, a whole number of at least 1.

min_strength

optional filter: the lowest strength of a term, log10(observed / expected).

min_signal

optional filter: the lowest signal of a term, STRING's balance of strength and FDR.

merge_similarity

optional: merges the terms whose protein sets overlap at least this much (above 0, at most 1; 1 merges identical sets only) into the most significant of them. Unlike group_by_similarity, which only groups related terms on the plot, merged terms are not shown.

Details

STRING applies the optional filters like the filters of the enrichment table on its website; without them (the default NULL), no term is filtered. When STRING refuses the request, the method stops with STRING's explanation. STRING does not refuse an unknown category, color_palette, x_axis or sort_by, but silently uses its default instead, so the method stops with an error, before any request, for a value that is not listed here.

graph_type, sort_by and the filters need STRING version 12.5 or later. An older version, such as version="12.0", would ignore them, so they are not used there, with a warning.

The values new in STRING 12.5, category="GWAS" or "Hallmark", color_palette="red_blue" and x_axis="count", also need STRING version 12.5 or later. An older version would silently draw its default figure for them instead, so with an older version the method stops with an error, before any request.

Value

For output_format="image" and output_format="highres_image", returns a PNG image array. For output_format="svg", returns the SVG markup as text.

Author(s)

Damian Szklarczyk


get_geneset_description

Description

Returns concise primary, secondary, and tertiary descriptions of a protein set using the STRING gene-set description API.

Usage

## S4 method for signature 'STRINGdb'
get_geneset_description(string_ids, caller_identity=NULL)

Arguments

string_ids

a vector of STRING identifiers.

caller_identity

ignored, with a warning; it will stop with an error in the next Bioconductor release, so do not specify it.

Value

A one-row data frame containing primary, secondary, and tertiary descriptions when they are available.

Author(s)

Damian Szklarczyk


get_graph

Description

Return an igraph object with the STRING network (for information about iGraph visit http://igraph.sourceforge.net). For network_type="regulatory", the graph is directed from regulator to target.

Usage

## S4 method for signature 'STRINGdb'
get_graph()

Value

igraph object with the STRING network

Author(s)

Andrea Franceschini

References

Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.sf.net

See Also

In order to simplify the most common tasks, we do also provide convenient functions that wrap some iGraph functions. get_interactions(string_ids) # returns the interactions in between the input proteins get_neighbors(string_ids) # Get the neighborhoods of a protein (or of a vector of proteins) that is given in input. get_subnetwork(string_ids) # returns a subgraph from the given input proteins


get_homologs_besthits

Description

Returns the list of closest homologs (as measured by bitscore) of the given input identifiers in all STRING species, or in the species given by target_species_id.

Usage

## S4 method for signature 'STRINGdb'
get_homologs_besthits(string_ids, target_species_id=NULL)

Arguments

string_ids

a vector of STRING identifiers.

target_species_id

NCBI taxonomy identifiers of one or several species to query for homologs, e.g. c(10090, 7227) (the species must be present in the STRING database). By default, all species.

Value

Data frame containing the best blast hits x species of the given input identifiers.

Author(s)

Andrea Franceschini


get_interaction_partners

Description

Returns the interaction partners of the input proteins using the locally loaded STRING graph. The returned data frame preserves the edge attributes available for the current link_data setting. For a regulatory network, from and to preserve the regulator-to-target direction.

Usage

## S4 method for signature 'STRINGdb'
get_interaction_partners(string_ids, required_score=NULL, limit=NULL)

Arguments

string_ids

a vector of STRING identifiers

required_score

optional minimum combined score for returned partners. This value cannot be below the score_threshold used to load the local graph.

limit

optional maximum number of partner rows returned per query protein

Value

Data frame containing one row per query-partner interaction. The leading columns are from, to, combined_score, from_name and to_name, followed by any additional edge attributes loaded for the current link_data mode. For functional and physical networks, from is the queried protein and to is its interaction partner. For regulatory networks, they are the original regulator and target. If limit is used, rows are ordered by combined_score.

Author(s)

Damian Szklarczyk


get_interactions

Description

Shows the interactions in between the proteins that are given in input. For a regulatory network, from is the regulator and to is the regulated protein.

Usage

## S4 method for signature 'STRINGdb'
get_interactions(string_ids)

Arguments

string_ids

a vector of STRING identifiers

Value

Data frame containing the interactions in between the input proteins. The leading columns are from, to, combined_score, from_name and to_name, followed by any additional loaded edge attributes.

Author(s)

Damian Szklarczyk


get_neighbors

Description

Get the neighborhoods of a protein (or of a vector of proteins) that is given in input.

Usage

## S4 method for signature 'STRINGdb'
get_neighbors(string_ids, mode="all")

Arguments

string_ids

a vector of STRING identifiers

mode

direction to traverse in a regulatory network: "all" (default), "out" for regulated proteins, or "in" for regulators.

Value

vector containing the neighborhoods of a protein (or of a vector of proteins) that is given in input.

Author(s)

Andrea Franceschini


get_paralogs

Description

Returns the sequence similarity (Smith-Waterman bitscore) between the given proteins, including each protein with itself. It compares only the given proteins: it does not search their proteome for paralogs. A single protein therefore returns only its similarity with itself.

Usage

## S4 method for signature 'STRINGdb'
get_paralogs(string_ids)

Arguments

string_ids

a vector of STRING identifiers.

Value

Data frame with one row for each protein with itself and two rows (A-B and B-A) for each pair of similar input proteins, with columns ncbiTaxonId_A, stringId_A, ncbiTaxonId_B, stringId_B, and bitscore. STRING reports no similarity with a bitscore below 50.

Author(s)

Andrea Franceschini


get_png

Description

Returns a STRING network image for the given identifiers or for a STRING functional term.

Usage

## S4 method for signature 'STRINGdb'
get_png(string_ids=NULL, required_score=NULL, network_flavor="evidence", file=NULL, payload_id=NULL, output_format="image", network_term_id=NULL, hide_node_labels=NULL, hide_disconnected_nodes=NULL, block_structure_pics_in_bubbles=NULL, flat_node_design=TRUE, center_node_labels=NULL, custom_label_font_size=NULL, caller_identity=NULL, typed_physical_edges=NULL, typed_regulatory_edges=NULL, show_regulatory_signs=NULL, network_clustering_algorithm=NULL, network_clustering_parameter=NULL, cluster_aware_layout=NULL, network_clustering_edge_visibility=NULL, show_cluster_names=NULL, cluster_name_size=NULL, add_color_nodes=NULL, add_white_nodes=NULL, channels=NULL)

Arguments

string_ids

a vector of STRING identifiers. Can be omitted when network_term_id is provided.

required_score

minimum STRING combined score of the interactions (if left NULL we get the combined score of the object, which is 400 by default).

network_flavor

specify the flavor of the network: "evidence", "confidence", or "typed". The typed view is available only when network_type="full" (or its "functional" alias). "actions" is accepted as a compatibility alias for "typed".

file

file where to save the image output.

payload_id

identifier of the payload.

output_format

STRING image output format: "image", "highres_image" or "svg".

network_term_id

functional term identifier used by STRING instead of explicit protein identifiers.

hide_node_labels

hides all protein names from the picture. Accepts TRUE/FALSE or 0/1.

hide_disconnected_nodes

hides proteins that are not connected to any other protein in the network. Accepts TRUE/FALSE or 0/1.

block_structure_pics_in_bubbles

disables structure pictures inside the bubbles. Accepts TRUE/FALSE or 0/1.

flat_node_design

disables 3D bubble design. Accepts TRUE/FALSE or 0/1. Default is TRUE.

center_node_labels

centers protein names on nodes. Accepts TRUE/FALSE or 0/1.

custom_label_font_size

changes the font size of the protein names (from 5 to 50).

caller_identity

ignored, with a warning; it will stop with an error in the next Bioconductor release, so do not specify it.

typed_physical_edges

include physical edges in the typed network view. Available only with network_flavor="typed". Accepts TRUE/FALSE or 0/1.

typed_regulatory_edges

include regulatory edges in the typed network view. Available only with network_flavor="typed". Accepts TRUE/FALSE or 0/1.

show_regulatory_signs

show positive/negative regulatory signs in the typed network view. Requires typed_regulatory_edges=TRUE. Accepts TRUE/FALSE or 0/1.

network_clustering_algorithm

clusters the network and colours the proteins by cluster, as the Clusters tab of the STRING website: "kmeans", "mcl" or "leiden" (in any case). The default NULL draws the network without clusters; the other clustering options need an algorithm.

network_clustering_parameter

the parameter of the clustering algorithm: for k-means the number of clusters (a whole number of at least 1, default 3), for MCL the inflation (from 1.1 to 10, default 3), and for Leiden the resolution (from 0.1 to 10, default 1).

cluster_aware_layout

lays the network out by its clusters. Accepts TRUE/FALSE or 0/1.

network_clustering_edge_visibility

how the edges between clusters are drawn: "faded" (STRING's default), "dotted", "solid" or "noshow".

show_cluster_names

writes the names of the clusters on the picture. Accepts TRUE/FALSE or 0/1; by default the names are not shown.

cluster_name_size

the size of the cluster names: 1, 1.5, 2, 2.5, 3, 3.5, 4, 5 or 6. By default STRING chooses the size that suits the picture.

add_color_nodes

adds this many interaction partners of the given proteins to the network, drawn in colour. A whole number of at least 0; the default NULL adds none.

add_white_nodes

adds this many further interaction partners to the network, drawn white, after the coloured ones. A whole number of at least 0. The default NULL leaves it to STRING, which adds none, or 10 white partners when a single protein is given. Giving add_color_nodes turns off those 10 white partners unless add_white_nodes is given too; add_white_nodes sets their number. Neither add_color_nodes nor add_white_nodes is used with network_term_id: STRING then adds no interaction partners.

channels

the evidence channels used for the interactions: a character vector of one or more of "neighborhood", "fusion", "cooccurrence", "coexpression", "experiments", "databases" and "textmining" (in any case), or the column names of the interaction tables with link_data = "detailed": "cooccurence", "experimental" and "database". The default NULL uses all channels. STRING recomputes the combined score of each interaction from the selected channels, and required_score applies to the recomputed score.

Details

A network of more than 1,000 proteins is drawn simplified, as on the STRING website: with confidence edges (whatever network_flavor says) and without structure pictures in the nodes.

STRING draws a PNG (output_format="image" or "highres_image") of at most 150,000 interactions. For a larger network, and for any other request that STRING refuses, the method stops with STRING's explanation; for the PNG, ask for the SVG (output_format="svg") or use a higher required_score.

The clustering options need STRING version 12.5 or later. An older version, such as version="12.0", would ignore them, so they are not used there, with a warning.

The channels option needs STRING version 12.0 or later. Older versions (11.5, 11.0b and 11.0) would ignore it, so it is not used there, with a warning, and the picture uses all channels.

Value

For output_format="image" and output_format="highres_image", returns a PNG image array. For output_format="svg", returns the SVG markup as text.

Author(s)

Damian Szklarczyk


get_ppi_enrichment

Description

Tests whether the given proteins have more interactions among themselves than expected by chance. Returns the p-value, with the observed and the expected numbers of interactions. The calculation uses the object's selected functional, physical, or regulatory network type.

Usage

## S4 method for signature 'STRINGdb'
get_ppi_enrichment(string_ids)

Arguments

string_ids

a vector of STRING identifiers

Value

A list with three elements: enrichment, the p-value of the enrichment in interactions (the probability to obtain at least as many interactions by chance); edges, the number of interactions among the proteins; and lambda, the expected number of interactions.

Author(s)

Andrea Franceschini


get_proteins

Description

Returns the STRING proteins data frame. (it downloads and caches the information the first time that is called).

Usage

## S4 method for signature 'STRINGdb'
get_proteins()

Value

STRING proteins data frame.

Author(s)

Andrea Franceschini


get_subnetwork

Description

Returns the subgraph generated by the given input proteins. For a regulatory network, regulator-to-target edge directions are preserved.

Usage

## S4 method for signature 'STRINGdb'
get_subnetwork(string_ids )

Arguments

string_ids

a vector of STRING identifiers

Value

Returns the subgraph (i.e. an iGraph object) generated by the given input proteins.

Author(s)

Andrea Franceschini


get_summary

Description

Returns a summary of the STRING sub-network containing the identifiers provided in input. The summary and its interaction-enrichment p-value use the object's selected network type.

Usage

## S4 method for signature 'STRINGdb'
get_summary(string_ids, required_score=NULL)

Arguments

string_ids

a vector of STRING identifiers

required_score

minimum STRING combined score of the interactions (default NULL: the score_threshold of the object)

Value

Returns a summary (i.e. a text description) of the STRING sub-network containing the identifiers provided in input.

Author(s)

Andrea Franceschini


get_term_proteins

Description

Deprecated since 2020: this method returns no proteins, only a deprecation warning. To get the terms of given proteins, use get_annotations.

Usage

## S4 method for signature 'STRINGdb'
get_term_proteins(term_ids, string_ids=NULL, enableIEA=TRUE)

Arguments

term_ids

vector of terms (not used).

string_ids

a vector of STRING identifiers (not used).

enableIEA

not used.

Value

The deprecation message, invisibly.

Author(s)

Andrea Franceschini


get_values_ranks_enrichment

Description

A GSEA-like enrichment analysis of a ranked list of proteins. It is STRING's "Proteins with Values/Ranks" analysis, computed on STRING's servers, not locally. Give all the proteins measured in the experiment, with their values, without a cutoff: the submitted list is the background of the test.

STRING tests larger terms, and terms with a clear signal, with a Kolmogorov-Smirnov (KS) test. It tests the other terms with the more sensitive, but slower, aggregate fold change (AFC) test. The method reports terms enriched at the top or at the bottom of the list. It also reports terms enriched at both ends: terms whose proteins are partly up- and partly down-regulated.

The method waits until STRING has finished. Then it returns the results as a data frame. A table of values, with one column per experiment, returns a list of data frames. For many experiments, e.g. tens or hundreds of columns, do not block the R session: submit them with submit_values_ranks_enrichment, and get the results later with get_values_ranks_results.

Usage

## S4 method for signature 'STRINGdb'
get_values_ranks_enrichment(string_ids, values, max_fdr=0.05, rank_direction="descending", timeout=7200, quiet=FALSE)

Arguments

string_ids

STRING identifiers, one per value, e.g. the STRING_id column of map.

values

the values to rank, for all the proteins measured. Give signed values, such as log fold changes, t statistics or sign(logFC) * -log10(pvalue); not p-values, which lose the direction. A numeric vector, or a matrix or data frame with one column per experiment. The values can also be given alone, without string_ids: a vector named by STRING identifiers, or a table with them as row names. Then give the other arguments by name.

max_fdr

the FDR cutoff of the reported terms. Default 0.05, at most 0.25.

rank_direction

"descending" (default) or "ascending". With "descending", rank 1 and the "top" are the largest values. It only names the ends of the list; the enrichment is the same.

timeout

the time each job may take on STRING, in seconds, from its submission. Default 7200. The time an experiment waits to be submitted does not count.

quiet

TRUE to print no progress messages. The messages name each experiment: its column of the table, or, for a vector, the values as you gave them (e.g. mapped$logFC).

Details

The FDR is the Benjamini-Hochberg FDR within each category. STRING's statistics differ from those of fgsea or clusterProfiler, so their scores and FDRs cannot be compared.

string_ids and values are paired by position. Rows without an identifier or a value are left out. Infinite values are left out with a warning. A repeated identifier keeps its value farthest from 0.

The method needs STRING version 12.0 or later. It uses the API key of this computer (see get_api_key). set_background does not apply: the submitted proteins are the background.

With a table, STRING runs up to 1000 jobs per API key at once. The others are submitted as jobs finish. An experiment that STRING cannot take within the timeout is not submitted. A job that fails does not stop the others. If the wait ends early (timeout, interrupt or lost connection), the jobs keep running on STRING. Get their results later with get_values_ranks_results. For a vector of values, a timeout is an error, and its message gives the job identifier. For a table, the experiments that did not finish have the status "unfinished".

Value

A data frame with one row per enriched term. The rows are ordered by category, then by FDR, as in get_enrichment. Its columns are those of get_enrichment where they mean the same:

category

the category of the term, with the codes of get_enrichment, e.g. "Process" or "RCTM"

term

the identifier of the term

number_of_genes

the number of the term's proteins in the input

number_of_genes_in_background

the number of the term's proteins in the genome, for information only: the test uses only the input

inputGenes, preferredNames

the STRING identifiers and the names of all the term's proteins in the input, wherever they rank: this is not a leading edge. Comma-separated; a comma inside a name is &comma;.

enrichment_score

how far the mean value of the term's proteins lies from the mean of all values, relative to the most extreme value, times 10: from 0 (the mean) to 10 (the most extreme value). Real scores are usually far below 10. The score has no sign (see direction), and it is not GSEA's ES or NES.

direction

"top", "bottom" or "both ends"

method

the test: "ks" or "afc"

fdr

the false discovery rate

description

the description of the term

inputValues, inputRanks

list columns with the values of the term's proteins and their ranks in the whole list, in the order of inputGenes. Paste them into text before write.csv, e.g. result$inputValues <- vapply(result$inputValues, paste, "", collapse = ","), and the same for inputRanks.

The attributes job_id, page_url, graph_url, download_url and string_version give the job and its pages on the STRING website.

For a table of values: a list of such data frames, named by experiment. Its attribute status gives the state of each experiment: "success", "failed", "unfinished" or "not submitted". An experiment without success has NULL, and a warning says why. The attribute job_ids gives the jobs. The attribute not_submitted gives the columns of the experiments that were not submitted.

Author(s)

Damian Szklarczyk

References

The values/ranks enrichment: Szklarczyk D, et al. (2019). STRING v11: protein-protein association networks with increased coverage, supporting functional discovery in genome-wide experimental datasets. Nucleic Acids Res 47(D1):D607-D613.

GSEA, which this analysis resembles: Subramanian A, et al. (2005). Gene set enrichment analysis: a knowledge-based approach for interpreting genome-wide expression profiles. Proc Natl Acad Sci USA 102(43):15545-15550.

See Also

submit_values_ranks_enrichment, get_values_ranks_status, get_values_ranks_results, get_api_key, get_enrichment, map

Examples

if (interactive()) {
  string_db <- STRINGdb$new(version = "12.5", species = 9606)
  data(diff_exp_example1)
  mapped <- string_db$map(diff_exp_example1, "gene", removeUnmappedRows = TRUE)

  # one experiment: the values named by STRING identifiers, as for fgsea or clusterProfiler
  ranked <- setNames(mapped$logFC, mapped$STRING_id)
  result <- string_db$get_values_ranks_enrichment(ranked, max_fdr = 0.01)
  # the strongest terms first: the rows are ordered by category, then by FDR
  top_terms <- result[order(result$fdr), ]
  print(head(top_terms[, c("category", "description", "direction", "enrichment_score", "fdr")]))

  # several experiments at once: one column each, run side by side on STRING's servers
  rankings <- data.frame(logFC = mapped$logFC,
                         signed_p = sign(mapped$logFC) * -log10(mapped$pvalue))
  results <- string_db$get_values_ranks_enrichment(mapped$STRING_id, rankings, max_fdr = 0.01)
  print(attr(results, "status"))
  sapply(results[attr(results, "status") == "success"], nrow)
}

get_values_ranks_results

Description

Returns the results of values/ranks jobs. It waits for the jobs that have not finished. Use it after submit_values_ranks_enrichment, or to get results in a new R session.

Usage

## S4 method for signature 'STRINGdb'
get_values_ranks_results(job_ids, timeout=7200, quiet=FALSE)

Arguments

job_ids

job identifiers, e.g. from submit_values_ranks_enrichment. STRING keeps each job for the API key that submitted it (see get_api_key).

timeout

the time to wait for each job, in seconds. Default 7200.

quiet

TRUE to print no progress messages.

Details

STRING keeps the results of a job for a limited time. After that, submit the job again.

In another R session, give the job identifiers that submit_values_ranks_enrichment returned, e.g. readRDS("jobs.rds"): their names give the experiments, and the results are named by them.

Value

The results have the same form as from get_values_ranks_enrichment:

  • One job identifier without a name (from a vector of values) gives a data frame. A failed job or the timeout is an error.

  • Job identifiers named by experiment (from a table) give a list of data frames, with the attributes status ("success", "failed" or "unfinished") and job_ids. A job without success has NULL, and a warning says why.

Author(s)

Damian Szklarczyk

See Also

submit_values_ranks_enrichment, get_values_ranks_status, get_values_ranks_enrichment

Examples

if (interactive()) {
  string_db <- STRINGdb$new(version = "12.5", species = 9606)
  data(diff_exp_example1)
  mapped <- string_db$map(diff_exp_example1, "gene", removeUnmappedRows = TRUE)
  job_id <- string_db$submit_values_ranks_enrichment(setNames(mapped$logFC, mapped$STRING_id))

  # waits for the job if it has not finished yet
  result <- string_db$get_values_ranks_results(job_id)
  head(result[, c("category", "description", "direction", "fdr")])
}

get_values_ranks_status

Description

Returns the state of values/ranks jobs, with one request to STRING. It does not wait for the jobs.

Usage

## S4 method for signature 'STRINGdb'
get_values_ranks_status(job_ids=NULL)

Arguments

job_ids

job identifiers, e.g. from submit_values_ranks_enrichment. The default, NULL, lists all jobs of the API key, oldest first. STRING keeps each job for the API key that submitted it (see get_api_key).

Value

A data frame with one row per job and these columns:

experiment

the name of the job identifier

job_id

the job identifier

status

"submitted", "running", "success" or "failed"; "unknown" if this API key does not have the job

message

STRING's message

creation_time

when the job was submitted

Author(s)

Damian Szklarczyk

See Also

submit_values_ranks_enrichment, get_values_ranks_results

Examples

if (interactive()) {
  string_db <- STRINGdb$new(version = "12.5", species = 9606)
  data(diff_exp_example1)
  mapped <- string_db$map(diff_exp_example1, "gene", removeUnmappedRows = TRUE)
  job_id <- string_db$submit_values_ranks_enrichment(setNames(mapped$logFC, mapped$STRING_id))
  string_db$get_values_ranks_status(job_id)
}

example of a protein-protein interactions sorted data frame

Description

example of a sorted list of protein-protein interactions, resulta our cooccurrence algorithm (SVD_Phy)

Usage

data(interactions_example)

Format

A data frame with 70000 observations on the following 3 variables.

proteinA

a character vector

proteinB

a character vector

score

a numeric vector


load

Description

Downloads and returns the STRING network (the network is set also in the graph variable of the STRING_db object). When possible, the download uses the threshold-specific streamed network file matching the current score_threshold. For network_type="regulatory", the returned igraph object is directed: an edge from protein1 to protein2 represents regulation of the latter by the former.

It makes use of the variables: "backgroundV" vector containing STRING identifiers to be used as background (i.e. the STRING network loaded will contain only the proteins that are present also in this vector) "score_threshold" STRING combined score threshold (the network loaded contains only interactions having a combined score at or above this threshold)

Usage

## S4 method for signature 'STRINGdb'
load()

Value

STRING network (i.e. an iGraph object. For info look to http://igraph.sourceforge.net)

Author(s)

Andrea Franceschini and Damian Szklarczyk


load_all

Description

Force download and loading of all the files (so that you can later store the object on the hard disk if you like). It makes use of the variables: "backgroundV" vector containing STRING identifiers to be used as background (i.e. the STRING network loaded will contain only the proteins that are present also in this vector) "score_threshold" STRING combined score threshold (the network loaded contains only interactions having a combined score at or above this threshold)

Usage

## S4 method for signature 'STRINGdb'
load_all()

Author(s)

Andrea Franceschini


map

Description

Maps the gene identifiers of the input dataframe to STRING identifiers. It returns the input dataframe with the "STRING_id" additional column.

Usage

## S4 method for signature 'STRINGdb'
map(my_data_frame, my_data_frame_id_col_names, takeFirst=TRUE, removeUnmappedRows=FALSE, quiet=FALSE, usePreferredSources=TRUE)

Arguments

my_data_frame

data frame provided as input.

my_data_frame_id_col_names

vector contatining the names of the columns of "my_data_frame" that have to be used for the mapping.

takeFirst

boolean indicating what to do in case of multiple STRING proteins that map to the same name. If TRUE, only the first of those is taken. Otherwise all of them are used. (default TRUE)

removeUnmappedRows

remove the rows that cannot be mapped to STRING (by default those lines are left and their STRING_id is set to NA).

quiet

Setting this variable to TRUE we can avoid printing the warning relative to the unmapped values.

usePreferredSources

when takeFirst=TRUE, prioritize aliases using the preferred source order.

Value

Returns the dataframe that is given in input with the "STRING_id" additional column. The first column of my_data_frame_id_col_names comes first, followed by the other columns of the input and by "STRING_id". The identifiers are compared without regard to case. An NA or empty identifier is never mapped (its STRING_id is NA). The rows keep the order of the input, also when several identifier columns are used, and each row keeps its own identifiers as given; with takeFirst=FALSE, a row whose identifier matches several STRING proteins is repeated, once for each of them.

Author(s)

Andrea Franceschini


mp

Description

Maps the gene identifiers of the input vector to STRING identifiers (using a take first approach). It returns a vector with the STRING identifiers of the mapped proteins.

Usage

## S4 method for signature 'STRINGdb'
mp(protein_aliases)

Arguments

protein_aliases

vector of protein aliases that we want to convert to STRING identifiers

Value

It returns a vector with the STRING identifiers of the mapped proteins.

Author(s)

Andrea Franceschini


multi_map_df

Description

mapping function (it add the possibility to map using more than one column of the data frame)

Usage

multi_map_df(dfToMap, dfMap, strColsFrom, strColFromDfMap, strColToDfMap, caseSensitive=FALSE)

Arguments

dfToMap

input data frame (that contains the columns that need to be mapped)

dfMap

data frame containing the mapping data

strColsFrom

sorted vector containing the names of the columns to be used in the input data frame for the mapping (the order of the elements in the vector defines the priority for the mapping)

strColFromDfMap

name of the column in the mapping data frame to be used as source for the mapping

strColToDfMap

name of the column in the mapping data frame to be used as target for the mapping

caseSensitive

specify whether the mapping should be case sensitive

Value

data frame with an additional column containing the result of the mapping. The first column of strColsFrom comes first, followed by the other columns of dfToMap and by the result column. An NA or empty identifier is never mapped. The rows keep the order of dfToMap, also when several columns are used, and each row keeps its own identifiers as given; a row whose identifier maps to several targets is repeated, once for each of them.

Author(s)

Andrea Franceschini


plot_network

Description

Plots an image of the STRING network with the given proteins.

Usage

## S4 method for signature 'STRINGdb'
plot_network(string_ids, payload_id=NULL, required_score=NULL, add_link=FALSE, network_flavor="evidence", add_summary=TRUE, typed_physical_edges=NULL, typed_regulatory_edges=NULL, show_regulatory_signs=NULL, add_color_nodes=NULL, add_white_nodes=NULL, channels=NULL)

Arguments

string_ids

a vector of STRING identifiers

payload_id

an identifier of payload data on the STRING server (see method post_payload for additional informations)

required_score

a threshold on the score that overrides the default score_threshold, that we use only for the picture

add_link

parameter to specify whether you want to generate and add a short link to the relative page in STRING. The default is FALSE; disabling this option avoids generating and storing many short URLs when plotting in a loop.

network_flavor

style of network edges: "evidence", "confidence", or "typed". The typed view is available only with network_type="full" (or "functional"). "actions" is accepted as a compatibility alias for "typed".

add_summary

parameter to specify whether you want to add a summary text to the picture. This summary includes a p-value and the number of proteins/interactions.

typed_physical_edges

include physical edges in the typed network view. Available only with network_flavor="typed". Accepts TRUE/FALSE or 0/1.

typed_regulatory_edges

include regulatory edges in the typed network view. Available only with network_flavor="typed". Accepts TRUE/FALSE or 0/1.

show_regulatory_signs

show positive/negative regulatory signs in the typed network view. Requires typed_regulatory_edges=TRUE. Accepts TRUE/FALSE or 0/1.

add_color_nodes

adds this many interaction partners of the given proteins to the network, drawn in colour. A whole number of at least 0; the default NULL adds none.

add_white_nodes

adds this many further interaction partners to the network, drawn white, after the coloured ones. A whole number of at least 0. The default NULL leaves it to STRING, which adds none, or 10 white partners when a single protein is given. Giving add_color_nodes turns off those 10 white partners unless add_white_nodes is given too; add_white_nodes sets their number.

channels

the evidence channels used for the interactions: a character vector of one or more of "neighborhood", "fusion", "cooccurrence", "coexpression", "experiments", "databases" and "textmining" (in any case), or the column names of the interaction tables with link_data = "detailed": "cooccurence", "experimental" and "database". The default NULL uses all channels. STRING recomputes the combined score of each interaction from the selected channels, and required_score applies to the recomputed score. Needs STRING version 12.0 or later; with an older version it is not used, with a warning.

Details

A network of more than 1,000 proteins is drawn simplified, as on the STRING website: with confidence edges (whatever network_flavor says) and without structure pictures in the nodes.

The picture is a PNG, which STRING draws for at most 150,000 interactions. For a larger network the method stops with STRING's explanation: use a higher required_score, or get_png with output_format="svg".

add_color_nodes, add_white_nodes and channels are passed on to get_png, and to get_link for add_link=TRUE. With add_color_nodes=NULL the link adds no interaction partners, while the picture of a single protein shows STRING's 10 white partners; give add_color_nodes (and add_white_nodes) to get the same network in the picture and on the linked page. The summary text (add_summary) is computed with all channels, whatever channels says, and for the given proteins only, without the interaction partners that add_color_nodes and add_white_nodes add.

Author(s)

Andrea Franceschini


post_payload

Description

Posts the input to STRING and returns an identifier that you can use to access the payload when you enter in our website.

Usage

## S4 method for signature 'STRINGdb'
post_payload(stringIds, colors=NULL, comments=NULL, links=NULL, iframe_urls=NULL, logo_imgF=NULL, legend_imgF=NULL )

Arguments

stringIds

vector of STRING identifiers.

colors

vector containing the colors to use for a every STRING identifier ( the order of the elements must match those in the string_ids vector)

comments

vector containing the comments to use for every STRING identifier ( the order of the elements must match those in the string_ids vector)

links

vector containing the links to use for every STRING identifier ( the order of the elements must match those in the string_ids vector)

iframe_urls

vector containing the urls of the iframes to use for every STRING identifier ( the order of the elements must match those in the string_ids vector).

logo_imgF

path to a file containing the logo image to be display in the STRING website

legend_imgF

path to a file containing a legend image to be display in the STRING website

Value

identifier of the payload.

Author(s)

Andrea Franceschini


remove_homologous_interactions

Description

With this method it is possible to remove the interactions that are composed by a pair of homologous/similar proteins, having a similarity bitscore between each other at or above a threshold.

Usage

## S4 method for signature 'STRINGdb'
remove_homologous_interactions(interactions_dataframe, bitscore_threshold = 60)

Arguments

interactions_dataframe

a data frame contaning the sorted interactions to be benchmarked. The data frame should have the following column names: proteinA, proteinB, score

bitscore_threshold

filter out pairs of homologous proteins, having a similarity bitscore at or above this parameter

Value

interactions data frame where the homologous pairs have been removed, from the input interactions' data frame

Author(s)

Andrea Franceschini


renameColDf

Description

Rename a column of a data frame

Usage

renameColDf(df, colOldName, colNewName)

Arguments

df

input data frame

colOldName

column name to be changed

colNewName

new column name

Value

data frame with the column name changed

Author(s)

Andrea Franceschini


set_background

Description

With this method you can specify a vector of proteins to be used as background. The network is reloaded and only the proteins that are present in the background vector are inserted in the graph. Besides, the background is taken in consideration for all the enrichment statistics. If you already created a STRINGdb object, calling set_background is sufficient and you do not need to instantiate a new object again.

Usage

## S4 method for signature 'STRINGdb'
set_background(background_vector )

Arguments

background_vector

vector of STRING protein identifiers

Author(s)

Andrea Franceschini


Class "STRINGdb"

Description

The R package STRINGdb provides a convenient interface to STRING, a protein-protein interaction database and functional enrichment analysis tool, for R/Bioconductor users. Please look at the manual/vignette for additional information and examples on how to use the package. STRING is a database of known and predicted protein-protein interactions. It contains information from numerous sources, including experimental repositories, computational prediction methods, and public text collections. Each interaction is associated with a combined confidence score that integrates the different evidence channels. STRING v12.5 contains information on 59.3 million proteins from 12,535 organisms and more than 28 billion interactions. It provides functional, physical, and directed regulatory networks. The STRING web interface is freely accessible at: https://string-db.org/

Extends

All reference classes extend and inherit methods from "envRefClass".

Fields

The settings are given to STRINGdb$new(), e.g. STRINGdb$new(version = "12.5", species = 9606, score_threshold = 400):

species:

The NCBI taxonomy identifier of the organism, e.g. 9606 for human or 10090 for mouse. Without it, 9606 is used and a warning is printed.

version:

The STRING version, e.g. "12.5"; a version without a dot gets ".0" ("11" means "11.0"). For the versions known to the package (11.0, 11.0b, 11.5, 12.0 and 12.5) the object is created without a request to STRING, so it can also be created offline. Without a version, STRING is asked for its current version; when STRING cannot be reached within a few seconds, the newest known version is used and a warning is printed. Any other version is looked up on STRING, and creating the object stops with an error when that version is not available or STRING cannot be reached.

score_threshold:

The minimum combined score of the interactions in the local network (default 400). Scores are on a scale from 0 to 1000: STRING's website shows 400 as 0.4. A value below 1 is set to 1.

network_type:

One of "full" (the functional network, the default), "physical", or "regulatory". The regulatory network requires STRING v12.5 or later.

link_data:

One of "combined_only" (the default: only the combined score), "detailed" (also the scores of the evidence channels), or "full" (also the transferred scores).

input_directory:

The folder where the downloaded STRING files are kept and reused. By default, or with "", a temporary folder that is deleted when the R session ends.

backgroundV:

The background: a vector of STRING identifiers, set with set_background.

protocol:

"https" (the default) or "http", for the download files only. Calls to STRING's API always use https.

The other fields hold the data that the methods download and load: proteins, graph, homology_graph and the aliases_ tables. stable_url and file_version follow from the version. annotations, annotations_description and pathways_benchmark_blackList are no longer used.

Methods

Most methods have their own help page, e.g. ?get_interactions. The methods that have been deprecated since 2020 do nothing and are not listed, and the ignored caller_identity argument is left out of the calls.

map(my_data_frame, my_data_frame_id_col_names, takeFirst, removeUnmappedRows, quiet, usePreferredSources):

adds a column of STRING identifiers to a data frame of gene or protein names (map).

mp(protein_aliases):

maps a vector of gene or protein names to STRING identifiers (mp).

get_aliases(takeFirst, usePreferredSources):

the names (aliases) of the species' STRING proteins (get_aliases).

get_proteins():

the species' STRING proteins, with their preferred names, sizes and descriptions (get_proteins).

add_proteins_description(screen):

adds the proteins' preferred names and descriptions to a data frame (add_proteins_description).

get_interactions(string_ids):

the interactions among the given proteins, as a data frame (get_interactions).

get_interaction_partners(string_ids, required_score, limit):

the interaction partners of the given proteins (get_interaction_partners).

get_neighbors(string_ids, mode="all"):

the neighbours of the given proteins in the network (get_neighbors).

get_subnetwork(string_ids):

the network among the given proteins, as an igraph object (get_subnetwork).

get_graph():

the whole network of the species, as an igraph object (get_graph).

get_bioc_graph():

the whole network as a graphNEL object of the graph package (get_bioc_graph).

load():

downloads and loads the network of the species into the object.

load_all():

downloads and loads the proteins, their names and the network, e.g. before saving the object (load_all).

set_background(background_vector):

sets the background for the enrichment and the network (set_background).

get_clusters(string_ids, algorithm):

clusters of the network of the given proteins (get_clusters).

plot_network(string_ids, payload_id, required_score, add_link, network_flavor, add_summary, typed_physical_edges, typed_regulatory_edges, show_regulatory_signs, add_color_nodes, add_white_nodes, channels):

draws STRING's picture of the network of the given proteins (plot_network).

get_png(string_ids, required_score, network_flavor, file, payload_id, output_format, network_term_id, hide_node_labels, hide_disconnected_nodes, block_structure_pics_in_bubbles, flat_node_design=TRUE, center_node_labels, custom_label_font_size, typed_physical_edges, typed_regulatory_edges, show_regulatory_signs, network_clustering_algorithm, network_clustering_parameter, cluster_aware_layout, network_clustering_edge_visibility, show_cluster_names, cluster_name_size, add_color_nodes, add_white_nodes, channels):

STRING's picture of the network, as an image or SVG text, optionally saved to a file (get_png).

get_link(string_ids, required_score, network_flavor, payload_id, network_term_id, hide_node_labels, hide_disconnected_nodes, block_structure_pics_in_bubbles, flat_node_design=TRUE, center_node_labels, custom_label_font_size, typed_physical_edges, typed_regulatory_edges, show_regulatory_signs, add_color_nodes, add_white_nodes, channels):

a link to the network on STRING's website (get_link).

post_payload(stringIds, colors, comments, links, iframe_urls, logo_imgF, legend_imgF):

uploads colours and other data to show on STRING's pictures and pages, and returns a payload identifier (post_payload).

add_diff_exp_color(screen, logFcColStr):

adds a colour column for the fold changes of a data frame, for post_payload (add_diff_exp_color).

get_summary(string_ids, required_score):

a text summary of the network of the given proteins (get_summary).

get_ppi_enrichment(string_ids):

tests whether the given proteins have more interactions among themselves than expected (get_ppi_enrichment).

ppi_enrichment(string_ids, required_score):

as get_ppi_enrichment, with a minimum score for the interactions.

get_enrichment(string_ids, category, methodMT, iea, minScore, max_fdr, min_gene_count, min_strength, min_signal, merge_similarity, add_scores=FALSE):

the functional enrichment of the given proteins (get_enrichment).

get_enrichment_figure(string_ids, category="Process", file, output_format="image", group_by_similarity, color_palette="mint_blue", number_of_term_shown, x_axis="signal", graph_type="dotplot", sort_by, max_fdr, min_gene_count, min_strength, min_signal, merge_similarity):

STRING's figure of the enrichment of the given proteins (get_enrichment_figure).

get_annotations(string_ids):

all the terms annotated to the given proteins (get_annotations).

get_geneset_description(string_ids):

short descriptions of the protein set, based on its enrichment (get_geneset_description).

get_values_ranks_enrichment(string_ids, values, max_fdr=0.05, rank_direction="descending", timeout=7200, quiet=FALSE):

a GSEA-like enrichment analysis of a whole ranked experiment, computed on STRING's servers (not locally): STRING's values/ranks enrichment, run on STRING's job queue; with a table of values, one job for each experiment, run side by side (get_values_ranks_enrichment).

submit_values_ranks_enrichment(string_ids, values, max_fdr=0.05, rank_direction="descending", quiet=FALSE):

submits the values/ranks enrichment (GSEA-like, computed on STRING's servers) and returns the job identifiers at once, without blocking the R session (submit_values_ranks_enrichment).

get_values_ranks_status(job_ids=NULL):

the state of values/ranks jobs, from one request (get_values_ranks_status).

get_values_ranks_results(job_ids, timeout=7200, quiet=FALSE):

the results of values/ranks jobs (GSEA-like, computed on STRING's servers), waiting for the unfinished ones (get_values_ranks_results).

get_api_key():

the STRING API key of this computer for the values/ranks enrichment, GSEA-like and computed on STRING's servers (get_api_key).

get_homologs_besthits(string_ids, target_species_id):

the closest homologs of the given proteins in other species (get_homologs_besthits).

get_paralogs(string_ids):

the sequence similarity between the given proteins (get_paralogs).

get_homology_graph(min_homology_bitscore = 60):

the pairs of similar proteins of the species (bitscore at or above the threshold), as an igraph object; used by remove_homologous_interactions.

remove_homologous_interactions(interactions_dataframe, bitscore_threshold):

removes the interactions between similar proteins (remove_homologous_interactions).

show():

prints the object.

initialize(...):

creates the object; called by STRINGdb$new().

Author(s)

Andrea Franceschini and Damian Szklarczyk

References

Szklarczyk D, Nastou K, Koutrouli M, Kirsch R, Mehryary F, Hachilif R, Hu D, Peluso ME, Huang Q, Fang T, Doncheva NT, Pyysalo S, Bork P, Jensen LJ, von Mering C. The STRING database in 2025: protein networks with directionality of regulation. Nucleic Acids Res. 2025 Jan 6;53(D1):D730-D737. doi: 10.1093/nar/gkae1113.

Examples

showClass("STRINGdb")

submit_values_ranks_enrichment

Description

Submits STRING's values/ranks enrichment, the GSEA-like analysis of get_values_ranks_enrichment, and returns at once. The R session is not blocked while STRING computes. This suits many experiments, e.g. tens or hundreds of columns. See the progress with get_values_ranks_status. Get the results later with get_values_ranks_results, also in a new R session.

Usage

## S4 method for signature 'STRINGdb'
submit_values_ranks_enrichment(string_ids, values, max_fdr=0.05, rank_direction="descending", quiet=FALSE)

Arguments

string_ids

STRING identifiers, one per value. See get_values_ranks_enrichment.

values

the values to rank: a vector, or a table with one column per experiment. See get_values_ranks_enrichment.

max_fdr

the FDR cutoff of the reported terms. Default 0.05, at most 0.25.

rank_direction

"descending" (default) or "ascending". See get_values_ranks_enrichment.

quiet

TRUE to print no progress messages.

Details

Each experiment becomes a job. STRING runs up to 1000 jobs per API key at once. Experiments beyond this limit are not submitted, with a warning. Submit them later with values[, attr(job_ids, "not_submitted"), drop = FALSE]. For a vector of values, a refusal by STRING is an error. The method needs STRING version 12.0 or later. It uses the API key of this computer (see get_api_key).

Keep the job identifiers, e.g. with saveRDS(job_ids, "jobs.rds"), to get the results in another R session: their names give the experiments.

Value

For a vector of values: the job identifier. For a table: the job identifiers, named by experiment. The attribute not_submitted gives the columns of the experiments that were not submitted, if any.

Author(s)

Damian Szklarczyk

See Also

get_values_ranks_status, get_values_ranks_results, get_values_ranks_enrichment, get_api_key

Examples

if (interactive()) {
  string_db <- STRINGdb$new(version = "12.5", species = 9606)
  data(diff_exp_example1)
  mapped <- string_db$map(diff_exp_example1, "gene", removeUnmappedRows = TRUE)
  rankings <- data.frame(logFC = mapped$logFC,
                         signed_p = sign(mapped$logFC) * -log10(mapped$pvalue))

  # submit and return at once; the jobs run side by side on STRING's servers
  job_ids <- string_db$submit_values_ranks_enrichment(mapped$STRING_id, rankings)
  print(string_db$get_values_ranks_status(job_ids))

  # later, also in a new R session on this computer
  results <- string_db$get_values_ranks_results(job_ids)
}