Description Usage Arguments Value Author(s) Examples
View source: R/methylInheritanceSimInternalMethods.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.
1 2 3 | simEachGeneration(simulation, nbCtrl, nbCase, treatment, sample.id, generation,
stateInfo, minReads, maxPercReads, context, assembly, meanCov, saveGRanges,
saveMethylKit, runAnalysis)
|
nbCtrl |
a positive |
nbCase |
a positive |
treatment |
a numeric vector denoting controls and cases |
sample.id |
a matrix the name of each samples for each generation (row) and each case and control (column). |
generation |
a positive |
stateInfo |
a
|
minReads |
a positive |
maxPercReads |
a |
context |
a string of |
assembly |
a string of |
meanCov |
a positive |
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 | ## Load dataset
data("samplesForChrSynthetic")
data("dataSimExample")
## Generate a stateInfo object using samples
stateInformation <- methInheritSim:::getSyntheticChr(methInfo =
samplesForChrSynthetic, nbBlock = 1, nbCpG = 3)
## Generate a stateDiff and stateInherite objects with length corresponding
## to nbBlock * nbCpG from stateInformation
stateDiff <- c(1, 0, 1)
stateInherite <- c(1, 0, 0)
## Create simulation
sim <- methInheritSim:::getSim(nbCtrl = 3, nbCase = 2,
generation = 3, stateInfo = stateInformation, stateDiff = stateDiff,
stateInherite = stateInherite, diffValue = 10,
propDiff = 0.8, propDiffsd = 0.2, propInheritance = 0.8,
propHetero = 0.1)
## TODO
methInheritSim:::simEachGeneration(simulation = sim,
nbCtrl = 3, nbCase = 2, treatment = c(0,0,0,1,1),
sample.id = dataSimExample$sample.id,
generation = 3, stateInfo = stateInformation, minReads = 10,
maxPercReads = 99, context = "Cpg", assembly = "RNOR_5.0", meanCov = 80,
saveGRanges = FALSE, saveMethylKit = FALSE, runAnalysis = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.