ncborcherding / escape

Easy single cell analysis platform for enrichment
https://www.borch.dev/uploads/screpertoire/articles/running_escape
MIT License
152 stars 20 forks source link

Seurat v4 compatibility with escape package #95

Closed dimitrisokolowskei closed 7 months ago

dimitrisokolowskei commented 7 months ago

Hi @ncborcherding,

According to the issue #93 escape package seems to use Seurat v5. However, I wonder if its still possible to use Seurat v4 package/object to use escape? I guess like myself, many others still prefer, relies on or just didn`t fully adopted v5 yet in their analysis. Thank you for such a great package.

I appreciate any help on this matter.

ncborcherding commented 7 months ago

Hey Dimitri,

I am working on trying to come up with a system to support v4 and v5 at the moment. The workaround for now would be to use escape.matrix() and feeding in the counts directly. Then you can add an assay to the Seurat object.

so something like this:

enrichment.scores <- escape.matrix(SeuratObj@assays$RNA@counts, 
                                   gene.sets = GS.hallmark, 
                                   groups = 5000, 
                                   min.size = 5)
new.assay <- CreateAssayObject(data = as.matrix(t(enrichment.scores))))
SeuratObj[[enrichment.name]] <- new.assay

Apologies it is not perfect and you make a great point that a large amount of users will still rely on v4. I will list this as an enhancement and use it as a method to track progress.

Thanks, Nick

dimitrisokolowskei commented 7 months ago

Hi @ncborcherding,

Thanks for your assistance, that really helps. Keep with the awesome work.

Best