containment.indicator: Idenfication oflower threshold segments to retain

View source: R/containment.indicator.R

containment.indicatorR Documentation

Idenfication oflower threshold segments to retain

Description

This function idenfies the segments for the lower threshold that also contain at least one segment that respect the upper threshold.

Usage

containment.indicator(vstart, vend, wstart, wend)

Arguments

vstart

a vector of numeric representing the left boundary positions of segments that respect the upper threshold limit.

vend

a vector of numeric representing the right boundary positions of segments that respect the upper threshold limit.

wstart

a vector of numeric representing the left boundary positions of segments that respect the lower threshold limit.

wend

a vector of numeric representing the right boundary positions of segments that respect the lower threshold limit.

Details

Segments to retain correspond to rows where the endbeforeend value is equal or larger than the startafterstart value.

Value

a matrix with a number of rows corresponding to the length of wstart and with 2 columns:

  • startafterstart a numeric identifying the upper segment that starts after the lower segment associated to the row.

  • endbeforeend a numeric identifying the upper segment that ends before the lower segment associated to the row.

Author(s)

Alexander Krasnitz, Guoli Sun

Examples


## Vectors of left and right boundary positions for segments that respect
## the upper threshold limit
upperStart <- c(75794987, 87695620, 88864215, 111800683)
upperEnd   <- c(75809906, 87762703, 95041220, 111898394)

## Vectors of left and right boundary positions for segments that respect
## the lower threshold limit
lowerStart <- c(75794987, 87647882, 88805625, 111799423, 153624187, 
                184116712)
lowerEnd   <- c(75809906, 87763963, 95062284, 112097412, 153624592, 
                184150457)

## Segments to retain correspond to rows where the endbeforeend value 
## is equal or larger than the startafterstart value.
CNprep:::containment.indicator(vstart=upperStart, vend=upperEnd, 
                                    wstart=lowerStart, wend=lowerEnd)


KrasnitzLab/CNprep documentation built on May 28, 2022, 8:32 p.m.