Skip to contents

Run ssGSEA or PTM-SEA with ssGSEA2.0. GCT files with results are written to outdir.

Usage

ssGSEA2_wrapper(
  input_gct_path,
  method = c("gsea", "gsea_mitocarta", "ptmsea"),
  gene_set_db_path = NULL,
  output_prefix = NULL,
  outdir = ".",
  nperm = NULL,
  ...
)

Arguments

input_gct_path

character, path to GCT file used as input, e.g., from prepare_gsea_input() or prepare_ptmsea_input()

method

character, one of "gsea","gsea_mitocarta","ptmsea". Must be "gsea" or "ptmsea" is gene_set_db_path is specified.

gene_set_db_path

optional character or character vector of GMT files that should be used as the gene set database(s). If not specified, the corresponding database used for manuscript analyses is used (see details).

output_prefix

character, prefix for results. By default, the prefix is taken from input_gct_path.

outdir

character, output directory for results. The directory is created if it does not already exist. Current directory by default.

nperm

integer, number of permutations. Default 10000 for methods "gsea", "gsea_mitocarta" and 1000 for method "ptmsea".

...

other arguments passed to ssGSEA2::run_ssGSEA2(), e.g., for parallelization

Value

Large named list with full GSEA output. Documentation for this list is not currently available. Most users will be interested in the GCT files written to outdir instead.

Details

Gene set databases:

If gene_set_db_path is not specified, than the following gene set databases are used for the given method:

  • gsea: c2.cp.v7.0.symbols.RAT.gmt

  • gsea_mitocarta: Rat.Refseq.MitoPathways3.0.gmt

  • ptmsea: ptm.sig.db.all.flanking.human.v1.9.0.gmt

Examples

if (FALSE) {
# For these examples, we use a single permutation for the sake of running
# the example quickly. In practice, a large number of permutations should 
# be used, e.g., 1000, 10000

# Run GSEA with differential analysis results from liver global proteome
input = prepare_gsea_input(tissue = "LIVER",
                           assay = "PROT", 
                           outdir = "/tmp")
res = ssGSEA2_wrapper(input, method = "gsea", outdir = "/tmp", nperm = 1)

# Run GSEA with Mitocarta database,
# which uses RefSeq IDs as pathway members
input = prepare_gsea_input(tissue = "SKM-GN",
                           assay = "TRNSCRPT", 
                           outdir = "/tmp",
                           gene_id_type = "refseq")
res = ssGSEA2_wrapper(input, method = "gsea_mitocarta", outdir = "/tmp", nperm = 1)

# Use example from the Broad
# Download example input
download.file(url = paste0("https://raw.githubusercontent.com/nicolerg/ssGSEA2.0/",
    "master/example/PI3K_pert_logP_n2x23936.gct"),
  destfile = "/tmp/PI3K_pert_logP_n2x23936.gct")
# Download gene set database
download.file(url = paste0("https://raw.githubusercontent.com/nicolerg/ssGSEA2.0/",
    "master/example/ptm.sig.db.all.flanking.human.v1.8.1.gmt"),
  destfile = "/tmp/ptm.sig.db.all.flanking.human.v1.8.1.gmt")
# Using a small number of permutations for the sake of the example. 1000 recommended
res = ssGSEA2_wrapper("/tmp/PI3K_pert_logP_n2x23936.gct",
                     method = "ptmsea", 
                     gene_set_db_path = "/tmp/ptm.sig.db.all.flanking.human.v1.8.1.gmt",
                     outdir = "/tmp",
                     nperm = 1)
}