broadinstitute / ssGSEA2.0

Single sample Gene Set Enrichment analysis (ssGSEA) and PTM Enrichment Analysis (PTM-SEA)
Other
230 stars 79 forks source link

converted to R package #25

Closed nicolerg closed 1 year ago

nicolerg commented 1 year ago

Hello,

For any users interested only in running ssGSEA2() in R, I have developed an R package that makes dependency management easier and cleans up a few things.

It is easy to install along with all dependencies for both R 3.6 and R >= 4.0 (see here) and easy to run:

library(ssGSEA2)

# Download example input
download.file(url = "https://raw.githubusercontent.com/nicolerg/ssGSEA2/master/example/PI3K_pert_logP_n2x23936.gct",
              destfile = "/tmp/PI3K_pert_logP_n2x23936.gct")

# Download gene set database 
download.file(url = "https://raw.githubusercontent.com/nicolerg/ssGSEA2/master/example/ptm.sig.db.all.flanking.human.v1.8.1.gmt"),
              destfile = "/tmp/ptm.sig.db.all.flanking.human.v1.8.1.gmt")

res = run_ssGSEA2("/tmp/PI3K_pert_logP_n2x23936.gct",
                  output.prefix = "example",
                  gene.set.databases = "/tmp/ptm.sig.db.all.flanking.human.v1.8.1.gmt",
                  output.directory = "/tmp",
                  sample.norm.type = "none", 
                  weight = 0.75, 
                  correl.type = "rank", 
                  statistic = "area.under.RES",
                  output.score.type = "NES", 
                  nperm = 1000, 
                  min.overlap = 5, 
                  extended.output = TRUE, 
                  global.fdr = FALSE,
                  log.file = "/tmp/run.log")

Differences relative to the original ssGSEA2() function include:

Would you consider adding a link to the repository for this R package in your README? https://github.com/nicolerg/ssGSEA2

drmani commented 1 year ago

Hello Nicole,

This is wonderful! Thanks very much for taking the time to create this R package. I have now added a sub-section in the "How can I use these tools?" section to point to your R package.

nicolerg commented 1 year ago

Thank you for the quick reply!