cpg_strip_plot: cpg_strip_plot

Description Usage Arguments Value Author(s) Examples

View source: R/cpg_strip_plot.R

Description

Produces a boxplot overlayed by a stripplot of a specific CpG given a matrix of beta-values. Ensure that the Beta-matrix has the CpG number as the row names

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cpg_strip_plot(
  cpg_num,
  betas,
  factor_interest,
  title,
  enlarged = "auto",
  type = c("boxplot", "CI", "SE", "mean"),
  colors = NULL,
  legend = TRUE,
  y_lab = NULL
)

Arguments

cpg_num

CpG number (ID)

betas

Matrix of Beta with the CpG numbers as rownames

factor_interest

A vector based on which you want to stratify your plot

enlarged

Do you want an enlarged plot on the right side (TRUE or FALSE). Defaults to "auto" whereby the standard deviation will be calculated of the sample. If the sd is smaller than 0.015 the enlarged plot will be generated for visibility purposes.

type

Choose the type of plot you want: "boxplot", "SE", "CI" or simply "mean". Defaults to "boxplot".

colors

A vector containing the the colors to be utilized for the plot with the contrast of interest as names (default: uses ggplot's default coloring scheme).

legend

Boolean depicting whether a legend should be included (default: TRUE)

y_lab

A specific name for the y labels (default: "Beta")

Value

A boxplot overlayed by a stripplot of a specific CpG

Author(s)

Andrew Y.F. Li Yim

Examples

1
2
3
4
Beta <- matrix(c(0.15,0.2,0.17,0.76,0.8,0.65,0.22,0.23,0.24,0.5,0.51,0.52), nrow = 2,ncol = 6, byrow = T)
rownames(Beta) <- c("cg123456", "cg789010")
Pheno <- c(rep("pheno1", 3), rep("pheno2", 3))
cpg_strip_plot("cg123456", Beta, Pheno, type = "SE")

ND91/ndlib documentation built on Aug. 10, 2020, 11:59 a.m.