View source: R/ScoreSignature.R
ScoreSignature | R Documentation |
This function scores a signature at the single cell level on Seurat objects (sum of the expression for each cell). The signature must be a list of features (character vector). Any feature can be set as a negative marker in the scoring by prefixing it with a minus sign, e.g. "-EPCAM". By default, the score is computed as the average expression of the features as normalized in the "data" layer (i.e. log-normalized typically). Can be overrun by setting the layer.use parameter. If imputed data is available (assay "imputed.RNA"), the imputed data will be used. Otherwise, data from the RNA assay will be used. This can be overrun by setting the assay.use parameter.
ScoreSignature(
object,
features,
name = "Signature",
assay.use = NA,
layer.use = "data"
)
object |
Seurat object. |
features |
The signature, typically a gene list (character vector). Negative features are prefixed by a minus sign as in "-EPCAM". |
name |
The name of the signature (character). The single cell scores are added to the Seurat object metadata in a column with this name, and can be accessed as object$name or displayed with FeaturePlot(object,name). |
assay.use |
The assay within the Seurat object to use for signature scoring. If NA (default), it will use the "imputed" assay if it is present, or the "RNA" assay otherwise. |
layer.use |
The layer to use within the assay to get data for signature scoring. By default, using the "data" assay. |
Seurat object with an additional metadata column containing the signature score.
#Scoring a single signature
MySeuratObject <- Impute(MySeuratObject)
MySeuratObject <- ScoreSignature(MySeuratObject,c("EPCAM","CDH1","ITGA6","-COL1A1"),"EpithelialSignature")
head(MySeuratObject$EpithelialSignature)
FeaturePlot(MySeuratObject,"EpithelialSignature")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.