olink_pathway_visualization: Creates bargraph of top/selected enrichment terms from GSEA...

View source: R/olink_pathway_visualization.R

olink_pathway_visualizationR Documentation

Description

Pathways are ordered by increasing p-value (unadjusted)

Usage

olink_pathway_visualization(
  enrich_results,
  method = "GSEA",
  keyword = NULL,
  number_of_terms = 20L
)

Arguments

enrich_results

data frame of enrichment results from olink_pathway_enrichment

method

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

keyword

(optional) keyword to filter enrichment results on. If not specified, displays top terms.

number_of_terms

number of terms to display (default is 20).

Value

A bargraph as a ggplot object.

Examples


if (rlang::is_installed(pkg = c("msigdbr", "clusterProfiler"))) {

  # Run olink_ttest or other stats test (see documentation )
  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
  )

  # Run olink_pathway_enrichment (see documentation)

  # 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"
  )

  # Plot

  OlinkAnalyze::olink_pathway_visualization(
    enrich_results = gsea_results
  )

  OlinkAnalyze::olink_pathway_visualization(
    enrich_results = gsea_results,
    keyword = "immune"
  )

  OlinkAnalyze::olink_pathway_visualization(
    enrich_results = ora_results,
    method = "ORA",
    number_of_terms = 15L
  )
}



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