scmet_plot_mean_var: Plotting mean-variability relationship

View source: R/utils_plots.R

scmet_plot_mean_varR Documentation

Plotting mean-variability relationship

Description

Function for plotting mean methylation on x-axis and variability on y-axis (either overdispersion or residual overdispersion). If HVF/LVF analysis is performed, points will be also coloured accordingly.

Usage

scmet_plot_mean_var(
  obj,
  y = "gamma",
  task = NULL,
  show_fit = TRUE,
  title = NULL,
  nfeatures = NULL,
  n = 80
)

Arguments

obj

The scMET object after calling the scmet_hvf_lvf function.

y

The parameter to plot on the y-axis. Values can be gamma (default) or epsilon.

task

If NULL (default) the mean-variability relationship is plotted. If set to "hvf" or "lvf", points are coloured according the HVF/LVF analysis task.

show_fit

Logical, whether to show the fitted mean-overdispersion trend. Applicable only when y = gamma and task = NULL.

title

Optional title, default NULL.

nfeatures

Optional parameter, denoting a subset of number of features to plot. Mostly to reduce over-plotting. When ⁠task = hvf or lvf⁠, the subsampling is performed on the features that are not called as HVF or LVF (i.e. not interesting features).

n

Optional integer denoting the number of grid points to colour them by density. Used by kde2d function. Used only when task = NULL.

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_vf_tail_prob, scmet_plot_efdr_efnr_grid, scmet_plot_volcano, scmet_plot_ma

Examples

# Fit scMET
obj <- scmet(Y = scmet_dt$Y, X = scmet_dt$X, L = 4, iter = 100)
scmet_plot_mean_var(obj = obj, y = "gamma")


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