Performs a Gene Set Enrichment Analysis (GSEA) or an OverRepresentation Analysis (ORA) on the results of a sPLS-DA. The GSEA is run on the complete ranking of the companion non-sparse model, the ORA on the proteins retained by the sparse one, using as background all the proteins that entered the model.

sPLSDA.enrichment(
  DEprot.sPLSDA.object,
  TERM2GENE,
  enrichment.type,
  component = 1,
  gsea.rank.method = "loading",
  direction = "both",
  top.n = NULL,
  universe = NULL,
  gsub.pattern.prot.id = NULL,
  pvalueCutoff = 0.05,
  qvalueCutoff = 0.05,
  pAdjustMethod = "BH",
  dotplot.n = 10
)

Arguments

DEprot.sPLSDA.object

An object of class DEprot.sPLSDA.

TERM2GENE

Data.frame containing two columns 'gs_name' (IDs of the gene sets) and 'gene_symbol' (indicating the gene IDs). No default.

enrichment.type

String indicating the type of analyses to perform. One among: GSEA, ORA. No default.

component

Numeric value indicating the component to analyze. Default: 1.

gsea.rank.method

String indicating the score used to rank the proteins for the GSEA. One among: 'loading', 'vip', 'sparse' (see get.sPLSDA.ranking). Default: "loading".

direction

String indicating which side of the component is tested by the ORA. One among: 'both', 'positive', 'negative'. Ignored for the GSEA. Default: "both".

top.n

Numeric value indicating how many best-ranked selected proteins should be used for the ORA. Default: NULL (all the selected proteins).

universe

Character vector indicating the background gene list of the ORA. Default: NULL, meaning all the proteins that entered the model.

gsub.pattern.prot.id

String indicating a pattern to be passed to gsub and to remove from the prot.id. Default: NULL (no changes in the IDs).

pvalueCutoff

Numeric value indicating the adjusted pvalue cutoff on enrichment tests to report. Default: 0.05.

qvalueCutoff

Numeric value indicating the qvalue cutoff on enrichment tests to report as significant (only for ORA). Default: 0.05.

pAdjustMethod

String indicating the method to use for the p-value adjustment. One among "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". Default: "BH".

dotplot.n

Numeric value indicating the maximum number of categories to plot in the dotplot. Default: 10.

Value

An object of class DEprot.enrichResult.

Details

The object returned is a DEprot.enrichResult, the same class produced by geneset.enrichment, so the results of a sPLS-DA and those of a differential analysis can be handled by the same downstream functions (NES.plot, plot.GSEA, simplify.enrichment, combine.enrichments, divergent.enrichment).

The background of the ORA is the list of the proteins that entered the model, which is the only sensible universe here: a protein that was never quantified had no chance of being selected.

Author

Sebastian Gregoricchio

Examples

splsda <- perform.sPLSDA(DEprot.object = DEprot::test.toolbox$dpo.imp,
                         group.column = "condition",
                         keepX = 5,
                         validate = FALSE)
#> Warning: The number of 'folds' (5) is larger than the smallest class (4 samples): 'folds' has been set to 4.

# Over-representation of the proteins selected by the sparse model
ora <- sPLSDA.enrichment(DEprot.sPLSDA.object = splsda,
                         TERM2GENE = DEprot::test.toolbox$geneset,
                         enrichment.type = "ORA",
                         component = 1,
                         pvalueCutoff = 1,
                         qvalueCutoff = 1)
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
#> Warning: showCategory (5) is larger than available items (2). Using 2
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.

# GSEA on the complete ranking of the non-sparse model
gsea <- sPLSDA.enrichment(DEprot.sPLSDA.object = splsda,
                          TERM2GENE = DEprot::test.toolbox$geneset,
                          enrichment.type = "GSEA",
                          component = 1,
                          pvalueCutoff = 1)
#> Warning: showCategory (5) is larger than available items (3). Using 3
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.