Skip to content

Can I do gsea analysis on single cell ? #788

@Xiangyi-Deng

Description

@Xiangyi-Deng

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions