ssgsea_wrapper: ssGSEA

View source: R/ssgsea_wrapper.R

ssgsea_wrapperR Documentation

ssGSEA

Description

Single-sample Gene Set Enrichment Analysis. This kind of analysis is recommended when there are too few samples. The function will generate an enrichment score for each sample and associated visualizations.

The function ssGSEA is implemented on top of GSVA package. It will produce an heatmap and a violin plot. If chosen, it will produce also the enrichment score table. All the necessary data are already provided with the autoGO package (as the MSigDB gene sets). It is possible to choose whether to perform ssGSEA with all the MSigDB (database) or with a sub-group.

Usage

ssgsea_wrapper(
  norm_data = "results/deseq_vst_data.txt",
  MSigDB_names = c("hgnc", "entrez"),
  which_gene_set = NULL,
  write_enrich_tables = F,
  group = NULL,
  my_autoGO_dir = "~/",
  where_results = "./",
  outfolder = "ssgsea/",
  full_names = F,
  tpm_norm = F,
  ensembl = F
)

Arguments

norm_data

Path of the normalized matrix. By default it is the "deseq_vst_data.txt" computed with the function "deseq_analysis()", but other normalized counts matrix (like TPMs) can be passed to the function. Requirements: first column gene names.

MSigDB_names

One of c("hgnc","entrez"). The notation for gene names in the matrix.

which_gene_set

Default = NULL, all the gene sets are considered. The user can specify one or more gene_sets (c1,c2,c3, c4, c5, c6, c7, c8, h ).

write_enrich_tables

Default = FALSE. Set to TRUE to save the matrix with enrichment scores.

group

A matrix for the annotation on the heatmap and for grouping in the statistical analysis. Can be the path to an annotation matrix or dataframe in your global environment.

my_autoGO_dir

If cloned from gitlab the path to your auto-go repository, default is home directory "~/".

where_results

Specify the folder in which you want to save outputs. (Default = "./"). Note: if you are working with R Notebooks the default working directory (if not specified) is the folder in which the .Rmd is saved.

outfolder

The name to assign to the folder for output saving. (Default = "ssgsea/"). NOTE: please add "/" at the end.

full_names

Default = FALSE, Terms full names are codified for visualization purposes. Set to TRUE to plot full names instead.

tpm_norm

(Default = FALSE). Set to TRUE to perform a TPM normalization on counts matrix before the analysis.

ensembl

(Default = FALSE). Set to TRUE to convert gene names from ENSEMBL to HGNC.


isabellagrassucci/autoGO documentation built on April 5, 2022, 7:49 p.m.