Description Usage Arguments Value Author(s) Examples
View source: R/methylInheritanceSimInternalMethods.R
Simulate a multigenerational 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.
1 2 3 4 | simInheritance(pathOut, pref, k, nbCtrl, nbCase, treatment, sample.id,
generation, stateInfo, propDiff, propDiffsd, diffValue, propInheritance,
rateDiff, minRate, propInherite, propHetero, minReads, maxPercReads, context,
assembly, meanCov, diffRes, saveGRanges, saveMethylKit, runAnalysis)
|
pathOut |
a string of |
pref |
a string of
|
k |
a positive |
nbCtrl |
a positive |
nbCase |
a positive |
treatment |
a |
sample.id |
a matrix the name of each samples for each generation (row) and each case and control (column). |
generation |
a positive |
stateInfo |
a
|
propDiff |
a |
propDiffsd |
a non-negative |
diffValue |
a non-negative |
propInheritance |
a non-negative |
rateDiff |
a positive |
minRate |
a non-negative |
propInherite |
a non-negative |
propHetero |
a non-negative |
minReads |
a positive |
maxPercReads |
a |
context |
a string of |
assembly |
a string of |
meanCov |
a positive |
diffRes |
a
when is |
saveGRanges |
a |
saveMethylKit |
a |
runAnalysis |
a
|
0
indicating that the function has been successful.
Pascal Belleau, Astrid Deschenes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Name of the directory that will contained the generated files
temp_dir <- "test_simInheritance"
## Load dataset
data(dataSimExample)
## Generate a stateDiff object with length corresponding to
## nbBlock * nbCpG from stateInformation
stateDiff <- list()
stateDiff[["stateDiff"]] <- c(1, 0, 1)
stateDiff[["stateInherite"]] <- c(1, 0, 0)
## Simulate multigenerational methylation experiment with inheritance
methInheritSim:::simInheritance(pathOut = temp_dir,
pref = "S1_6_0.9_0.8_0.5", k = 1, nbCtrl = 6, nbCase = 6,
treatment = dataSimExample$treatment,
sample.id = dataSimExample$sample.id,
generation = 3, stateInfo = dataSimExample$stateInfo[1:3],
propDiff = 0.9, propDiffsd = 0.1, diffValue = 0.8,
propInheritance = 0.5, rateDiff = 0.3, minRate = 0.3,
propInherite = 0.3, propHetero = 0.5, minReads = 10, maxPercReads = 99,
assembly="RNOR_5.0", context="Cpg", meanCov = 40, diffRes = stateDiff,
saveGRanges = FALSE, saveMethylKit = FALSE, runAnalysis = FALSE)
## Delete directory
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.