Learn R Programming

biomvRCNS (version 1.12.0)

splitFarNeighbour: Split segments if long gaps exist between feature positions

Description

Split segments if long gaps exist between feature positions, due to low coverage or resolution.

Usage

splitFarNeighbour(intStart = NULL, intEnd = NULL, xPos = NULL, xRange = NULL, maxgap = Inf, minrun = 1)

Arguments

intStart
indices of start for each segment
intEnd
indices of end for each segment
xPos
position vector, the distance of neighbouring features will be counted as point to point
xRange
IRanges / GRanges object for the positions, the the distance of neighbouring features will be counted as end to start.
maxgap
maximum distance between neighbouring features
minrun
when splitting, the minimum length of the features spanning, which half will be ignored if shorter.

Value

a list object containing the start and end indices for new segments
IS
the start indices for new segments
IE
the end indices for new segments

Examples

Run this code
	set.seed(123)
	pos<-cumsum(rnbinom(20, size=10, prob=0.01))
	splitFarNeighbour(intStart=c(1, 10), intEnd=c(6, 18), xPos=pos, maxgap=1000)

Run the code above in your browser using DataLab