results_heatmap: Plot heatmap of enrichment results

View source: R/results_heatmap.R

results_heatmapR Documentation

Plot heatmap of enrichment results

Description

Plot of GWAS x cell-type enrichment results from celltype_associations_pipeline.

Usage

results_heatmap(
  merged_results,
  title = NULL,
  x_lab = NULL,
  fdr_thresh = 0.05,
  facet_formula = "EnrichmentMode ~ .",
  x_var = "Celltype",
  y_var = "GWAS",
  fill_var = "-log1p(FDR)",
  scales = "free_y",
  space = "fixed",
  show_plot = TRUE,
  height = 5,
  width = 7,
  dpi = 300,
  save_path = file.path(tempdir(), "MAGMA_Celltyping.heatmap.jpg")
)

Arguments

merged_results

Enrichment results generated by celltype_associations_pipeline and merged by merge_results.

title

Plot title.

x_lab

Plot x-axis label.

fdr_thresh

FDR filtering threshold.

facet_formula

Facet formula for plot, passed to facet_grid.

x_var

x-axis variable.

y_var

y-axis variable.

fill_var

Fill variable.

scales

Are scales shared across all facets (the default, "fixed"), or do they vary across rows ("free_x"), columns ("free_y"), or both rows and columns ("free")?

space

If "fixed", the default, all panels have the same size. If "free_y" their height will be proportional to the length of the y scale; if "free_x" their width will be proportional to the length of the x scale; or if "free" both height and width will vary. This setting has no effect unless the appropriate scales also vary.

show_plot

Whether to print the plot.

height

Plot height.

width

Plot width.

dpi

Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.

save_path

Path to save plot to.

Value

ggplot object.

Examples

MAGMA_results <- MAGMA.Celltyping::enrichment_results
merged_results <- MAGMA.Celltyping::merge_results(MAGMA_results)
heat <- MAGMA.Celltyping::results_heatmap(
    merged_results = merged_results,
    fdr_thresh = 1)  

NathanSkene/MAGMA_Celltyping documentation built on Aug. 21, 2023, 8:55 a.m.