Giter Site home page Giter Site logo

Comments (5)

ncborcherding avatar ncborcherding commented on August 21, 2024

Hey rythi4,

Would you mind sharing an example?

If you are using a single-cell object to run enrichIt(), the function is pulling the raw counts from the "RNA" assay and calculates the enrichment score using a Poisson distribution in GSVA, and performs the ssGSEA normalization described by Barbie et al 2009. This normalization uses the absolute difference between a given gene set - so it is occurring on a gene.set-level.

So if the composition of the seurat object changed, in terms of the cell number, there might be a difference in the output values. But if it is the same Seurat object, it should result in the same values.

Nick

from escape.

rythi4 avatar rythi4 commented on August 21, 2024

Here is an example:

`
#Making GeneSetCollections:
set1 <- GeneSetCollection(GeneSet(genes[["X"]][["gene"]], setName = "x"), GeneSet(genes[["Y"]][["gene"]], setName = "y"), GeneSet(genes[["Z"]][["gene"]], setName = "z"), GeneSet(genes[["W"]][["gene"]], setName = "w"))
set2 <- GeneSetCollection(GeneSet(genes[["X"]][["gene"]], setName = "x"), GeneSet(genes[["Y"]][["gene"]], setName = "y"))

#Here I define the seurat_object: seurat_object <- XXX
DefaultAssay(seurat_object) <- "RNA"
seurat_object_1 <- UpdateSeuratObject(seurat_object)
ES.seurat_1 <- enrichIt(obj = seurat_object_1, gene.sets = set1, groups = 1000)
#Here I define the seurat_object: seurat_object <- XXX
DefaultAssay(seurat_object) <- "RNA"
seurat_object_1 <- UpdateSeuratObject(seurat_object)
ES.seurat_2 <- enrichIt(obj = seurat_object_1, gene.sets = set2, groups = 1000)
`
The two seurat_objects are defined by the exact same line of code.

When I look at ES.seurat_1 and ES.seurat_2 (I order the columns 'x' by highest value for easy comparison), I see that the highest value is not the same:
image

from escape.

ncborcherding avatar ncborcherding commented on August 21, 2024

Thank you so much for the reproducible example!!

I found the issue - it lies in the GSVA package itself
Screen Shot 2022-01-18 at 12 40 06 PM

I think this might be an error in my reading of the original manuscript for ssGSEA. I will take a look, I might have to implement an intrinsic normalization so the enrichment scores are deterministic. I'll post here when I get something working.

Thanks for bringing this to my attention.

Nick

from escape.

rythi4 avatar rythi4 commented on August 21, 2024

Of course, that was no problem!

from escape.

ncborcherding avatar ncborcherding commented on August 21, 2024

The newest dev version (v1.3.5) now has a new parameter ssGSEA.norm which will scale the columns from 0 to 1. However, if you would like to subset the data at a later time, the default setting is now not to normalize the data.

enrichIt <- function(obj, gene.sets = NULL, 
                     method = "ssGSEA", 
                     groups = 1000, 
                     cores = 2,
                     min.size = 5,
                     ssGSEA.norm = FALSE) 

Thanks again for letting me know about this.

Nick

from escape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.