mergePermutationAndObservation {methylInheritance} | R Documentation

## Merge the permutation results with the observation results.

### Description

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.

### Usage

    mergePermutationAndObservation(permutationResults, observationResults)

### Arguments

`permutationResults` | a `list` with 1 entry called `PERMUTATION`. The `PERMUTATION` entry is a `list` with a number of entries corresponding to the number of permutations that have been processed. Each entry contains the result of one permutation.
`observationResults` | a `list` with 1 entry called `OBSERVATION`. The `OBSERVATION` entry is a `list` containing the result obtained with the observed dataset (not shuffled).

### Value

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.

### Author(s)

Astrid Deschenes, Pascal Belleau

### Examples

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

[Package methylInheritance version 1.6.1 Index]