| Title: | Simulating Whole-Genome Inherited Bisulphite Sequencing Data |
|---|---|
| Description: | Simulate a multigeneration methylation case versus control experiment with inheritance relation using a real control dataset. |
| Authors: | Pascal Belleau, Astrid DeschĂȘnes and Arnaud Droit |
| Maintainer: | Pascal Belleau <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 1.35.0 |
| Built: | 2026-05-30 07:36:55 UTC |
| Source: | https://github.com/bioc/methInheritSim |
This package generates simulations of multigeneration of bisulfite data using a real control dataset.
Pascal Belleau, Astrid DeschĂȘnes and Arnaud Droit
Maintainer: Pascal Belleau <[email protected]>
runSim for simulating a multigeneration methylation
experiment with inheritance
list containing methylation information used by some internal
functions (for demo purpose.A list containing methylation information used by some internal
functions (for demo purpose.
data(dataSimExample)data(dataSimExample)
a list containing:
stateInfo a GRanges, a synthetic chromosome as
generated by getSyntheticChr function.
stateDiff a list containing:
stateDiff a vector of integer (0
and 1) with length corresponding the length of stateInfo.
The vector
indicates, using 1, the positions where the CpG sites are
differentially methylated.
stateInherite a vector of integer (0 and
1) with length corresponding the length of stateInfo. The
vector
indicates, using 1, the positions where the CpG values are
inherited.
treatment a vector of integer (0
and 1) with length corresponding the number of samples. The
vector indicates which samples are control (0) which samples are
case (1).
sample.id a list of 3 list. Each entry of the
list correspond to one generation (first entry = first generation,
etc..). Each
list contains a list of 12 entries each containing a string
of character, the name of the sample.
a list containing:
stateInfo a GRanges, a synthetic chromosome as
generated by getSyntheticChr function.
stateDiff a list containing:
stateDiff a vector of integer (0
and 1) with length corresponding the length of stateInfo.
The vector
indicates, using 1, the positions where the CpG sites are
differentially methylated.
stateInherite a vector of integer (0 and
1)
with length corresponding the length of stateInfo. The
vector
indicates, using 1, the positions where the CpG values are
inherited.
treatment a vector of integer (0
and 1) with length corresponding the number of samples. The
vector indicates which samples are control (0) which samples are
case (1).
sample.id a list of 3 list. Each entry of the
list correspond to one generation (first entry = first generation,
etc..). Each
list contains a list of 12 entries each containing a string
of character, the name of the sample.
runSim for running a
simulation analysis using methylKit info as input
## Loading dataset data(dataSimExample) ## Identify differentially methylated sites and among those, the ones ## that are inherited methInheritSim:::getDiffMeth(stateInfo = dataSimExample$stateInfo, rateDiff = 0.2, minRate = 0.3,propInherite = 0.3)## Loading dataset data(dataSimExample) ## Identify differentially methylated sites and among those, the ones ## that are inherited methInheritSim:::getDiffMeth(stateInfo = dataSimExample$stateInfo, rateDiff = 0.2, minRate = 0.3,propInherite = 0.3)
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.
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)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.
## 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) }## 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) }
methylKit, in a
methylBase format (for demo purpose).The object is a methylBase.
There is 12 samples (6 controls and 6 cases). Each
sample information is stored in a methylRaw object.
data(samplesForChrSynthetic)data(samplesForChrSynthetic)
A methylBase object contains the information for one
generation. Each sample information is
stored in a methylRaw object. There is methylRaw objects
(6 controls and 6 cases).
This dataset can be
used to test the runSim function.
A methylBase contains the information for one generation.
Each sample information is stored in a methylRaw object.
There is methylRaw objects
(6 controls and 6 cases).
runSim for running a
simulation analysis using methylKit info as input
## Loading dataset data(samplesForChrSynthetic) ## Set the output directory where files will be created temp_dir <- "test_samplesForChrSynthetic" ## Create 4 simulated dataset (nbSimulation) ## over 3 generations (nbGenration = 3) with ## 6 cases and 6 controls (nNbsample = 6) using only one set ## of parameters (vpDiff = 0.85, vpDiffsd = 0.1, vDiff = 0.8) runSim(outputDir = temp_dir, fileID = "F1", nbSynCHR = 1, methData = samplesForChrSynthetic, nbSimulation = 4, nbBlock = 10, nbCpG = 20, nbGeneration = 3, vNbSample = c(6), vpDiff = c(0.85), vpDiffsd = c(0.1), vDiff = c(0.8), vInheritance = c(0.5), propInherite = 0.3, rateDiff = 0.3, minRate = 0.2, propHetero = 0.5, nbCores = 1, vSeed = 32) ## Delete the output directory and its content if (dir.exists(temp_dir)) { unlink(temp_dir, recursive = TRUE, force = FALSE) }## Loading dataset data(samplesForChrSynthetic) ## Set the output directory where files will be created temp_dir <- "test_samplesForChrSynthetic" ## Create 4 simulated dataset (nbSimulation) ## over 3 generations (nbGenration = 3) with ## 6 cases and 6 controls (nNbsample = 6) using only one set ## of parameters (vpDiff = 0.85, vpDiffsd = 0.1, vDiff = 0.8) runSim(outputDir = temp_dir, fileID = "F1", nbSynCHR = 1, methData = samplesForChrSynthetic, nbSimulation = 4, nbBlock = 10, nbCpG = 20, nbGeneration = 3, vNbSample = c(6), vpDiff = c(0.85), vpDiffsd = c(0.1), vDiff = c(0.8), vInheritance = c(0.5), propInherite = 0.3, rateDiff = 0.3, minRate = 0.2, propHetero = 0.5, nbCores = 1, vSeed = 32) ## Delete the output directory and its content if (dir.exists(temp_dir)) { unlink(temp_dir, recursive = TRUE, force = FALSE) }