The R markdown is available from the pulldown menu for Code
at the upper-right, choose “Download Rmd”, or download
the Rmd from GitHub.
In this example, we will browse a public single cell expression
atlas, explore a particular dataset, perform differential expression
analysis based on provided categories, generate networks from the top
genes from each category, and functionally characterize and visualize
the networks.
Installation
if(!"RCy3" %in% installed.packages()){
install.packages("BiocManager")
BiocManager::install("RCy3")
}
library(RCy3)
Required software
RCy3 works by connecting with Cytoscape. You will need to install and
launch Cytoscape:
For this vignette, you’ll need the following apps:
#available in Cytoscape 3.7.0 and above
installApp('STRINGapp')
installApp('enhancedGraphics')
installApp('cyBrowser')
installApp('cyPlot')
installApp('scNetViz')
Pull data from the EMBL-EBI Single-Cell Expression Atlas
Use the accession number of single-cell experiment to pull data from
the Single-Cell
Expression Atlas of EMBL-EBI.
#Load data with Accession number E-GEOD-81383
RCy3::commandsRun('scnetviz load gxa experiment accession=E-GEOD-81383')
This loads the data and opens an experiment table with three tabs,
named TPM, Categories, and DiffExp.
Differential expression analysis
Run differential expression analysis for the row with
true
value of sel.K
(default).
RCy3::commandsRun('scnetviz calculate diffexp accession=E-GEOD-81383')
##Query STRING database for interaction networks
Fetch interaction networks from the STRING database.
RCy3::commandsRun('scnetviz create network accession=E-GEOD-81383')
The following command runs both the differential expression analysis
and fetches interaction networks simultaneously.
RCy3::commandsRun('scnetviz create all experiment=E-GEOD-81383')
Functional enrichment analysis
Check the networks available in the current Cytoscape session.
RCy3::commandsRun('network list')
Perform functional enrichment analysis for the network selected in
the current session, which is the last network that was fetched unless
another network is manually selected from Cytoscape. This uses the stringApp.
To view the results in the Cytoscape application, you may have to
activate the Show enrichment panel option under STRING
Enrichment sub-menu from Apps from the menu
bar.
RCy3::commandsRun('string retrieve enrichment allNetSpecies=Homo sapiens')
Visit the scNetViz
website for more information.
LS0tCnRpdGxlOiAic2NOZXRWaXo6IEVNQkwtRUJJIFNpbmdsZSBDZWxsIEV4cHJlc3Npb24gQXRsYXMiCmF1dGhvcjogIktyaXNobmEgQ2hvdWRoYXJ5LCB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