getTESregion: Extract a region around the TES (=end of the gene) from a...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/utils.R

Description

Extract a region around the TES (=end of the gene) from a GRanges

Usage

1
2
3
4
5
6
7
getTESregion(
  gr,
  upstream = 500L,
  downstream = 501L,
  limitToTSS = FALSE,
  trim = FALSE
)

Arguments

gr

A GRanges.

upstream

An integer defining the distance upstream of the TES to extract.

downstream

An integer defining the distance downstream of the TES to extract.

limitToTSS

A logical (default to FALSE) indicating if ranges should be trimmed to don't extend upstream of the TSS

trim

A logical (default to FALSE) indicating if out-of-bound ranges should be trimmed (see ?'trim,GenomicRanges-method')

Details

The TES is defined as start(gr) when strand(gr)=="+" and as end(gr) when strand(gr)=="-" The function considers that strand=="*" is equivalent to strand=="+" To extract 500bp on each side of the TES, use upstream=500 and downstream=501

Value

A GRanges of regions around the TES positions.

Author(s)

Pascal GP Martin

See Also

promoters, flank and trim in intra-range-methods getTES

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Get a 50bp region on each side of the TSS of genes in GeneGR:
  suppressWarnings(
   GenomicRanges::promoters(Genegr,
                              upstream = 50,
                              downstream = 51)
                  )
## Same around the TES:
  suppressWarnings(
    getTESregion(Genegr, upstream = 50, downstream = 51)
    )
## Do not extend regions beyond the TSS or Chr1 borders
  getTESregion(Genegr,
               upstream = 50,
               downstream = 51,
               limitToTSS = TRUE,
               trim = TRUE)

pgpmartin/GeneNeighborhood documentation built on Sept. 2, 2021, 6:37 a.m.