Title: | Network smoothing for scRNAseq |
---|---|
Description: | netSmooth is an R package for network smoothing of single cell RNA sequencing data. Using bio networks such as protein-protein interactions as priors for gene co-expression, netsmooth improves cell type identification from noisy, sparse scRNAseq data. |
Authors: | Jonathan Ronen [aut, cre], Altuna Akalin [aut] |
Maintainer: | Jonathan Ronen <[email protected]> |
License: | GPL-3 |
Version: | 1.27.0 |
Built: | 2024-10-30 09:04:22 UTC |
Source: | https://github.com/bioc/netSmooth |
An adjacency matrix of the 10 percent highest confidence interactions between human proteins on STRINGdb.
human.ppi
human.ppi
A square matrix where A_ij=1 if gene i interacts with gene j
See the script in 'system.file(package="netSmooth", "data-raw", "make_ppi_from_string.R")' for full details of how this object was made.
An adjacency matrix of the 10 percent highest confidence interactions between mouse proteins on STRINGdb.
mouse.ppi
mouse.ppi
A square matrix where A_ij=1 if gene i interacts with gene j
See the script in 'system.file(package="netSmooth", "data-raw", "make_ppi_from_string.R")' for full details of how this object was made.
Perform network smoothing of gene expression or other omics data
## S4 method for signature 'matrix' netSmooth( x, adjMatrix, alpha = "auto", normalizeAdjMatrix = c("rows", "columns"), autoAlphaMethod = c("robustness", "entropy"), autoAlphaRange = 0.1 * (seq_len(9)), autoAlphaDimReduceFlavor = "auto", is.counts = TRUE, bpparam = BiocParallel::SerialParam(), ... ) ## S4 method for signature 'SummarizedExperiment' netSmooth(x, ...) ## S4 method for signature 'SingleCellExperiment' netSmooth(x, ...) ## S4 method for signature 'Matrix' netSmooth( x, adjMatrix, alpha = "auto", normalizeAdjMatrix = c("rows", "columns"), autoAlphaMethod = c("robustness", "entropy"), autoAlphaRange = 0.1 * (seq_len(9)), autoAlphaDimReduceFlavor = "auto", is.counts = TRUE, bpparam = BiocParallel::SerialParam(), ... ) ## S4 method for signature 'DelayedMatrix' netSmooth( x, adjMatrix, alpha = "auto", normalizeAdjMatrix = c("rows", "columns"), autoAlphaMethod = c("robustness", "entropy"), autoAlphaRange = 0.1 * (seq_len(9)), autoAlphaDimReduceFlavor = "auto", is.counts = TRUE, bpparam = BiocParallel::SerialParam(), filepath = NULL, ... )
## S4 method for signature 'matrix' netSmooth( x, adjMatrix, alpha = "auto", normalizeAdjMatrix = c("rows", "columns"), autoAlphaMethod = c("robustness", "entropy"), autoAlphaRange = 0.1 * (seq_len(9)), autoAlphaDimReduceFlavor = "auto", is.counts = TRUE, bpparam = BiocParallel::SerialParam(), ... ) ## S4 method for signature 'SummarizedExperiment' netSmooth(x, ...) ## S4 method for signature 'SingleCellExperiment' netSmooth(x, ...) ## S4 method for signature 'Matrix' netSmooth( x, adjMatrix, alpha = "auto", normalizeAdjMatrix = c("rows", "columns"), autoAlphaMethod = c("robustness", "entropy"), autoAlphaRange = 0.1 * (seq_len(9)), autoAlphaDimReduceFlavor = "auto", is.counts = TRUE, bpparam = BiocParallel::SerialParam(), ... ) ## S4 method for signature 'DelayedMatrix' netSmooth( x, adjMatrix, alpha = "auto", normalizeAdjMatrix = c("rows", "columns"), autoAlphaMethod = c("robustness", "entropy"), autoAlphaRange = 0.1 * (seq_len(9)), autoAlphaDimReduceFlavor = "auto", is.counts = TRUE, bpparam = BiocParallel::SerialParam(), filepath = NULL, ... )
x |
matrix or SummarizedExperiment |
adjMatrix |
adjacency matrix of gene network to use |
alpha |
numeric in [0,1] or 'audo'. if 'auto', the optimal value for alpha will be automatically chosen among the values specified in 'autoAlphaRange', using the strategy specified in 'autoAlphaMethod' |
normalizeAdjMatrix |
how to normalize the adjacency matrix possible values are 'rows' (in-degree) and 'columns' (out-degree) |
autoAlphaMethod |
if 'robustness', pick alpha that gives the highest proportion of samples in robust clusters if 'entropy', pick alpha that gives highest Shannon entropy in 2D PCA embedding |
autoAlphaRange |
if ‘alpha=’optimal'', search these values for the best alpha |
autoAlphaDimReduceFlavor |
algorithm for dimensionality reduction that will be used to pick the optimal value for alpha. Either the 2D embedding to calculate the Shannon entropy for (if ‘autoAlphaMethod=’entropy''), or the dimensionality reduction algorithm to be used in robust clustering (if ‘autoAlphamethod=’robustness'') |
is.counts |
logical: is the assay count data |
bpparam |
instance of bpparam, for parallel computation with the ‘alpha=’auto'' option. See the BiocParallel manual. |
... |
arguments passed on to 'robustClusters' if using the robustness criterion for optimizing alpha |
filepath |
String: Path to location where hdf5 output file is supposed to be saved. Will be ignored when regular matrices or SummarizedExperiment are used as input. |
network-smoothed gene expression matrix or SummarizedExperiment object
x <- matrix(rnbinom(12000, size=1, prob = .1), ncol=60) rownames(x) <- paste0('gene', seq_len(dim(x)[1])) adj_matrix <- matrix(as.numeric(rnorm(200*200)>.8), ncol=200) rownames(adj_matrix) <- colnames(adj_matrix) <- paste0('gene', seq_len(dim(x)[1])) x.smoothed <- netSmooth(x, adj_matrix, alpha=0.5)
x <- matrix(rnbinom(12000, size=1, prob = .1), ncol=60) rownames(x) <- paste0('gene', seq_len(dim(x)[1])) adj_matrix <- matrix(as.numeric(rnorm(200*200)>.8), ncol=200) rownames(adj_matrix) <- colnames(adj_matrix) <- paste0('gene', seq_len(dim(x)[1])) x.smoothed <- netSmooth(x, adj_matrix, alpha=0.5)
Pick the dimensionality reduction method for a dataset that gives the 2D embedding with the highest entropy
## S4 method for signature 'matrix' pickDimReduction(x, flavors = c("pca", "tsne", "umap"), is.counts = TRUE) ## S4 method for signature 'SummarizedExperiment' pickDimReduction(x) ## S4 method for signature 'Matrix' pickDimReduction(x, flavors = c("pca", "tsne", "umap"), is.counts = TRUE) ## S4 method for signature 'DelayedMatrix' pickDimReduction(x, flavors = c("pca", "tsne", "umap"), is.counts = TRUE)
## S4 method for signature 'matrix' pickDimReduction(x, flavors = c("pca", "tsne", "umap"), is.counts = TRUE) ## S4 method for signature 'SummarizedExperiment' pickDimReduction(x) ## S4 method for signature 'Matrix' pickDimReduction(x, flavors = c("pca", "tsne", "umap"), is.counts = TRUE) ## S4 method for signature 'DelayedMatrix' pickDimReduction(x, flavors = c("pca", "tsne", "umap"), is.counts = TRUE)
x |
matrix or SummarizedExperiment object [GENES x SAMPLES] |
flavors |
list of dimensionality reduction algorithms to try. Currently the options are "pca", "tsne" and "umap" |
is.counts |
logical: is exprs count data |
name of dimensionality reduction method that gives the highest 2d entropy
x <- matrix(rnbinom(60000, size=1, prob = .1), ncol=100) pickDimReduction(x)
x <- matrix(rnbinom(60000, size=1, prob = .1), ncol=100) pickDimReduction(x)
Perform robust clustering on dataset, and calculate the proportion of samples in robust clusters
## S4 method for signature 'SummarizedExperiment' robustClusters(x, dimReduceFlavor = "auto", is.counts = TRUE, ...) ## S4 method for signature 'matrix' robustClusters(x, ...)
## S4 method for signature 'SummarizedExperiment' robustClusters(x, dimReduceFlavor = "auto", is.counts = TRUE, ...) ## S4 method for signature 'matrix' robustClusters(x, ...)
x |
matrix or SummarizedExperiment object |
dimReduceFlavor |
algorithm for dimensionality reduction step of clustering procedure. May be 'pca', 'tsne', 'dm', 'umap' or 'auto', which uses shannon entropy to pick the algorithm. |
is.counts |
logical: is the data counts |
... |
arguments passed on to 'clusterExperimentWorkflow' |
list(clusters, proportion.robust)
data("smallscRNAseq") robustClusters(smallscRNAseq, dimReduceFlavor='pca')
data("smallscRNAseq") robustClusters(smallscRNAseq, dimReduceFlavor='pca')
Contains a synthetic PPI of human genes.
smallPPI
smallPPI
An object of class matrix
with 611 rows and 611 columns.
Contains scRNAseq profiles of human blastomeres.
smallscRNAseq
smallscRNAseq
SingleCellExperiment
https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE44183