# generate simulated data set from conditional normal distribution
set.seed(1234567)
es.sim = genSimData.BayesNormal(nCpGs = 100,
nCases = 20, nControls = 20,
mu.n = -2, mu.c = 2,
d0 = 20, s02 = 0.64, s02.c = 1.5, testPara = "var",
outlierFlag = FALSE,
eps = 1.0e-3, applier = lapply)
print(es.sim)
es.sim$Batch_Run_Date = 1:ncol(es.sim)
es.sim$Chip_Barcode = 1:ncol(es.sim)
es.sim$Chip_Address = 1:ncol(es.sim)
# draw heatmap for the first 5 subjects
png(file="r2plot.png")
R2PlotFunc(
es = es.sim[, 1:5],
hybName = "memSubj",
arrayType = c("all", "replicates", "GC"),
GCid = c("128115", "Hela", "Brain"),
probs = seq(0, 1, 0.25),
col = gplots::greenred(75),
labelVariable = "subjID",
outFileName = "test_R2_raw.pdf",
title = "Raw Data R^2 Plot",
requireLog2 = FALSE,
plotOutPutFlag = FALSE,
las = 2,
keysize = 1,
margins = c(10, 10),
sortFlag = TRUE,
varSort=c("Batch_Run_Date", "Chip_Barcode", "Chip_Address"),
timeFormat=c("%m/%d/%Y", NA, NA))
dev.off()
Run the code above in your browser using DataLab