runOnePermutationOnAllGenerations {methylInheritance} | R Documentation

## Run the analysis on one permutation dataset, including all generations, using `methylKit` package

### Description

Run CpG site or region analysis using the `methylKit` package for each generation present in the dataset. The intersection of conserved elements is obtained for each group of two consecutive generations, as well as, for larger group subset. The output of the analysis is saved in a RDS file when an directory is specified.

### Usage

    runOnePermutationOnAllGenerations(id, methylInfoForAllGenerations,
      type = c("both", "sites", "tiles"), outputDir = NULL,
      nbrCoresDiffMeth = 1, minReads = 10, minMethDiff = 10,
      qvalue = 0.01, maxPercReads = 99.9, destrand = FALSE,
      minCovBasesForTiles = 0, tileSize = 1000, stepSize = 1000,
      restartCalculation, saveInfoByGeneration)

### Arguments

`id` | an `integer`, the unique identification of the permutation. When `id` is `0`, the analysis is done on the real dataset.
`methylInfoForAllGenerations` | a `list` of `methylRawList` entries. Each `methylRawList` entry must contain all the `methylRaw` entries related to one generation (first entry = first generation, second entry = second generation, etc..). The number of generations must correspond to the number of entries in the `methylKitData`. At least 2 generations must be present to make a permutation analysis. More information can be found in the methylKit package.
`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.
`nbrCoresDiffMeth` | a positive integer, the number of cores to use for parallel differential methylation calculations.Parameter used for both sites and tiles analysis. The parameter corresponds to the `num.cores` parameter in the package `methylKit`. Default: `1` and always `1` for Windows.
`minReads` | a positive `integer` Bases and regions having lower coverage than this count are discarded. The parameter correspond to the `lo.count` parameter in the `methylKit` package.
`minMethDiff` | a positive integer betwwen [0,100], the absolute value of methylation percentage change between cases and controls. The parameter correspond to the `difference` parameter in the package `methylKit`. Default: `10`.
`qvalue` | a positive `double` inferior to `1`, the cutoff for qvalue of differential methylation statistic. Default: `0.01`.
`maxPercReads` | a double between [0-100], the percentile of read counts that is going to be used as upper cutoff. Bases ore regions having higher coverage than this percentile are discarded. Parameter used for both CpG sites and tiles analysis. The parameter correspond to the `hi.perc` parameter in the `methylKit` package. Default: `99.9`.
`destrand` | a logical, when `TRUE` will merge reads on both strands of a CpG dinucleotide to provide better coverage. Only advised when looking at CpG methylation. Parameter used for both sites and tiles analysis. Default: `FALSE`.
`minCovBasesForTiles` | a non-negative integer, the minimum number of bases to be covered in a given tiling window. The parameter corresponds to the `cov.bases` parameter in the package `methylKit`. Only used when `doingTiles` = `TRUE`. Default: `0`.
`tileSize` | a positive integer, the size of the tiling window. The parameter corresponds to the `win.size` parameter in the `methylKit` package. Only used when `doingTiles` = `TRUE`. Default: `1000`.
`stepSize` | a positive integer, the step size of tiling windows. The parameter corresponds to the `stepSize` parameter in the `methylKit` package. Only used when `doingTiles` = `TRUE`. Default: `1000`.
`restartCalculation` | a `logical`, when `TRUE`, only permutations that don't have a RDS result final are run.
`saveInfoByGeneration` | a `logical`, when `TRUE`, the information about differentially methylated sites and tiles for each generation is saved in a RDS file. The information is saved in a different file for each permutation. The files are = saved in the `outputDir`.

### Value

a `list` containing the following elements:

- `SITES` Only present when `type` = `"sites"` or `"both"`, 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 of 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 of the number of generations.

- `TILES` Only present when `type` = `"tiles"` or `"both"`, a `list` containing: itemize

  `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 of 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 of the number of generations.

### Author(s)

Astrid Deschenes, Pascal Belleau

### Examples

    ## Load methyl information
    data(samplesForTransgenerationalAnalysis)

    ## Run a permutation analysis
    methylInheritance:::runOnePermutationOnAllGenerations(id = 2,
        methylInfoForAllGenerations = samplesForTransgenerationalAnalysis,
        type = "tiles", outputDir = NULL,
        nbrCoresDiffMeth = 1, minReads = 10, minMethDiff = 10, qvalue = 0.01,
        maxPercReads = 99.9, destrand = FALSE, minCovBasesForTiles = 0,
        tileSize = 1000, stepSize = 1000, restartCalculation = FALSE)

[Package methylInheritance version 1.11.0 Index]