saveInterGenerationResults: Save the result of on CpG site or tile analysis on all...

Description Usage Arguments Value Author(s) Examples

View source: R/methylInheritanceInternalMethods.R

Description

Save the result of on CpG site or tile analysis on all generations. The results are saved in a RDS file. The anaysis can have been done on the observed or shuffled dataset. Each permutation is saved using its identifiant in the file name.

Usage

1
2
3
4
5
6
saveInterGenerationResults(
  outputDir,
  permutationID,
  type = c("sites", "tiles"),
  interGenerationResult
)

Arguments

outputDir

a string of character, the name of the directory that will contain the results of the permutation. The name should end with a slash. The directory should already exists.

permutationID

an integer, the identifiant of the permutation. When the permutationID = 0, the results are considered as the observed results and are saved in a file with the "_observed_results.RDS" extension. When the permutationID != 0, the results are considered as permutation results and are saved in a file with the "_permutation_permutationID.RDS" extension.

type

One of the "sites" or "tiles" strings. Specifies the type of differentially methylated elements should be saved. Default: "sites".

interGenerationResult

a list that corresponds to the output of the interGeneration function, the result of on CpG site or tile analysis on all generations.

Value

0 indicating that all parameters validations have been successful.

Author(s)

Astrid Deschenes, Pascal Belleau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Load permutation results on sites

permutationResultsFile <- system.file("extdata",
    "permutationResultsForSites.RDS", package="methylInheritance")
permutationResults <- readRDS(permutationResultsFile)

## Transform result to GRanges
resultsGR <- methylInheritance:::getGRangesFromMethylDiff(methDiff =
    permutationResults, pDiff = 10, qvalue = 0.01, type = "hyper")

## Extract inter-generationally conserved sites
interGenerationResult <- methylInheritance:::interGeneration(resultsGR)

## Create directories
dir.create("TEST", showWarnings = TRUE)
dir.create("TEST/SITES", showWarnings = TRUE)

## Save results
methylInheritance:::saveInterGenerationResults(
    outputDir = "TEST/", permutationID=100, type = "sites",
    interGenerationResult = interGenerationResult)

adeschen/methylInheritance documentation built on April 21, 2021, 9:45 a.m.