runObservation {methylInheritance} | R Documentation

## Run a differential methylation analysis on multi-generational dataset

### Description

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).

### Usage

    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)

### Arguments

`methylKitData` | a `list` of `methylRawList` entries or the name of the RDS file containing the list. Each `methylRawList` contains 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 calculate the conserved elements. 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 analysis. If the directory does not exist, it will be created. Default: `"output"`.
`nbrCoresDiffMeth` | a positive `integer`, the number of cores to use for parallel differential methylation calculations.The parameter is 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 package `methylKit`.
`minMethDiff` | a positive `double` between [0,100], the absolute value of methylation percentage change between cases and controls. The parameter corresponds to the `difference` parameter in the methylKit package. Default: `10`.
`qvalue` | a positive `double` between [0,1], the cutoff for qvalue of differential methylation statistics. Default: `0.01`.
`maxPercReads` | a `double` between [0,100], the percentile of read counts that is going to be used as an upper cutoff. Bases or regions having higher coverage than this percentile are discarded. The parameter is used for both CpG sites and tiles analysis. The parameter corresponds to the `hi.perc` parameter in the package `methylKit`. 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 CpG 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 package `methylKit`. 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 package `methylKit`. Only used when `doingTiles` = `TRUE`. Default: `1000`.
`vSeed` | a `integer`, a seed used when reproducible results are needed. When a value inferior or equal to zero is given, a random integer is used. Default: `-1`.
`restartCalculation` | a `logical`, when `TRUE`, only permutations that don't have a RDS result final are run. Useful to restart a permutation analysis that has been interrupted. Beware that the parameters have to be identical except for this one.
`saveInfoByGeneration` | a `logical`, when `TRUE`, the information about differentially methylated sites and tiles for each generation is saved in a RDS file. The files are saved in the directory specified by the `outputDir` parameter.

### Value

`0`.

### Author(s)

Astrid Deschenes, Pascal Belleau

### See Also

`mergePermutationAndObservation` for detail description, in the Value section, of the `OBSERVATION` section of the `methylInheritanceAllResults` object.

### Examples

    ## 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)
    }

[Package methylInheritance version 1.11.0 Index]