Learn R Programming

biomvRCNS (version 1.12.0)

maxGapminRun: Max-gap-min-run algorithm for 2 states segmentation

Description

A custom Max-gap-min-run implementation using physical position for gap and run length calculation.

Usage

maxGapminRun(x, xPos = NULL, xRange = NULL, cutoff = NULL, q = 0.9, high=TRUE, minrun = 5, maxgap = 2, splitLen = Inf, na.rm=TRUE)

Arguments

x
a numeric vector for the input signal
xPos
a numeric vector, same length as x, carrying positional information for each element of x
xRange
an IRanges object, same length as x, carrying range information for each element of x
cutoff
numeric value used as cut-off, optional if q is specified
q
numeric value used to derive cut-off of x, as the q quantile of x , optional if cutoff is specified
high
TRUE if the cutoff or q here is the lower bound and values greater than the threshold are considered
minrun
minimum run length for the resulting segments
maxgap
maximum genomic distance below which two adjacent qualified tiles can be joined
splitLen
numeric value, maximum length of segments, split if too long
na.rm
TRUE if NA value should be ignored

Value

a list of segment starts and ends indices
IS
the start index for each segment
IE
the end index for each segment
CUTOFF
the cutoff value used in the run
MG
the parameter value for maxgap
MR
the parameter value for minrun
SPL
the parameter value for splitLen

Details

A custom Max-gap-min-run implementation using physical position for gap and run length calculation.

See Also

biomvRhsmm biomvRseg biomvRmgmr

Examples

Run this code
	x<-rpois(50, 10)
	xpos<-rnorm(50, 300, 100)
	xpos<-xpos[order(xpos)]
	maxGapminRun(x, xpos, cutoff=9.5, maxgap=30, minrun=100)

Run the code above in your browser using DataLab