scmet_plot_estimated_vs_true | R Documentation |
Function for plotting true on x-axis and inferred parameter estimates on y-axis (either mean methylation or overdispersion). Along with posterior medians, the 80 high posterior density is shown as error bars. Wehn MLE estimates are provided, a plot showing the shrinkage introduced by scMET is shown as arrows.
scmet_plot_estimated_vs_true(
obj,
sim_dt,
param = "mu",
mle_fit = NULL,
diff_feat_idx = NULL,
hpd_thresh = 0.8,
title = NULL,
nfeatures = NULL
)
obj |
The scMET object after calling the |
sim_dt |
The simulated data object. E.g. after calling the
|
param |
The parameter to plot posterior estimates, either "mu" or "gamma". |
mle_fit |
A three column matrix of beta-binomial maximum likelihood estimates. First column feature name, second column mean methylation and third column overdispersion estimates. Number of features should match the ones used by scMET. |
diff_feat_idx |
Vector with locations of features that were simulated to
be differentially variable or methylated. This is stored in the object
after calling the |
hpd_thresh |
The high posterior density threshold, as computed by the
|
title |
Optional title, default NULL. |
nfeatures |
Optional parameter, denoting a subset of number of features to plot. Mostly to reduce over-plotting. |
A ggplot2 object.
C.A.Kapourani C.A.Kapourani@ed.ac.uk
scmet
, scmet_simulate_diff
,
scmet_simulate
, scmet_plot_mean_var
,
scmet_plot_vf_tail_prob
,
scmet_plot_efdr_efnr_grid
, scmet_plot_volcano
,
scmet_plot_ma
# Fit scMET
obj <- scmet(Y = scmet_dt$Y, X = scmet_dt$X, L = 4, iter = 100)
scmet_plot_estimated_vs_true(obj = obj, sim_dt = scmet_dt, param = "mu")
# BB MLE fit to compare with scMET
mle_fit <- scmet_dt$Y[, bb_mle(cbind(total_reads, met_reads))
[c("mu", "gamma")], by = c("Feature")]
scmet_plot_estimated_vs_true(obj = obj, sim_dt = scmet_dt, param = "mu",
mle_fit = mle_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.