Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add alternative ssGSEA #258

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

add alternative ssGSEA #258

wants to merge 20 commits into from

Conversation

GWMcElfresh
Copy link
Contributor

@GWMcElfresh GWMcElfresh commented Jun 8, 2024

Hi all,

This is an alternative way to score pathways in transcriptomics data.

It's based on the Wasserstein statistic/earth mover's distance between ranks. This statistic computes how "perturbed" the pathway-ranks for a specific pathway is compared to the whole transcriptome. It is very straightforward to visualize and compute for whole transcriptome data (pseudobulk, spatial, bulk).

The distance is the integral between these two curves:

It is more difficult to visualize the distance in single cell RNASeq, as the distance is pretty dependent on the number of genes expressed within the cell (for us, nFeature_RNA).

I think this can be improved by subsetting to just the expressed genes:

and then normalized (perhaps to the max number of genes across all cells? TBD, I need to experiment more with more single cell data.)

I'll add more details later!

-GW

@GWMcElfresh GWMcElfresh marked this pull request as ready for review June 21, 2024 15:24
@GWMcElfresh
Copy link
Contributor Author

GWMcElfresh commented Jun 23, 2024

Just for benchmarking, scoring RIRA's T cells with MsigDB's hallmark gene sets takes ~17 hours on 4 cores. BB01 (timecourse) takes about 14 hours with 4 cores.

@bbimber
Copy link
Contributor

bbimber commented Oct 9, 2024

@GWMcElfresh: i didnt review this super carefully, but if you feel like this is good you can merge it

@GWMcElfresh
Copy link
Contributor Author

GWMcElfresh commented Oct 9, 2024

@GWMcElfresh: i didnt review this super carefully, but if you feel like this is good you can merge it

Thanks, I think the wasserstein based measures are probably well tested (in theory, not code), but the dts based stuff (tested in code, not theory) still passes with a magnitude like 60k higher than I think it should.

still cooking a bit, but I might pull back on the scope of this function and only support lightly support dts as an experimental capability, with wasserstein defaults. The speedup from a6fa79c is really hard to turn down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants