profcomp: Extract windows of interest from a coverage.

Description Usage Arguments Details Value Author(s) Examples

View source: R/utils.R

Description

Extract profiles from a genome-wide coverage on a set of windows of interest. Reverses the profiles for windows that are on the '-' (minus) strand.

Usage

1
profcomp(covr = NULL, woi = NULL)

Arguments

covr

RleList. A genome-wide coverage (typically obtained with the coverage function).

woi

A GRanges. Windows of interest, over which to extract the profiles.

Details

Note that names of covr and seqnames of gr must match

Value

An RleList with stranded profiles at woi

Author(s)

Pascal GP Martin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Obtain coverage for all genes:
  covr <- GenomicRanges::coverage(Genegr)
## Select a (random) set of (100) genes
  set.seed(123)
  randGenes <- sample(names(Genegr), 100)
## Windows of interests cover the gene bodies + 50bp on each side
  woi <- Genegr[randGenes] + 50
## Remove windows that go beyond chromosome borders
  woi <- woi[GenomicRanges::width(GenomicRanges::trim(woi)) -
              GenomicRanges::width(woi) == 0]
## Coverage on these windows of interest:
  profcomp(covr, woi)

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