rjmcmcNucleo {RJMCMCNucleosomes} | R Documentation

## Interface for the RJMCMC nucleosome mapping method in C++

### Description

Function that calls the core of the nucleosome positioning mapping function that is implemented in C++.

### Usage

    rjmcmcNucleo(startPosForwardReads, startPosReverseReads, nbrIterations, kMax,
      lambda, minInterval, maxInterval, minReads = 5L,
      adaptIterationsToReads = TRUE, vSeed = -1)

### Arguments

`startPosForwardReads` | a `vector` of `numeric`, the start position of all the forward reads.
`startPosReverseReads` | a `vector` of `numeric`, the start position of all the reverse reads. Beware that the start position of a reverse read is always higher that the end positition.
`nbrIterations` | a positive `integer` or `numeric`, the number of iterations. Non-integer values of `nbrIterations` will be casted to `integer` and truncated towards zero.
`kMax` | a positive `integer` or `numeric`, the maximum number of nucleosomes per region. Non-integer values of `kMax` will be casted to `integer` and truncated towards zero.
`lambda` | a positive `numeric`, the theorical mean of the Poisson distribution. Default: 3.
`minInterval` | a `numeric`, the minimum distance between two nucleosomes.
`maxInterval` | a `numeric`, the maximum distance between two nucleosomes.
`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.
`adaptIterationsToReads` | a `logical` indicating if the number of iterations must be modified in function of the number of reads. Default: `TRUE`.
`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.

### Value

a `list` containing:

- k a `integer`, the number of nucleosomes.

- k_max a `integer`, the maximum number of nucleosomes obtained during the iteration process.

- it a `vector` of `integer` of length `k`, the variance of the forward reads for each nucleosome.

- nbState a `integer`, the number of changes of state.

- mu a `matrix` of `numeric` with `k_max` columns and `nbState` row containing, in each row, the `mu` values associated the the state identified by the row number.

- muHat a `matrix` of `numeric` with `k_max` columns and `k_max` rows containing, in each row, the mean `mu` values associated the number of nucleosomes detected. The row number corresponds to the number of nucleosomes detected.

- nbK a `vector` of length `k_max` containing `integer`, the number of iterations which detected a specific number of nucleosomes. The position in the vector correspond to the number of nucleosomes.

### Author(s)

Pascal Belleau, Astrid Deschenes

### Examples

    data(reads_demo_01)

    forward <- start(reads_demo_01[strand(reads_demo_01) == "+"])
    reverse <- end(reads_demo_01[strand(reads_demo_01) == "-"])

    ## Run nucleosome positioning
    result <- RJMCMCNucleosomes:::rjmcmcNucleo(
                startPosForwardReads = forward,
                startPosReverseReads = reverse,
                nbrIterations = 1000, lambda = 2, kMax = 30,
                minInterval = 146, maxInterval = 292, minReads = 5,
                adaptIterationsToReads = TRUE, vSeed = -1)

    ## Print the final estimation of the number of nucleosomes
    result$k

    ## Print the position of nucleosomes
    result$mu

[Package RJMCMCNucleosomes version 1.16.0 Index]