splitFarNeighbour: Split segments if long gaps exist between feature positions

Description Usage Arguments Value Author(s) Examples

View source: R/misc.R

Description

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

Usage

1
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

Author(s)

Yang Du

Examples

1
2
3
	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)

biomvRCNS documentation built on Nov. 8, 2020, 6:49 p.m.