-
Couldn't load subscription status.
- Fork 261
Description
Hello,
I have a small question.
As usual, we will use GSEA on ranked genes from two groups. But if we can do it on scRNA, for each cell ?
According to the difference from each gene's expression level compared to the average expression level of all genes in single cell and rank these genes by the different value.
So regard each cell as a sample, and do GSEA by for loop all cells in one scRNA seurat object ?
just like:
for (i in seq_len(total_cells)) {
cell <- colnames(expr_mat)[i]
Δ-expression
diff_vec <- expr_mat[, cell] - mean_expr
diff_vec <- diff_vec[!is.na(diff_vec)]
stats <- sort(diff_vec, decreasing = TRUE)
names(stats) <- names(stats)
fg <- fgsea(pathways = pathways,
stats = stats,
minSize = 5,
maxSize = 500,
nperm = nperm)
......
}
Could you give me some advice on this point.
Thanks in advance.