validateParameters: Parameters validation for the 'rjmcmc' function

Description Usage Arguments Value Author(s) Examples

View source: R/rjmcmcMethodsIntern.R

Description

Validation of all parameters needed by the public rjmcmc function.

Usage

1
2
validateParameters(startPosForwardReads, startPosReverseReads, nbrIterations,
  kMax, lambda, minInterval, maxInterval, minReads, adaptIterationsToReads)

Arguments

startPosForwardReads

a vector of positive integer, the start position of all the forward reads.

startPosReverseReads

a vector of positive integer, the positions 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.

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.

Value

0 indicating that all parameters validations have been successful.

Author(s)

Astrid Deschenes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## The function returns 0 when all paramaters are valid
RJMCMC:::validateParameters(startPosForwardReads = c(72400, 72431, 72428,
72429, 72426), startPosReverseReads = c(72520, 72523, 72521, 72533, 72511),
nbrIterations = 2, kMax = 10, lambda = 1, minReads = 1, minInterval = 100,
maxInterval = 200, adaptIterationsToReads = TRUE)

## The function raises an error when at least one paramater is not valid
## Not run: RJMCMC:::validateParameters(startPosForwardReads = c(72400, 72431,
72428, 72429, 72426), startPosReverseReads = NA,
nbrIterations = 2, kMax = 10, lambda = 1, minReads = 1, minInterval = 100,
maxInterval = 200, adaptIterationsToReads = TRUE)
## End(Not run)

ArnaudDroitLab/RJMCMC documentation built on Sept. 13, 2017, 5:48 a.m.