View source: R/annotation_functions.R
coherentFraction | R Documentation |
Calculate fraction of genes that are correlated with feature expression program. Performed on a per-cluster basis ("seurat_clusters" in 'object' meta data).
coherentFraction(
object,
score.matrix,
genelist,
method = c("pearson", "spearman"),
assay = DefaultAssay(object),
slot = "data",
subsample.cluster.n = 500,
nworkers = 1,
verbose = T
)
object |
Seurat Object. |
score.matrix |
matrix of feature expression program. Can be computed using 'AddModuleScores', 'AddSModuleScores', 'mikoScore', among others. |
method |
Correlation method: "pearson" or "spearman". Default is "pearson". |
assay |
Name of assay to use. |
slot |
Use expression data from this slot in 'object'. |
subsample.cluster.n |
number of cells to subsample within each cluster ("seurat_clusters" in 'object' meta data). Default is 500. |
nworkers |
Number of workers for parallel implementation. Default is 1. |
verbose |
Print progress. Default is TRUE. |
geneset |
gene set list used for obtaining 'score.matrix' (e.g., gene set provided as input into 'mikoScore' or 'AddSModuleScores'). |
data.frame containing cluster-level coherent fractions.
Nicholas Mikolajewicz
AddSModuleScore
for standardized module scoring, mikoScore
for miko scoring
so.query <- AddSModuleScore(object = so.query, features = gene.list)
raw.mat <- so.query@misc[["raw_score"]]
colnames(raw.mat) <- gsub("raw_", "", colnames(raw.mat))
df.cscore <- coherentFraction(object = so.query, score.matrix =raw.mat, nworkers = 20,
genelist = gene.list, assay = DefaultAssay(so.query), slot = "data", subsample.cluster.n = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.