postMerge {RJMCMCNucleosomes} | R Documentation

## A internal post treatment function to merge closely positioned nucleosomes, from the same chromosome, identified by the `rjmcmc` function

### Description

A internal helper function which merges closely positioned nucleosomes to rectify the over splitting and provide a more conservative approach. Beware that each chromosome must be treated separatly.

The function uses the Bioconductor `package` `consensusSeeker` to group closely positioned nucleosomes.

### Usage

    postMerge(reads, resultRJMCMC, extendingSize, chrLength, minReads = 5,
      seqName = NULL)

### Arguments

`reads` | a `GRanges` containing all forward and reverse reads.The start positions of both reads are going to be used for the analysis. Beware that the start position of a reverse read is always higher that the end positition.
`resultRJMCMC` | an object of class 'rjmcmcNucleosomes' or 'rjmcmcNucleosomesMerge' containing informations about nucleosomes.
`extendingSize` | a positive `numeric` or a positive `integer` indicating the size of the consensus region used to group closeley positioned nucleosomes.The minimum size of the consensus region is equal to twice the value of the `extendingSize` parameter. The numeric will be treated as an integer.
`chrLength` | a positive `numeric` or a positive `integer` indicating the lenght of the current chromosome. The length of the chromosome is used to ensure that the consensus positions are all located inside the chromosome.
`minReads` | a positive `integer` or `numeric`, the minimum number of reads in a potential canditate region. Non-integer values of `minReads` will be casted to `integer` and truncated towards zero. Default: 5.

### Value

a `array` of `numeric`, the updated values of the nucleosome positions. When no nucleosome is present, `NULL` is returned.

### Author(s)

Pascal Belleau, Astrid Deschenes

### Examples

    ## Loading dataset
    data(RJMCMC_result)
    data(reads_demo_02)

    ## Results before post-treatment
    RJMCMC_result$mu

    ## Post-treatment function which merged closely positioned nucleosomes
    postResult <- RJMCMCNucleosomes:::postMerge(reads = reads_demo_02,
    resultRJMCMC = RJMCMC_result, extendingSize = 80, chrLength = 73500)

    ## Results after post-treatment
    postResult

[Package RJMCMCNucleosomes version 1.18.0 Index]