scmet_plot_ma: MA plot for differential analysis

View source: R/utils_plots.R

scmet_plot_maR Documentation

MA plot for differential analysis

Description

Function showing MA plots for differential analysis. The y-axis shows difference between measurements across two groups and the x-axis shows the average measurements across the two groups.

Usage

scmet_plot_ma(
  diff_obj,
  task = "diff_epsilon",
  x = "mu",
  xlab = NULL,
  ylab = NULL,
  title = NULL,
  nfeatures = NULL
)

Arguments

diff_obj

The differential scMET object after calling the scmet_differential function.

task

The differential test to plot. For differential mean methylation: diff_mu that plots the LOR(mu_A, mu_B) on y-axis. For differential variability: either (1) diff_epsilon that plots the change (epsilon_A - epsilon_B), or (2) diff_gamma that plots the LOR(gamma_A, gamma_B) on y-axis.

x

The average parameter across the two populations to plot on the x-axis. Can be either mu, epsilon or gamma. When task = epsilon, x can be either mu or epsilon. When task = gamma, x can be either mu or gamma. When task = mu, x can be only mu.

xlab

Optional x-axis label.

ylab

Optional y-axis label.

title

Optional title, default NULL.

nfeatures

Optional parameter, denoting a subset of number of features to plot (only for non-differential features). Mostly to reduce over-plotting.

Value

A ggplot2 object.

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

See Also

scmet, scmet_differential, scmet_hvf_lvf, scmet_plot_mean_var, scmet_plot_vf_tail_prob, scmet_plot_efdr_efnr_grid, scmet_plot_volcano

Examples

## Not run: 
# Fit scMET for each group
fit_A <- scmet(Y = scmet_diff_dt$scmet_dt_A$Y,
X = scmet_diff_dt$scmet_dt_A$X, L = 4, iter = 100, seed = 12)
fit_B <- scmet(Y = scmet_diff_dt$scmet_dt_B$Y,
X = scmet_diff_dt$scmet_dt_B$X, L = 4, iter = 100, seed = 12)

# Run differential test
diff_obj <- scmet_differential(obj_A = fit_A, obj_B = fit_B)
# Create volcano plot
scmet_plot_ma(diff_obj, task = "diff_epsilon")

## End(Not run)


andreaskapou/scMET documentation built on Feb. 1, 2024, 10:46 a.m.