resetForSeurat {RESET} | R Documentation |
RESET wrapper for scRNA-seq data processed using the Seurat framework
Description
Executes the Reconstruction Set Test (RESET) method (reset
) on
normalized scRNA-seq data stored in a Seurat object. Will analyze the
normalized counts in the active assay (i.e., either the log-normalized or SCTransformed counts).
Usage
resetForSeurat(seurat.data, num.pcs, gene.set.collection, k=10, random.threshold,
k.buff=0, q=0, test.dist="normal", norm.type="2", per.var=FALSE)
Arguments
seurat.data |
The Seurat object that holds the scRNA-seq data. Assumes PCA has already been performed on a centered and scaled version of the normalized counts. |
num.pcs |
Number of PCs to use in the RESET method. If not specified, will use all computed PCs.
The projection of the scRNA-seq data onto these PCs will be used as the |
gene.set.collection |
List of m gene sets for which scores are computed.
Each element in the list corresponds to a gene set and the list element is a vector
of indices for the genes in the set. The index value is defined relative to the
order of genes in the Seurat active assay. Gene set names should be specified as list names.
See |
k |
See description in |
random.threshold |
See description in |
k.buff |
See description in |
q |
See description in |
test.dist |
See description in |
norm.type |
See description in |
per.var |
See description in |
Value
An updated Seurat object with the following modifications:
RESET sample-level gene set score matrix S stored in the "data" slot of a new "RESET" Assay object.
RESET overall gene set scores stored in the feature metadata column "RESET".
See Also
Examples
# Only run example code if Seurat package is available
if (requireNamespace("Seurat", quietly=TRUE) & requireNamespace("SeuratObject", quietly=TRUE)) {
# Define a collection with three gene sets
collection=list(set1=1:10, set2=11:20, set3=21:30)
# Execute on the pbmc_small scRNA-seq data set included with SeuratObject
# See vignettes for more detailed Seurat examples
reset.out = resetForSeurat(seurat.data=SeuratObject::pbmc_small,
num.pcs=5,
gene.set.collection=collection)
# Retrieve the scores for the first 10 cells
reset.out@assays$RESET[,1:10]
# Retrieve the overall scores
reset.out@assays$RESET@meta.features
}