olink_pathway_enrichment: Performs pathway enrichment using over-representation...

View source: R/olink_pathway_enrichment.R

olink_pathway_enrichmentR Documentation

Description

This function performs enrichment analysis based on statistical test results and full data using clusterProfiler's functions gsea and enrich for MSigDB.

Usage

olink_pathway_enrichment(
  df,
  test_results,
  check_log = NULL,
  method = "GSEA",
  ontology = "MSigDb",
  organism = "human",
  pvalue_cutoff = 0.05,
  estimate_cutoff = 0
)

Arguments

df

NPX data frame in long format with at least protein name ("Assay"), "OlinkID", "UniProt", "SampleID", QC warning ("QC_Warning" or "SampleQC"), quantification column ("NPX", "Ct" or "Quantified_value"), and one or more columns representing limit of detection ("LOD", "PlateLOD" or "MaxLOD").

test_results

a data frame of statistical test results including the columns "Adjusted_pval" and "estimate".

check_log

A named list returned by check_npx(). If NULL, check_npx() will be run internally using df.

method

One of "GSEA" (default) or "ORA".

ontology

One of "MSigDb" (default), "MSigDb_com", "KEGG", "GO", and "Reactome". "MSigDb" contains "C2" and "C5" gene sets which encompass "KEGG", "GO", and "Reactome". "MSigDb_com" consists of "C2" and "C5" gene sets without "KEGG", as the latter not permitted for commercial use.

organism

One of "human" (default) or "mouse".

pvalue_cutoff

(numeric) maximum adjusted p-value cutoff for ORA filtering of foreground set (default = 0.05). This argument is not used for GSEA.

estimate_cutoff

(numeric) minimum estimate cutoff for ORA filtering of foreground set (default = 0). This argument is not used for GSEA.

Details

MSigDB is subset if the ontology argument is "KEGG", "GO", or "Reactome". The argument test_results must contain estimates for all assays, otherwise an error will be thrown. Results from a post-hoc statistical test can be used as argument for test_results, but the user needs to select and filter one contrast to improve interpretability of the results. Alternative statistical results can be used as input as long as they include the columns "OlinkID", "Assay", and "estimate". A column named "Adjusted_pval" is also required for ORA. Any statistical result that contains exactly one estimate per protein will work as long as the estimates are comparable to each other.

The R library clusterProfiler is originally developed by Guangchuang Yu at the School of Basic Medical Sciences at Southern Medical University.

NB: We strongly recommend to set a seed prior to running this function to ensure reproducibility of the results.

An important note regarding Pathway Enrichment with Olink Data

It is important to note that sometimes the proteins that are assayed in Olink Panels are related to specific biological areas and therefore do not represent an unbiased overview of the proteome as a whole, which is an assumption for pathway enrichment. Pathways can only interpreted based on the background/context they came from. For this reason, an estimate for all assays measured must be provided. Furthermore, certain pathways cannot come up based on Olink's coverage in this area. Additionally, if only the Inflammation panel was run, then the available pathways would be given based on a background of proteins related to inflammation. Both ORA and GSEA can provide mechanistic and disease related insight and are best to use when trying to uncover pathways/annotations of interest. It is recommended to only use pathway enrichment for hypothesis generating data, which is better suited for data originating from Olink's NGS platforms "Explore 3072", "Explore HT", and "Reveal" or on multiple Target 96 panels from Olink's qPCR platform. For smaller lists of proteins it may be more informative to use biological annotation in directed research, to discover which significant assays are related to keywords of interest.

Value

A data frame of enrichment results.

Columns for ORA include:

  • ID: Pathway ID from MSigDB.

  • Description: Description of Pathway from MSigDB.

  • GeneRatio: Ratio of input proteins that are annotated in a term.

  • BgRatio: Ratio of all genes that are annotated in this term.

  • pvalue: P-value of enrichment.

  • p.adjust: Benjamini-Hochberg adjusted p-value.

  • qvalue: False discovery rate (FDR), the estimated probability that the normalized enrichment score represents a false positive finding.

  • geneID: List of input proteins (Gene Symbols) annotated in a term, delimited by "/".

  • Count: Number of input proteins that are annotated in a term.

Columns for GSEA:

  • ID: Pathway ID from MSigDB.

  • Description: Description of Pathway from MSigDB.

  • setSize: Ratio of input proteins that are annotated in a term.

  • enrichmentScore: Enrichment score (ES), degree to which a gene set is over-represented at the top or bottom of the ranked list of genes.

  • NES: Normalized Enrichment Score (NES), normalized to account for differences in gene set size and in correlations between gene sets and expression data sets. NES can be used to compare analysis results across gene sets.

  • pvalue: P-value of enrichment.

  • p.adjust: Benjamini-Hochberg adjusted p-value.

  • qvalue: False discovery rate (FDR), the estimated probability that the normalized enrichment score represents a false positive finding.

  • rank: The position in the ranked list where the maximum enrichment score occurred.

  • leading_edge: Contains tags, list, and signal. Tags provide an indication of the percentage of genes contributing to the ES. List gives an indication of where in the list the ES is obtained. Signal represents the enrichment signal strength and combines the tag and list.

  • core_enrichment: List of input proteins (Gene Symbols) annotated in a term, delimited by "/".

Author(s)

Kathleen Nevola Klev Diamanti

References

Wu, T. et al. (2021). clusterProfiler 4.0: A universal enrichment tool for interpreting omics data. The Innovation, 2(3):100141. doi: 10.1016/j.xinn.2021.100141.

Examples


if (rlang::is_installed(pkg = c("msigdbr", "clusterProfiler"))) {
  npx_df <- npx_data1 |>
    dplyr::filter(
      !grepl(
        pattern = "control",
        x = .data[["SampleID"]],
        ignore.case = TRUE
      )
    )

  check_log <- check_npx(df = npx_df)

  ttest_results <- OlinkAnalyze::olink_ttest(
    df = npx_df,
    variable = "Treatment",
    alternative = "two.sided",
    check_log = check_log
  )

  # GSEA
  gsea_results <- OlinkAnalyze::olink_pathway_enrichment(
    df = npx_df,
    test_results = ttest_results,
    check_log = check_log
  )

  # ORA
  ora_results <- OlinkAnalyze::olink_pathway_enrichment(
    df = npx_df,
    test_results = ttest_results,
    check_log = check_log,
    method = "ORA"
  )
}



OlinkAnalyze documentation built on June 24, 2026, 1:06 a.m.