R/results_barplot.R
results_barplot.Rd
Plot of cell-type enrichment results from celltype_associations_pipeline.
results_barplot(
merged_results,
title = NULL,
y_lab = NULL,
x_lab = "-log10(p-value)",
fdr_thresh = 0.05,
y_var = "Celltype",
x_var = "-log10p",
fill_var = "EnrichmentMode",
fill_cols = c("#60A9BD", "#3A62A0"),
horz_line_p = 0.01,
sort_celltypes_by = "Top 10%",
show_plot = TRUE,
height = 5,
width = 7,
dpi = 300,
save_path = file.path(tempdir(), "MAGMA_Celltyping.barplot.jpg")
)
Enrichment results generated by celltype_associations_pipeline and merged by merge_results.
Plot title.
Plot y-axis label.
Plot x-axis label.
FDR filtering threshold.
y-axis variable.
x-axis variable.
Fill variable.
The two colours to use for the fill param (Vector).
add dashed line for a p-value cut-off - default of 0.01
Sort the order of the cell types in the plot by the enrichment results. Choose to sort by Top 10% or Linear results or set to NULL to avoid sorting. Default is Top 10%.
Whether to print the plot.
Plot height.
Plot width.
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.
Path to save plot to.
ggplot object.
MAGMA_results <- MAGMA.Celltyping::enrichment_results
merged_results <- MAGMA.Celltyping::merge_results(MAGMA_results)
#> Saving full merged results to ==> /tmp/RtmpM4LzbN/MAGMA_celltyping./.lvl1.csv
bar <- MAGMA.Celltyping::results_barplot(
merged_results = merged_results,
fdr_thresh = 1)
#> 14 results @ FDR < 1