Learn R Programming

rplec (version 0.1.3)

qc: Perform quality control

Description

This function evaluates the precision of DNA-methylation-based (DNAm) gestational age (GA) based on calibration, root mean square error (RMSE), mean absolute error (MAE), and Pearson's correlation coefficient (r). The sample identifiers (IDs) are automatically matched among the DNAm-GA, GA, and phenotype (optional). Only GA from 5 to 44 weeks' gestation are shown in the calibration plot.

Usage

qc(dnam_ga, ga, phenotype = NULL)

Value

A ggplot object of calibration plot with RMSE, MAE, and r.

Arguments

dnam_ga

A data frame of DNA-methylation-based GA. This data frame must be the output of plec function. The rows must be named according to the sample IDs.

ga

A data frame of GA. There is only one column, i.e., GA, as shown in ga. Use data(ga) to load this data frame. The rows must be named according to the sample IDs.

phenotype

A data frame of phenotype (optional). There is only one column, i.e., phenotype, as shown in phenotype. Use data(phenotype) to load this data frame. The rows must be named according to the sample IDs.

Examples

Run this code

# \donttest{
  beta_values_case <- download_beta_values_case()
  norm_beta_values_case <- bmiq_norm_450k(beta_values_case)
  dnam_ga_case <- plec(norm_beta_values_case)
  
  data(ga)
  ga_case <- ga[phenotype$phenotype == "Case", , drop = FALSE]
  set.seed(1)
  qc(dnam_ga_case, ga_case)
# }

Run the code above in your browser using DataLab