MethylCalCalibrationOutlierPlot: MethylCal calibration outlier plots

Description Usage Arguments Value References Examples

View source: R/MethylCalCalibrationOutlierPlot.R

Description

Visualisation of MethylCal calibration of the standard control experiment.

Usage

1
2
3
MethylCalCalibrationOutlierPlot(data = data, Target = NULL,
  prior = "LG", level = 0.95, dir = NULL, printing = TRUE,
  cex_par = 1.25)

Arguments

data

Formatted input data frame obtained from the function Formatting.

Target

Name of the target DMR/CpG island/gene to be visualised.

prior

Prior distribution set-up for the random effects and the Latent Gaussian Field (Rue et al., 2009). Three different priors are implemented:

  • LG: log-Gamma prior is the default prior with a = 1 and b = 0.1 parametrization;

  • PC: Penalized Complexity prior (Simpson et al., 2017);

  • HC: Half-Cauchy prior (Wang X et al., 2018).

level

Level of the posterior predictive region.

dir

In Unix-specific OS, user-specified directory where the plots in pdf format are saved. If the directory is not specified, figures are saved in the current working directory.

printing

If printing = TRUE (default), messages are printed on the screen regarding the estimated models (mlik = marginal likelihood, DIC = Deviance Information Criteria, RSS = Residual Sum of Squares) and the correction of the apparent methylation levels (Ochoa et al., 2019).

cex_par

Number indicating the amount by which plotting text and symbols should be scaled relative to the default (cex_par = 1).

Value

This function detects the presence of outliers in the Target dataset, defined as the values outside the posterior predictive interval [l, u] with l = Q1 - 1.5 IQR and u = Q3 + 1.5 IQR with IQR = Q3 - Q1 and Q3 and Q1 the 75th and 25th percentiles. For a normal posterior distribution [l, u] = [-2.698 std, 2.698 std] with sdt the variance of the posterior predictive distribution.

Three plots are generated with black dots if outliers are detected. In the first plot, the values of the recorded apparent methylation levels at each Actual Methylation Percentage (AMP) are depicted with superimposed MethylCals' calibration curve (Ochoa et al., 2019) for each CpG (red dashed line). The second plot presents the apparent methylation levels at consecutive CpGs stratified by AMPs with superimposed the predicted values (red dashed line) as well as the (1-level)% posterior predictive region (dashed-dotted red lines). Finally, the third plot is the scatterplot of the corrected actual methylation percentage at each AMP for all CpGs within a DRM/CpG island/gene. If outliers are detected the models will be refitted after removing the outliers as well as the plots above.

In Unix-specific OS, figures are saved in the current directory, unless otherwise specified by the user, in pdf format. In Windows OS, figures are printed on the screen.

References

Ochoa E, Zuber V, Fernandez-Jimenez N, Bilbao JR, Clark GR, Maher ER and Bottolo L. MethylCal: Bayesian calibration of methylation levels. Submitted. 2019.

Wang X, Ryan YY, Faraway JJ. Bayesian Regression Modeling with INLA. 2018, 1st edition. Chapman and Hall/CRC.

Simpson S, Rue H, Riebler A, Martins TG, Sorbye SH. Penalising model component complexity: A principled, practical approach to constructing priors. Statist Sci. 2017; 1:1-28. (doi)

Rue H, Martino S, Chopin N. Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. J Roy Stat Soc B Met. 2009; 71(2):319-392. (doi)

Examples

1
2
3
4
5
6
7
8
9
data(BWS_data)
AMP = c(0, 25, 50, 75, 100)
data = Formatting(BWS_data, AMP = AMP)
MethylCalCalibrationOutlierPlot(data, Target = "KCNQ1OT1", prior = "HC")

data(Celiac_data)
AMP = c(0, 12.5, 25, 37.5, 50, 62.5, 87.5, 100)
data = Formatting(Celiac_data, AMP = AMP)
MethylCalCalibrationOutlierPlot(data, Target = "NFKBIA", level = 0.99, printing = FALSE)

lb664/MethylCal documentation built on May 23, 2019, 4:02 a.m.