plot_density: Density ridges for two sets

View source: R/utils_plotting.R

plot_densityR Documentation

Density ridges for two sets

Description

Compare densities between each batch both before and after correction. Thanks to GitHub user asongggg for suggesting storing markers on separate pages and for suggesting an approach.

Usage

plot_density(
  uncorrected,
  corrected,
  markers = NULL,
  directory = NULL,
  filename = NULL,
  y = "batch",
  dataset_names = NULL,
  xlims = c(-1, 10),
  ncol = 6,
  format = 1,
  markers_per_page = NULL,
  return_format = c("cowplot", "raw", "pdf")
)

Arguments

uncorrected

tibble with uncorrected data

corrected

tibble with corrected data

markers

Character vector with the markers to plot

directory

Folder to store figures in.

filename

Output figure filename. If NULL plots are returned

y

The column to stack densities with. Default: "batch". If set to "Type", the dataset_names will be used to stack densities.

dataset_names

Change the names of the datasets from Uncorrected and Corrected to something else. Format: c("Uncorrected", "Corrected")

xlims

The limits of the x axis as a vector

ncol

Number of density plots in a single row of plots. Default: 6

format

Plotting format (1 = 1 row per batch, 2 = all batches in same row.)

markers_per_page

Store figures on individual pages, with the number of markers as specified. Default: NULL.

return_format

Allows returning the raw plots for manual adjustments. This argument is mainly used when plots are not stored in files.

See Also

Other plot: plot_dimred(), plot_dimred_full(), plot_save_four(), plot_save_two(), plot_umap_labels()

Examples

## Not run: 
plot_density(uncorrected, corrected, y = 'batch', filename = 'my/dir/batchcor_plot.pdf')
plot_density(imputed1, imputed2, y = 'Type', dataset_names = paste('Panel', 1:2),
             filename = 'my/dir/merging_plot.pdf')

## End(Not run)

biosurf/cyCombine documentation built on May 23, 2024, 4:07 a.m.