prune.distance: Prune markers by physical position

Description Usage Arguments Details Value Author(s) Examples

View source: R/gene.R

Description

Selects subset of markers so that all excluded markers are within threshold physical distance of included markers.

Usage

1
prune.distance(chr, pos, pval, win.size = 500000)

Arguments

chr

A vector of chromosome locations

pos

A vector of position (on chromosome) locations

pval

A vector of p-values to order by

win.size

Threshold distance

Details

The pruning is done so that prune is TRUE only if there is no smaller P-value within win.size distance.

Value

A logical vector.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
7
tophits <- data.frame(chr = floor(runif(1000, 1, 22.99)),
                      pos = floor(runif(1000, 1, 1000000.99)),
                      pval = runif(1000))
tophits <- tophits[order(tophits$pval), ]
tophits <- within(tophits, prune <- prune.distance(chr, pos, pval))
head(tophits, 20)
with(tophits, table(chr[prune]))

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.