get_region_cov: Check or compute the region coverage from the datasets in...

Description Usage Arguments Value Author(s) Examples

View source: R/utils.R

Description

This utility function checks the user-provided region data.frame coverage list (COVERAGE) or computes a new one using brainflowprobes_cov. This is used by four_panels and plot_coverage.

Usage

1
2
3
4
5
6
get_region_cov(
  REGION,
  COVERAGE = NULL,
  VERBOSE = TRUE,
  PD = brainflowprobes::pd
)

Arguments

REGION

Either a single hg19 genomic sequence including the chromosome, start, end, and optionally strand separated by colons (e.g., 'chr20:10199446-10288068:+'), or a string of sequences. Must be character. Chromosome must be proceeded by 'chr'.

COVERAGE

The output of brainflowprobes_cov for the input REGION. Defaults to NULL but it can be pre-computed and saved separately since this is the step that takes the longest to run. Also, this is the only step that depends on rtracklayer's functionality for reading BigWig files which does not run on Windows OS. So it could be run on a non-Windows machine, saved, and then shared with Windows users.

VERBOSE

A logical value indicating whether to print updates from the process of loading the data from the BigWig files.

PD

A list of data.frames with the sumMapped and files columns. Defaults to the data included in this package.

Value

If COVERAGE is provided and all checks pass, then this function returns COVERAGE. Otherwise, it computes a new region coverage data.frame list using brainflowprobes_cov.

Author(s)

Leonardo Collado-Torres

Examples

1
2
3
4
5
## If all checks pass, then it returns the COVERAGE
stopifnot(identical(
    get_region_cov(COVERAGE = four_panels_example_cov),
    four_panels_example_cov
))

brainflowprobes documentation built on Dec. 21, 2020, 2:01 a.m.