Description Usage Arguments Value Author(s) See Also Examples
View source: R/methylInheritanceSimMethodsNew.R
Simulate a multigeneration methylation case versus control experiment with inheritance relation using a real control dataset.
The simulation can be parametrized to fit different models. The number of cases and controls, the proportion of the case affected by the treatment (penetrance), the effect of the treatment on the mean of the distribution, the proportion of sites inherited, the proportion of the differentially methylated sites from the precedent generation inherited, etc..
The function simulates a multigeneration dataset like a bisulfite sequencing experiment. The simulation includes the information about control and case for each generation. Simulation dataset are saved in multiple files created in the directory specified by the user.
1 2 3 4 5 6 7 8 | runSim(methData, nbSynCHR = 1, nbSimulation = 10, nbBlock = 100,
nbCpG = 50, nbGeneration = 3, vNbSample = c(3, 6), vpDiff = c(0.9),
vpDiffsd = c(0.1), vDiff = c(0.8), vInheritance = c(0.5),
rateDiff = 0.01, minRate = 0.01, propInherite = 0.3, propHetero = 0.5,
keepDiff = FALSE, outputDir = NULL, fileID = "s", minReads = 10,
maxPercReads = 99.9, meanCov = 80, context = "CpG",
assembly = "Rnor_5.0", saveGRanges = TRUE, saveMethylKit = TRUE,
runAnalysis = FALSE, nbCores = 1, vSeed = -1)
|
methData |
an object of class |
nbSynCHR |
a positive |
nbSimulation |
a positive |
nbBlock |
a positive |
nbCpG |
a positive |
nbGeneration |
a positive |
vNbSample |
a |
vpDiff |
a |
vpDiffsd |
a |
vDiff |
a |
vInheritance |
a |
rateDiff |
a positive |
minRate |
a non-negative |
propInherite |
a non-negative |
propHetero |
a non-negative |
keepDiff |
a |
outputDir |
a string of |
fileID |
a string of
Default: |
minReads |
a positive |
maxPercReads |
a |
meanCov |
a positive |
context |
a string of |
assembly |
a string of |
saveGRanges |
a |
saveMethylKit |
a |
runAnalysis |
a
Default: |
nbCores |
a positive |
vSeed |
a |
0
indicating that the function have been
successful.
Pascal Belleau, Astrid Deschenes
the vignette for detail description of the files created by the simulation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Load dataset containing methyl information
data(samplesForChrSynthetic)
## Set the output directory where files will be created
temp_dir <- "test_runSim"
## Create 2 simulated dataset (nbSimulation = 2)
## over 3 generations (nbGenration = 3) with
## 6 cases and 6 controls (nNbsample = 6) using only one set
## of parameters (vpDiff = 0.9, vpDiffsd = 0.1, vDiff = 0.8)
runSim(methData = samplesForChrSynthetic, nbSynCHR = 1, nbSimulation = 2,
nbGeneration = 3, nbBlock = 10, nbCpG = 20, vNbSample = c(6),
vpDiff = c(0.9), vpDiffsd = c(0.1), vDiff = c(0.8),
vInheritance = c(0.5), rateDiff = 0.3, minRate = 0.2,
propInherite = 0.3, propHetero = 0.5, outputDir = temp_dir,
fileID = "F", nbCores = 1, vSeed = 32)
## Delete the output directory and its content
if (dir.exists(temp_dir)) {
unlink(temp_dir, recursive = TRUE, force = FALSE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.