olink_pathway_heatmap: Creates a heatmap of proteins related to pathways using...

View source: R/olink_pathway_heatmap.R

olink_pathway_heatmapR Documentation

Description

Creates a heatmap of proteins related to pathways using enrichment results from olink_pathway_enrichment.

Usage

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

Arguments

enrich_results

data frame of enrichment results from olink_pathway_enrichment

test_results

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

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 heatmap 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_heatmap(
    enrich_results = gsea_results,
    test_results = ttest_results
  )

  OlinkAnalyze::olink_pathway_heatmap(
    enrich_results = ora_results,
    test_results = ttest_results,
    method = "ORA",
    keyword = "cell"
  )
}



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