Interaction networks with StringDB
Last updated on 2026-03-31 | Edit this page
Overview
Questions
- How can we use
STRINGdbto visualise protein–protein interaction networks for our DE genes? - How do we map our gene identifiers to the IDs used by STRING?
- What information does STRING functional enrichment add beyond standard GO/KEGG analysis?
Objectives
- Load and initialise the
STRINGdbobject for mouse. - Map a set of differentially expressed genes to STRING
identifiers.
- Visualise a protein–protein interaction network for top DE
genes.
- Retrieve and inspect STRING functional enrichment results.
ERROR
Error in `library()`:
! there is no package called 'edgeR'
ERROR
Error in `library()`:
! there is no package called 'goseq'
ERROR
Error in `library()`:
! there is no package called 'fgsea'
ERROR
Error in `library()`:
! there is no package called 'EGSEA'
ERROR
Error in `library()`:
! there is no package called 'clusterProfiler'
ERROR
Error in `library()`:
! there is no package called 'org.Mm.eg.db'
ERROR
Error in `library()`:
! there is no package called 'ggplot2'
ERROR
Error in `library()`:
! there is no package called 'enrichplot'
ERROR
Error in `library()`:
! there is no package called 'pathview'
ERROR
Error in `library()`:
! there is no package called 'edgeR'
ERROR
Error in `library()`:
! there is no package called 'impute'
ERROR
Error in `library()`:
! there is no package called 'preprocessCore'
ERROR
Error in `library()`:
! there is no package called 'RegEnrich'
ERROR
Error in `library()`:
! there is no package called 'STRINGdb'
Interaction networks with StringDB
So far, we have focused on pathway-level enrichment. Another useful way to interpret RNA-seq results is to look at protein–protein interaction (PPI) networks: Are our differentially expressed genes part of the same complexes or signalling modules?
The STRINGdb package provides an interface to the STRING database, which aggregates known and predicted PPIs from multiple sources (experiments, databases, text-mining, etc.).
In this lesson we will:
- Initialise a STRINGdb object for mouse.
- Map our top differentially expressed genes to STRING IDs.
- Plot an interaction network.
- Retrieve functional enrichment results from STRING.
R
# Initialize STRINGdb for mouse (taxonomy ID: 10090)
string_db <- STRINGdb$new(version = "12", species = 10090, score_threshold = 400, input_directory = "")
ERROR
Error:
! object 'STRINGdb' not found
R
# Prepare data: select top 200 DE genes (by adjusted P value)
top200 <- debasal[order(debasal$adj.P.Val), ][1:200, ]
top200_mapped <- string_db$map(top200, "ENTREZID", removeUnmappedRows = TRUE)
ERROR
Error:
! object 'string_db' not found
R
# Plot the protein interaction network
string_db$plot_network(top200_mapped$STRING_id)
ERROR
Error:
! object 'string_db' not found
R
# Get functional enrichment (GO, KEGG, Reactome)
enrichment <- string_db$get_enrichment(top200_mapped$STRING_id)
ERROR
Error:
! object 'string_db' not found
R
head(enrichment)
ERROR
Error:
! object 'enrichment' not found
There are many available ways of exploring your data using the STRING
database that can’t be covered in one tutorial but you can learn more by
reading the vignette
and inspect available functions within the STRINGdb package
by running:
R
STRINGdb$methods()
ERROR
Error:
! object 'STRINGdb' not found
Read more about STRING:
- Szklarczyk, Damian et al. “The STRING database in 2025: protein networks with directionality of regulation.” Nucleic acids research vol. 53,D1 (2025): D730-D737. doi:10.1093/nar/gkae1113
STRINGdblinks your genes to protein–protein interaction networks from the STRING database.Mapping from gene IDs (e.g. ENTREZ) to STRING IDs is a crucial first step.
Network visualisation can reveal modules of interconnected DE genes that may not be obvious from lists or tables.
STRING provides its own functional enrichment, which can complement results from
clusterProfilerandfgsea.