validatePrepMergeParameters: Parameters validation for the 'postMerge' function

Description Usage Arguments Value Author(s) Examples

Description

Validation of all parameters needed by the public postMerge function.

Usage

1
2
validatePrepMergeParameters(startPosForwardReads, startPosReverseReads,
  resultRJMCMC, extendingSize, chrLength)

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 position.

resultRJMCMC

an object of class "rjmcmcNucleosomes" or "rjmcmcNucleosomesMerge" that contain information about nucleosome positioning for an entire chromosome.

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.

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
13
14
15
16
17
18
## Load dataset containing forward and reverse reads
data(reads_demo)

## Load dataset containing nucleosome information
file_002 <- dir(system.file("extdata", package = "RJMCMC"),
pattern = "yeastRes_Chr1_Seg_002.rds", full.names = TRUE)
nucleosome_info <- readRDS(file_002)

## The function returns 0 when all parameters are valid
RJMCMC:::validatePrepMergeParameters(startPosForwardReads =
reads_demo$readsForward, startPosReverseReads = reads_demo$readsReverse,
resultRJMCMC = nucleosome_info, extendingSize = 74, chrLength = 10000000)

## The function raises an error when at least one paramater is not valid
## Not run: RJMCMC:::validatePrepMergeParameters(startPosForwardReads = c(72400,
72431, 72428, 72429, 72426), startPosReverseReads = c(72522, 72531, 72528,
72559, 72546), resultRJMCMC = NA, extendingSize = 74, chrLength = 10000000)
## End(Not run)

ArnaudDroitLab/RJMCMC documentation built on May 5, 2019, 7:06 a.m.