calcDistNearestTSS: Calculate distance from region to nearest TSS

Description Usage Arguments Author(s) Examples

View source: R/GetNearbyGenes.R

Description

Idea For a given region R linked to X genes G merge R with nearest TSS for G (multiple) this will increse nb of lines i.e R1 - G1 - TSS1 - DIST1 R1 - G1 - TSS2 - DIST2 To vectorize the code: make a granges from left and onde from right and find distance collapse the results keeping min distance for equals values

Usage

1
calcDistNearestTSS(links, TRange, tssAnnot)

Arguments

links

Links to calculate the distance

TRange

Genomic coordinates for Tartget region

tssAnnot

TSS annotation

Author(s)

Tiago C. Silva

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
 data <- ELMER:::getdata("elmer.data.example")
  NearbyGenes <- GetNearGenes(data = data, 
                              probes = c("cg15924102", "cg24741609"),  
                              numFlankingGenes = 20)
  NearbyGenes <- ELMER:::calcDistNearestTSS(
       links = NearbyGenes,
       tssAnnot =  getTSS(genome = "hg38"),
       TRange = rowRanges(getMet(data))
       )

## End(Not run)

ELMER documentation built on Nov. 8, 2020, 4:59 p.m.