coherentFraction.Rd
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
)
Seurat Object.
matrix of feature expression program. Can be computed using `AddModuleScores`, `AddSModuleScores`, `mikoScore`, among others.
Correlation method: "pearson" or "spearman". Default is "pearson".
Name of assay to use.
Use expression data from this slot in `object`.
number of cells to subsample within each cluster ("seurat_clusters" in `object` meta data). Default is 500.
Number of workers for parallel implementation. Default is 1.
Print progress. Default is TRUE.
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.
AddSModuleScore
for standardized module scoring, mikoScore
for miko scoring
so.query <- AddSModuleScore(object = so.query, features = gene.list)
#> Loading required package: parallel
#> Error in AddSModuleScore(object = so.query, features = gene.list): object 'gene.list' not found
raw.mat <- so.query@misc[["raw_score"]]
#> Error in eval(expr, envir, enclos): object 'so.query' not found
colnames(raw.mat) <- gsub("raw_", "", colnames(raw.mat))
#> Error in is.data.frame(x): object 'raw.mat' not found
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)
#> Error in "Seurat" %in% class(object): object 'so.query' not found