calcFeatureDist: Find the distance to the nearest genomic feature

View source: R/feature-plots.R

calcFeatureDistR Documentation

Find the distance to the nearest genomic feature

Description

For a given query set of genomic regions, and a given feature set of regions, this function will return the distance for each query region to its closest feature. It ignores strand and returns the distance as positive or negative, depending on whether the feature is upstream or downstream

Usage

calcFeatureDist(query, features)

Arguments

query

A GRanges or GRangesList object with query sets

features

A GRanges object with features to test distance to

Details

This function is similar to the bioconductor distanceToNearest function, but returns negative values for downstream distances instead of absolute values. This allows you to assess the relative location.

Value

A vector of genomic distances for each query region relative to its closest feature.

Examples

vistaSftd = GenomicRanges::shift(vistaEnhancers, 100000)
calcFeatureDist(vistaEnhancers, vistaSftd) 

databio/GenomicDistributions documentation built on April 30, 2024, 4:34 a.m.