scRGNet is an R package for inferring cell-cell networks from encoded
scRNA-seq data. It is the first R package that attempts to use
torch
(Falbel et al. 2021) in R to implement an
feature(that is, gene) autoencoder from the recently proposed single
cell graph neural network (scGNN) framework.(Wang et al.
2021) It generates an encoded feature matrix containing the
low-dimensional representation of gene expression in each cell, and
build a Cell-Cell network from the feature matrix using KNN and
isolation forest(Liu, Ting, and Zhou
2008)(Cortes 2021). When using
the feature autoencoder, discretized regulatory signals quantified from
gene expression modeled by a left-truncated mixture Gaussian (LTMG)
model can also be used as a regulariser.(Wan et al. 2019)
It is unique from other R packages for scRNA-seq analysis in that
scRGNet offers an option to analyse scRNA-seq data without assuming
statistical distributions or relationships for gene expression.
To install the latest version of scRGNet:
require("devtools")
devtools::install_github("ff98li/scRGNet", build_vignettes = TRUE)
To run the Shiny app:
scRGNet::runscRGNet()
library(scRGNet)
ls("package:scRGNet")
#> [1] "gene_counts" "gene_counts_small" "generateNetwork"
#> [4] "plotCellNet" "plotDegree" "plotLog"
#> [7] "preprocessCSV" "runFeatureAE" "runLTMG"
#> [10] "runscRGNet" "scDataset" "setHardware"
#> [13] "setHyperParams"
data(package = "scRGNet")
Note that there are two datasets included in this package gene_counts
and gene_counts_small
. gene_counts
is a raw scRNA-seq matrix from
experiment GSE138852(Grubman et al. 2019).
gene_counts_small
is a subset of the gene_counts
data for a quick
demo of the package, containing only 48 cells and 1000 genes. For usage
of functions in the package, please refer to package vignettes for more
details:
browseVignettes(package = "scRGNet")
An overview of the package structure is provided below:
An overview of the package workflow is illustrated below:
The author of the package is Feifei Li. The runLTMG function uses the
LTMG object and the function for inferring LTMG tags from
scgnnltmg
(Wang et al. 2021). data.table
R
package(Dowle and Srinivasan 2021) is used for fast reading
in a large size scRNA-seq raw matrix from csv. The Matrix
(Bates and
Maechler 2021) R package is used to store scRNA-seq data
as a sparse matrix to reduce memory usage, and used to convert a tensor
object to an R matrix. The scDataset object is an R6
object(Chang
2021) inherited from class dataset
from torch
. The feature
autoencoder is also an R6 object inherited from the basic neural network
modules nn_module
from torch
R package, and it makes use of its
functional modules nnf_linear
and nnf_relu
.(Falbel et al.
2021) Iteration of model training makes use of coro::loop
form the coro
R package. The model training also uses progress
R
package to inform users the model trainning progress. The
generateNetwork function makes use of graph_from_data_frame
from
igraph
R package to generate a plottable igraph
object.(Csardi and
Nepusz 2006), and the isolation forest model from the
isotree
R package(Cortes 2021) is used to prune
outliers in cell graphs produced by generateNetwork. The interactive
visualisation of produced cell network makes use of the visNetwork
R
package(Almende B.V. and Contributors, Thieurmel, and Robert
2021). plotDegree
and plotLog
make use of the
graphics
R package(R Core Team 2021).
cluster_label_prop
and degree
function from igraph
R package are
used to compute the communities and degrees of the network. The shiny
app of this package is made with shiny
(Chang et al.
2021), shinyjs
(Attali 2020), and
shinybusy
(Meyer and Perrier 2020) R packages. Except
for the LTMG modeling in runLTMG
uses external R package for
computation, all other functions for data processing and analysis in
this package are my original R implementation.
This package was developed as part of an assessment for 2021 BCB410H: Applied Bioinformatics, University of Toronto, Toronto, CANADA.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.