validateRJMCMCParameters {RJMCMCNucleosomes} | R Documentation

## Parameters validation for the `rjmcmc` function

### Description

Validation of all parameters needed by the public `rjmcmc` function.

### Usage

    validateRJMCMCParameters(reads, seqName, nbrIterations, kMax, lambda,
      minInterval, maxInterval, minReads, adaptIterationsToReads, vSeed)

### 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.
`seqName` | a `character` string containing the label of the chromosome, present in the `GRanges` object, that will be used. The `NULL` value is accepted when only one seqname is present in the `GRanges`; the only seqname present will be used.
`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.
`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.
`adaptIterationsToReads` | a `logical` indicating if the number of iterations must be modified in function of the number of reads.
`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.

### Value

`0` indicating that all parameters validations have been successful.

### Author(s)

Astrid Deschenes

### Examples

    reads <- GRanges(seqnames = Rle(c("chr1"), c(10)),
        ranges = IRanges(101:110, end = 111:120, names = head(letters, 10)),
        strand = Rle(strand(c("-", "+", "-", "+", "-")), c(1, 2, 2, 3, 2)))

    ## The function returns 0 when all paramaters are valid
    RJMCMCNucleosomes:::validateRJMCMCParameters(reads = reads,
    seqName = "chr1", nbrIterations = 2, kMax = 10, lambda = 1, minReads = 1,
    minInterval = 100, maxInterval = 200, adaptIterationsToReads = TRUE,
    vSeed = 100)

    ## The function raises an error when at least one paramater is not valid
    ## Not run: RJMCMCNucleosomes:::validateRJMCMCParameters(
    reads = NA, seqName = "chr1",
    nbrIterations = 2, kMax = 10, lambda = 1, minReads = 1, minInterval = 100,
    maxInterval = 200, adaptIterationsToReads = TRUE, vSeed = -1)
    ## End(Not run)

[Package RJMCMCNucleosomes version 1.16.0 Index]