This use case will demonstrate analyzing and visualizing single cell datasets from within Cytoscape to generate network views of clusters of differentiated genes per cell population. In order to control Cytoscape from R, we’ll need to install the RCy3 pacakge:
if(!"RCy3" %in% installed.packages()){
install.packages("BiocManager")
BiocManager::install("RCy3")
}
library(RCy3)
## Warning: package 'RCy3' was built under R version 4.0.3
The whole point of RCy3 is to connect with Cytoscape, so you will need to install and launch Cytoscape:
cytoscapePing()
## You are connected to Cytoscape!
For this use case, you’ll also need two Cytoscape apps: * scNetViz app to work with single cell datasets in Cytoscape * stringApp to perform enrichment analysis using the STRING webservice
installApp('scNetViz')
## App scNetViz installed
installApp('STRINGapp')
## App STRINGapp installed
In this example, we will browse a 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.
Use the accession number of single-cell experiment to pull data from the Single-Cell Experiment 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.
Run differential expression analysis for the row with true value of sel.K (default).
RCy3::commandsRun('scnetviz calculate diffexp accession=E-GEOD-81383')
Fetch protein-protein interaction networks from the STRING database.
RCy3::commandsRun('scnetviz create network accession=E-GEOD-81383')
Check the networks available in the current Cytoscape session.
RCy3::commandsRun('network list')
## [1] "Cluster (k = 4) Network" "Cluster 2"
## [3] "Cluster 3" "Cluster 1"
## [5] "Cluster 4"
Perform functional enrichment analysis for the network selected in the current session using the stringApp.
net.enr <- RCy3::commandsRun('string retrieve enrichment allNetSpecies=Homo sapiens')
RCy3::commandsRun('string show enrichment')
Visit the scNetViz website for more information.