validateSegmentationParameters: Parameters validation for the 'segmentation' function

Description Usage Arguments Value Author(s) Examples

View source: R/rjmcmcMethodsIntern.R

Description

Validation of all parameters needed by the public segmentation function.

Usage

1
validateSegmentationParameters(reads, zeta = 147, delta, maxLength)

Arguments

reads

a GRanges, the reads that need to be segmented.

zeta

a positive integer or numeric, the length of the nucleosomes. Default: 147.

delta

a positive integer or numeric, the accepted range of overlapping section between segments. The overlapping section being zeta + delta.

maxLength

a positive integer or numeric, the length of each segment.

Value

0 indicating that all parameters validations have been successful.

Author(s)

Astrid Deschenes, Pascal Belleau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Load synthetic dataset of reads
data(syntheticNucleosomeReads)

## Use dataset of reads to create GRanges object
sampleGRanges <- GRanges(seqnames = syntheticNucleosomeReads$dataIP$chr,
ranges = IRanges(start = syntheticNucleosomeReads$dataIP$start,
end = syntheticNucleosomeReads$dataIP$end),
strand = syntheticNucleosomeReads$dataIP$strand)

## The function returns 0 when all parameters are valid
RJMCMCNucleosomes:::validateSegmentationParameters(reads = sampleGRanges,
zeta = 147, delta = 30, maxLength = 12000)

## The function raises an error when at least one paramater is not valid
#\dontrun{RJMCMCNucleosomes:::validateSegmentationParameters(
#reads = c(100), zeta = 147, delta = 30, maxLength = 12000)}

#\dontrun{RJMCMCNucleosomes:::validateSegmentationParameters(
#reads = sampleGRanges, zeta = "hi", delta = 30, maxLength = 12000)}

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