| Title: | Permutation-Based Analysis associating Conserved Differentially Methylated Elements Across Multiple Generations to a Treatment Effect |
|---|---|
| Description: | Permutation analysis, based on Monte Carlo sampling, for testing the hypothesis that the number of conserved differentially methylated elements, between several generations, is associated to an effect inherited from a treatment and that stochastic effect can be dismissed. |
| Authors: | Astrid DeschĂȘnes [cre, aut] (ORCID: <https://orcid.org/0000-0001-7846-6749>), Pascal Belleau [aut] (ORCID: <https://orcid.org/0000-0002-0802-1071>), Arnaud Droit [aut] |
| Maintainer: | Astrid DeschĂȘnes <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 1.37.0 |
| Built: | 2026-05-31 06:36:37 UTC |
| Source: | https://github.com/bioc/methylInheritance |
Calculate significant level for hypo and hyper conserved elements using permutation results as well as observed results
calculateSignificantLevel(formatForGraphDataFrame)calculateSignificantLevel(formatForGraphDataFrame)
formatForGraphDataFrame |
a |
a list containing two elements:
HYPER a double, the significant level for the
hyper differentially methylated conserved elements
HYPO a double, the significant level for the
hypo differentially methylated conserved elements
Astrid Deschenes, Pascal Belleau
## Loading dataset containing all results data(methylInheritanceResults) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F2 and F3 (position = 2) info <- extractInfo(allResults = methylInheritanceResults, type = "sites", inter="i2", 2) ## Create graph methylInheritance:::calculateSignificantLevel(info)## Loading dataset containing all results data(methylInheritanceResults) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F2 and F3 (position = 2) info <- extractInfo(allResults = methylInheritanceResults, type = "sites", inter="i2", 2) ## Create graph methylInheritance:::calculateSignificantLevel(info)
methylRawList format (for demo purpose).The object is a list with 3 entries. Each entry corresponds to the
information for one generation (first entry = first generation, etc..)
stored in a methylRawList object.
There are 12 samples (6 controls and 6 cases) for each generation. Each
sample information is stored in a methylRaw object.
data(demoForTransgenerationalAnalysis)data(demoForTransgenerationalAnalysis)
A list containing three methylRawList objects. Each
methylRawList contains the information for one generation
(first entry = first generation, etc..). Each sample information is
stored in a methylRaw object. There is methylRaw objects
(6 controls and 6 cases) in each generation.
This dataset can be used to test runPermutation and
runObservation functions.
A list containing three methylRawList objects. Each
methylRawList contains the information for one generation
(first entry = first generation, etc..). Each sample information is
stored in a methylRaw object. There is methylRaw objects
(6 controls and 6 cases) in each generation.
runPermutationfor running a permutation analysis, and optionally an observation analysis, using a multi-generational dataset
runObservationfor running an observation analysis using methylKit info entry
## Loading dataset data(demoForTransgenerationalAnalysis) ## Run a permutation analysis runObservation(methylKitData = demoForTransgenerationalAnalysis, outputDir = "test_demo", type = "tiles", vSeed = 2001) ## Get results result <- loadAllRDSResults(analysisResultsDir = "test_demo", permutationResultsDir = NULL, doingSites = FALSE, doingTiles = TRUE) ## Remove result directory if (dir.exists("test_demo")) { unlink("test_demo", recursive = TRUE) }## Loading dataset data(demoForTransgenerationalAnalysis) ## Run a permutation analysis runObservation(methylKitData = demoForTransgenerationalAnalysis, outputDir = "test_demo", type = "tiles", vSeed = 2001) ## Get results result <- loadAllRDSResults(analysisResultsDir = "test_demo", permutationResultsDir = NULL, doingSites = FALSE, doingTiles = TRUE) ## Remove result directory if (dir.exists("test_demo")) { unlink("test_demo", recursive = TRUE) }
Extract the information specific to a subsection of the permutation analysis. The extracted information will be specific to one type of differential methylation analysis (tiles or sites), to one type of intersection (two consecutive generation or more) and to one specific group of generations.
extractInfo( allResults, type = c("sites", "tiles"), inter = c("i2", "iAll"), position = 1 )extractInfo( allResults, type = c("sites", "tiles"), inter = c("i2", "iAll"), position = 1 )
allResults |
a |
type |
One of the |
inter |
One of the |
position |
a positive |
a data.frame
containing the observation results (using real
data) and the permutation results (using shuffled data). Both hyper and
hypo differentially conserved methylation results are present.
Astrid Deschenes, Pascal Belleau
## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Load information from files results <- loadAllRDSResults(analysisResultsDir = filesDir, permutationResultsDir = filesDir, doingSites = TRUE, doingTiles = TRUE) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F1 and F2 (position = 1) info <- extractInfo(allResults = results, type = "sites", inter="i2", 1)## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Load information from files results <- loadAllRDSResults(analysisResultsDir = filesDir, permutationResultsDir = filesDir, doingSites = TRUE, doingTiles = TRUE) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F1 and F2 (position = 1) info <- extractInfo(allResults = results, type = "sites", inter="i2", 1)
Load all RDS files created by the permutation and
observation analysis. The function
returns an object of class "methylInheritanceAllResults" that holds
all the pertinent information.
loadAllRDSResults( analysisResultsDir, permutationResultsDir, doingSites = TRUE, doingTiles = FALSE, maxID = NA )loadAllRDSResults( analysisResultsDir, permutationResultsDir, doingSites = TRUE, doingTiles = FALSE, maxID = NA )
analysisResultsDir |
a |
permutationResultsDir |
a |
doingSites |
a |
doingTiles |
a |
maxID |
|
a list of class methylInheritanceAllResults
containing the result of the observation analysis as well as the results
of all the permutations.
Astrid Deschenes, Pascal Belleau
mergePermutationAndObservation for detail
description, in the Value section, of the
methylInheritanceAllResults object.
## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Load information from files results <- loadAllRDSResults(analysisResultsDir = filesDir, permutationResultsDir = filesDir, doingSites = TRUE, doingTiles = TRUE) ## Print the observation results results ## Access the results for the first permutation only for sites results$PERMUTATION[[1]]$SITES## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Load information from files results <- loadAllRDSResults(analysisResultsDir = filesDir, permutationResultsDir = filesDir, doingSites = TRUE, doingTiles = TRUE) ## Print the observation results results ## Access the results for the first permutation only for sites results$PERMUTATION[[1]]$SITES
Load convergence information from RDS files.
loadConvergenceData( analysisResultsDir, permutationResultsDir, type = c("sites", "tiles"), inter = c("i2", "iAll"), position, by = 100 )loadConvergenceData( analysisResultsDir, permutationResultsDir, type = c("sites", "tiles"), inter = c("i2", "iAll"), position, by = 100 )
analysisResultsDir |
a |
permutationResultsDir |
a |
type |
One of the |
inter |
One of the |
position |
a positive |
by |
a |
a graph showing the evolution of the significant level with the number of permutations
Astrid Deschenes, Pascal Belleau
## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Load convergence information results <- loadConvergenceData(analysisResultsDir = filesDir, permutationResultsDir = filesDir, type="sites", inter="i2", position=1, by=1)## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Load convergence information results <- loadConvergenceData(analysisResultsDir = filesDir, permutationResultsDir = filesDir, type="sites", inter="i2", position=1, by=1)
Merge the permutation results with the observation results.
The merging is only needed when permutation and observation have been
processed separately. The returned value is a
methylInheritanceAllResults object that can be used by
the extractInfo function.
mergePermutationAndObservation(permutationResults, observationResults)mergePermutationAndObservation(permutationResults, observationResults)
permutationResults |
a |
observationResults |
a |
a list of class methylInheritanceAllResults with
2 entries. The 2 entries are:
PERMUTATION list with a number of entries corresponding
to the number of permutations that have been processed. Each entry contains
the result of one permutation.The elements in each entry are:
SITES Only present when a sites analysis has been achieved,
a list containing:
i2 a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations; etc.
HYPO a list of integer, the number of conserved
hypo differentially methylated sites between two consecutive generations.The
first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations; etc.
iAll a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated sites between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc.The number of entries depends on the number
of generations.
HYPO a list of integer, the number of conserved
hypo differentially methylated sites between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc. The number of entries depends on the number of
generations.
TILES Only present when a tiles analysis has been achieved,
a list containing:
i2 a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated positions between two consecutive
generations. The first element represents the intersection of the
first and second generations; the second element, the intersection of
the second and third generations; etc.
HYPO a list of integer, the number of conserved
hypo differentially methylated positions between two consecutive
generations.The first element represents the intersection of the first and
second generations; the second element, the intersection of the second
and third generations; etc.
iAll a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated positions between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc. The number of entries depends on the number
of generations.
HYPO a list of integer, the number of conserved
hypo differentially methylated positions between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc.The number of entries depends on the number of
generations.
OBSERVATION a list containing
the result obtained with the observed dataset (not shuffled). The
elements are:
SITES Only present when a sites analysis has been achieved,
a list containing:
i2 a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations; etc.
HYPO a list of integer, the number of conserved
hypo differentially methylated sites between two consecutive generations.The
first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations; etc.
iAll a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated sites between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc.The number of entries depends on the number
of generations.
HYPO a list of integer, the number of conserved
hypo differentially methylated sites between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc. The number of entries depends on the number of
generations.
TILES Only present when a tiles analysis has been achieved,
a list containing:
i2 a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated positions between two consecutive
generations. The first element represents the intersection of the
first and second generations; the second element, the intersection of
the second and third generations; etc.
HYPO a list of integer, the number of conserved
hypo differentially methylated positions between two consecutive
generations.The first element represents the intersection of the first and
second generations; the second element, the intersection of the second
and third generations; etc.
iAll a list containing:
HYPER a list of integer, the number of conserved
hyper differentially methylated positions between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc. The number of entries depends on the number
of generations.
HYPO a list of integer, the number of conserved
hypo differentially methylated positions between three or more consecutive
generations. The first element represents the intersection of the first
three generations; the second element, the intersection of the first fourth
generations; etc.The number of entries depends on the number of
generations.
Astrid Deschenes, Pascal Belleau
## Create a observation result observed <- list() observed[["OBSERVATION"]] <- list() observed[["OBSERVATION"]][["SITES"]] <- list() observed[["OBSERVATION"]][["SITES"]][["i2"]] <- list(HYPER = list(11, 10), HYPO = list(13, 12)) observed[["OBSERVATION"]][["SITES"]][["iAll"]] <- list(HYPER = list(1), HYPO = list(3)) ## Create a permutation result containing only 1 permutation result ## Real perumtations results would have more entries permutated <- list() permutated[["PERMUTATION"]] <- list() permutated[["PERMUTATION"]][[1]] <- list() permutated[["PERMUTATION"]][[1]][["SITES"]] <- list() permutated[["PERMUTATION"]][[1]][["SITES"]][["i2"]] <- list(HYPER = list(11, 12), HYPO = list(8, 11)) permutated[["PERMUTATION"]][[1]][["SITES"]][["iAll"]] <- list(HYPER = list(0), HYPO = list(1)) ## Merge permutation and observation results mergePermutationAndObservation(permutationResults = permutated, observationResults = observed)## Create a observation result observed <- list() observed[["OBSERVATION"]] <- list() observed[["OBSERVATION"]][["SITES"]] <- list() observed[["OBSERVATION"]][["SITES"]][["i2"]] <- list(HYPER = list(11, 10), HYPO = list(13, 12)) observed[["OBSERVATION"]][["SITES"]][["iAll"]] <- list(HYPER = list(1), HYPO = list(3)) ## Create a permutation result containing only 1 permutation result ## Real perumtations results would have more entries permutated <- list() permutated[["PERMUTATION"]] <- list() permutated[["PERMUTATION"]][[1]] <- list() permutated[["PERMUTATION"]][[1]][["SITES"]] <- list() permutated[["PERMUTATION"]][[1]][["SITES"]][["i2"]] <- list(HYPER = list(11, 12), HYPO = list(8, 11)) permutated[["PERMUTATION"]][[1]][["SITES"]][["iAll"]] <- list(HYPER = list(0), HYPO = list(1)) ## Merge permutation and observation results mergePermutationAndObservation(permutationResults = permutated, observationResults = observed)
methylInheritanceResults class (for demo purpose).The object is a list with 2 entries: "OBSERVATION" and
"PERMUTATION".
data(methylInheritanceResults)data(methylInheritanceResults)
a list of class methylInheritanceAllResults
containing the following elements:
OBSERVATION a list containing:
SITES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated sites between the three consecutive
generations.
HYPO a list of integer with 1 entry, the number
of conserved hypo differentially methylated sites between the three
consecutive generations.
TILES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated positions between two consecutive
generations. The first element represents the intersection of the
first and second generations; the second element, the intersection of
the second and third generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated positions between two consecutive
generations.The first element represents the intersection of the first and
second generations; the second element, the intersection of the second
and third generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated positions between the three consecutive
generations.
HYPO a list of integer with 1 entry,
the number of conserved
hypo differentially methylated positions between the three consecutive
generations.
PERMUTATION a list
containing nbrPermutations entries. Each entry is
a list containing:
SITES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated sites between two consecutive generations.The
first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated sites between the three consecutive
generations.
HYPO a list of integer with 1 entry,
the number of conserved
hypo differentially methylated sites between the three consecutive
generations.
TILES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated positions between two consecutive
generations. The first element represents the intersection of the
first and second generations; the second element, the intersection of
the second and third generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated positions between two consecutive
generations.The first element represents the intersection of the first and
second generations; the second element, the intersection of the second
and third generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated positions between the three consecutive
generations.
HYPO a list of integer with 1 entry,
the number of conserved
hypo differentially methylated positions between the three consecutive
generations.
This dataset can be
used to test the extractInfo function.The extracted information can
be used to calculate the significant level or to create a graph.
a list of class methylInheritanceAllResults
containing the following elements:
OBSERVATION a list containing:
SITES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated sites between the three consecutive
generations.
HYPO a list of integer with 1 entry, the number
of conserved hypo differentially methylated sites between the three
consecutive generations.
TILES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated positions between two consecutive
generations. The first element represents the intersection of the
first and second generations; the second element, the intersection of
the second and third generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated positions between two consecutive
generations.The first element represents the intersection of the first and
second generations; the second element, the intersection of the second
and third generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated positions between the three consecutive
generations.
HYPO a list of integer with 1 entry,
the number of conserved
hypo differentially methylated positions between the three consecutive
generations.
PERMUTATION a list
containing a number of entries corresponding to the number of permutations
that have been produced. Each entry is
a list containing:
SITES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated sites between two consecutive generations.
The first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated sites between two consecutive generations.The
first element represents the intersection of the first and second
generations; the second element, the intersection of the second and third
generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated sites between the three consecutive
generations.
HYPO a list of integer with 1 entry,
the number of conserved
hypo differentially methylated sites between the three consecutive
generations.
TILES a list containing:
i2 a list containing:
HYPER a list of integer with 2 entries,
the number of conserved
hyper differentially methylated positions between two consecutive
generations. The first element represents the intersection of the
first and second generations; the second element, the intersection of
the second and third generations.
HYPO a list of integer with 2 entries,
the number of conserved
hypo differentially methylated positions between two consecutive
generations.The first element represents the intersection of the first and
second generations; the second element, the intersection of the second
and third generations.
iAll a list containing:
HYPER a list of integer with 1 entry,
the number of conserved
hyper differentially methylated positions between the three consecutive
generations.
HYPO a list of integer with 1 entry,
the number of conserved
hypo differentially methylated positions between the three consecutive
generations.
extractInfofor extracting the information specific to a subsection of the permutation analysis
## Loading dataset containing all results data(methylInheritanceResults) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F1 and F2 (position = 1) extractInfo(allResults = methylInheritanceResults, type = "sites", inter="i2", 1)## Loading dataset containing all results data(methylInheritanceResults) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F1 and F2 (position = 1) extractInfo(allResults = methylInheritanceResults, type = "sites", inter="i2", 1)
Generate a graph showing the convergence for a permutation analysis using observed and permuted results.
plotConvergenceGraph(dataFrameConvergence)plotConvergenceGraph(dataFrameConvergence)
dataFrameConvergence |
a |
a ggplot object.
Astrid Deschenes, Pascal Belleau
## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Extract convergenc information for F1 and F2 and F3 data <- loadConvergenceData(analysisResultsDir = filesDir, permutationResultsDir = filesDir, type = "sites", inter = "iAll", position = 1, by = 1) ## Create convergence graph plotConvergenceGraph(data)## Get the name of the directory where files are stored filesDir <- system.file("extdata", "TEST", package="methylInheritance") ## Extract convergenc information for F1 and F2 and F3 data <- loadConvergenceData(analysisResultsDir = filesDir, permutationResultsDir = filesDir, type = "sites", inter = "iAll", position = 1, by = 1) ## Create convergence graph plotConvergenceGraph(data)
Generate a graph for a permutation analysis using observed and shuffled results.
plotGraph(formatForGraphDataFrame)plotGraph(formatForGraphDataFrame)
formatForGraphDataFrame |
a |
a graph showing the permutation analysis results
Astrid Deschenes, Pascal Belleau
## Loading dataset containing all results data(methylInheritanceResults) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F2 and F3 (position = 2) info <- extractInfo(allResults = methylInheritanceResults, type = "sites", inter="i2", 2) ## Create graph plotGraph(info)## Loading dataset containing all results data(methylInheritanceResults) ## Extract information for the intersection between conserved differentially ## methylated sites (type = sites) between the intersection of 2 ## generations (inter = i2): F2 and F3 (position = 2) info <- extractInfo(allResults = methylInheritanceResults, type = "sites", inter="i2", 2) ## Create graph plotGraph(info)
methylInheritanceAllResults objectPrint a methylInheritanceAllResults object
## S3 method for class 'methylInheritanceAllResults' print(x, ...)## S3 method for class 'methylInheritanceAllResults' print(x, ...)
x |
the output object from |
... |
arguments passed to or from other methods |
an object of class
methylInheritanceAllResults
## Load dataset data("methylInheritanceResults") ## Print dataset print(methylInheritanceResults)## Load dataset data("methylInheritanceResults") ## Print dataset print(methylInheritanceResults)
Run a differential methylation analysis on each generation present in a dataset. The number of conserved differentially methylated elements (sites, tile or both) between generations is them calculated. The methylKit package is used to identify the differentially methylated elements.
The multi-generational dataset or the name of the RDS file that contains the dataset can be used as input.
The results can also be saved in RDS file (optional).
runObservation( methylKitData, type = c("both", "sites", "tiles"), outputDir = "output", nbrCoresDiffMeth = 1, minReads = 10, minMethDiff = 10, qvalue = 0.01, maxPercReads = 99.9, destrand = FALSE, minCovBasesForTiles = 0, tileSize = 1000, stepSize = 1000, vSeed = -1, restartCalculation = FALSE, saveInfoByGeneration = FALSE )runObservation( methylKitData, type = c("both", "sites", "tiles"), outputDir = "output", nbrCoresDiffMeth = 1, minReads = 10, minMethDiff = 10, qvalue = 0.01, maxPercReads = 99.9, destrand = FALSE, minCovBasesForTiles = 0, tileSize = 1000, stepSize = 1000, vSeed = -1, restartCalculation = FALSE, saveInfoByGeneration = FALSE )
methylKitData |
a |
type |
One of the "sites","tiles" or "both" strings. Specifies the type of differentially methylated elements should be returned. For retrieving differentially methylated bases type="sites"; for differentially methylated regions type="tiles". Default: "both". |
outputDir |
a string, the name of the directory that will contain
the results of the analysis. If the directory does not
exist, it will be created. Default: |
nbrCoresDiffMeth |
a positive |
minReads |
a positive |
minMethDiff |
a positive |
qvalue |
a positive |
maxPercReads |
a |
destrand |
a |
minCovBasesForTiles |
a non-negative |
tileSize |
a positive |
stepSize |
a positive |
vSeed |
a |
restartCalculation |
a |
saveInfoByGeneration |
a |
0.
Astrid Deschenes, Pascal Belleau
mergePermutationAndObservation for detail
description, in the Value section, of the OBSERVATION section of the
methylInheritanceAllResults object.
## Load methylation information data(samplesForTransgenerationalAnalysis) ## Run an observation analysis runObservation(methylKitData = samplesForTransgenerationalAnalysis, outputDir = "test", type = "sites", vSeed = 221) ## Load the results results <- loadAllRDSResults(analysisResultsDir = "test", permutationResultsDir = NULL, doingSites = TRUE, doingTiles = FALSE) ## Print the results results ## Remove directory if (dir.exists("test")) { unlink("test", recursive = TRUE, force = FALSE) }## Load methylation information data(samplesForTransgenerationalAnalysis) ## Run an observation analysis runObservation(methylKitData = samplesForTransgenerationalAnalysis, outputDir = "test", type = "sites", vSeed = 221) ## Load the results results <- loadAllRDSResults(analysisResultsDir = "test", permutationResultsDir = NULL, doingSites = TRUE, doingTiles = FALSE) ## Print the results results ## Remove directory if (dir.exists("test")) { unlink("test", recursive = TRUE, force = FALSE) }
Run a permutation analysis, based on Monte Carlo sampling, for testing the hypothesis that the number of conserved differentially methylated elements (sites, tiles or both), between several generations, is associated to an effect inherited from a treatment and that stochastic effect can be dismissed.
The multi-generational dataset or the name of the RDS file that contains the dataset can be used as input.
The observation analysis can also be run (optional). All permutation results are saved in RDS files.
runPermutation( methylKitData, type = c("both", "sites", "tiles"), outputDir = "output", runObservationAnalysis = TRUE, nbrPermutations = 1000, nbrCores = 1, nbrCoresDiffMeth = 1, minReads = 10, minMethDiff = 10, qvalue = 0.01, maxPercReads = 99.9, destrand = FALSE, minCovBasesForTiles = 0, tileSize = 1000, stepSize = 1000, vSeed = -1, restartCalculation = FALSE, saveInfoByGeneration = FALSE )runPermutation( methylKitData, type = c("both", "sites", "tiles"), outputDir = "output", runObservationAnalysis = TRUE, nbrPermutations = 1000, nbrCores = 1, nbrCoresDiffMeth = 1, minReads = 10, minMethDiff = 10, qvalue = 0.01, maxPercReads = 99.9, destrand = FALSE, minCovBasesForTiles = 0, tileSize = 1000, stepSize = 1000, vSeed = -1, restartCalculation = FALSE, saveInfoByGeneration = FALSE )
methylKitData |
a |
type |
One of the "sites","tiles" or "both" strings. Specifies the type of differentially methylated elements should be returned. For retrieving differentially methylated bases type="sites"; for differentially methylated regions type="tiles". Default: "both". |
outputDir |
a string, the name of the directory that will contain
the results of the permutation. If the directory does not
exist, it will be created. Default: |
runObservationAnalysis |
a |
nbrPermutations |
a positive |
nbrCores |
a positive |
nbrCoresDiffMeth |
a positive |
minReads |
a positive |
minMethDiff |
a positive |
qvalue |
a positive |
maxPercReads |
a |
destrand |
a |
minCovBasesForTiles |
a non-negative |
tileSize |
a positive |
stepSize |
a positive |
vSeed |
a |
restartCalculation |
a |
saveInfoByGeneration |
a |
0.
Astrid Deschenes, Pascal Belleau
mergePermutationAndObservation for detail
description, in the Value section, of the
methylInheritanceAllResults object as
well as its PERMUTATION section.
## Load methylKit information data(samplesForTransgenerationalAnalysis) ## Run a permutation analysis using the methylKit dataset ## A real analysis would require a much higher number of permutations runPermutation(methylKitData = samplesForTransgenerationalAnalysis, outputDir = "test_01", runObservationAnalysis = FALSE, type = "sites", nbrPermutations = 2, vSeed = 221) ## Get results results_01 <- loadAllRDSResults(analysisResultsDir = NULL, permutationResultsDir = "test_01", doingSites = TRUE, doingTiles = FALSE) ## Remove results directory if (dir.exists("test_01")) { unlink("test_01", recursive = TRUE, force = TRUE) } ## Path to a methylKit RDS file methylFile <- system.file("extdata", "methylObj_001.RDS", package = "methylInheritance") ## Run a permutation analysis using RDS file name ## A real analysis would require a much higher number of permutations runPermutation(methylKitData = methylFile, type = "tiles", outputDir = "test_02", nbrPermutations = 2, minCovBasesForTiles = 10, vSeed = 2001) ## Get results results_02 <- loadAllRDSResults(analysisResultsDir = NULL, permutationResultsDir = "test_02", doingSites = FALSE, doingTiles = TRUE) ## Remove results directory if (dir.exists("test_02")) { unlink("test_02", recursive = TRUE, force = TRUE) }## Load methylKit information data(samplesForTransgenerationalAnalysis) ## Run a permutation analysis using the methylKit dataset ## A real analysis would require a much higher number of permutations runPermutation(methylKitData = samplesForTransgenerationalAnalysis, outputDir = "test_01", runObservationAnalysis = FALSE, type = "sites", nbrPermutations = 2, vSeed = 221) ## Get results results_01 <- loadAllRDSResults(analysisResultsDir = NULL, permutationResultsDir = "test_01", doingSites = TRUE, doingTiles = FALSE) ## Remove results directory if (dir.exists("test_01")) { unlink("test_01", recursive = TRUE, force = TRUE) } ## Path to a methylKit RDS file methylFile <- system.file("extdata", "methylObj_001.RDS", package = "methylInheritance") ## Run a permutation analysis using RDS file name ## A real analysis would require a much higher number of permutations runPermutation(methylKitData = methylFile, type = "tiles", outputDir = "test_02", nbrPermutations = 2, minCovBasesForTiles = 10, vSeed = 2001) ## Get results results_02 <- loadAllRDSResults(analysisResultsDir = NULL, permutationResultsDir = "test_02", doingSites = FALSE, doingTiles = TRUE) ## Remove results directory if (dir.exists("test_02")) { unlink("test_02", recursive = TRUE, force = TRUE) }
methylKit, in a
methylRawList format (for demo purpose).The object is a list with 3 entries. Each entry corresponds to the
information for one generation (first entry = first generation, etc..)
stored in a methylRawList.
There are 12 samples (6 controls and 6 cases) for each generation. Each
sample information is stored in a methylRaw object.
data(samplesForTransgenerationalAnalysis)data(samplesForTransgenerationalAnalysis)
A list containing three methylRawList objects. Each
methylRawList contains the information for one generation
(first entry = first generation, etc..). Each sample information is
stored in a methylRaw object. There is methylRaw objects
(6 controls and 6 cases) in each generation.
This dataset can be
used to test the runPermutation function.
A list containing three methylRawList objects. Each
methylRawList contains the information for one generation
(first entry = first generation, etc..). Each sample information is
stored in a methylRaw object. There is methylRaw objects
(6 controls and 6 cases) in each generation.
runPermutationfor running a permutation analysis, and optionally an observation analysis, using multi-generational dataset
## Loading dataset data(samplesForTransgenerationalAnalysis) ## Run a permutation analysis runPermutation(methylKitData = samplesForTransgenerationalAnalysis, type = "tiles", nbrPermutations = 2, vSeed = 2332)## Loading dataset data(samplesForTransgenerationalAnalysis) ## Run a permutation analysis runPermutation(methylKitData = samplesForTransgenerationalAnalysis, type = "tiles", nbrPermutations = 2, vSeed = 2332)