region_coverage: Calculate mean coverage for regions.

Description Usage Arguments Value Examples

View source: R/p09_coverage_functions.R

Description

This function calculate the coverage for the regions provided as bed/narrowPeak/broadPeak format file from a bigWig file. For each region, it adds the depth and divide it by the region length. NOTE: It assumes that the bigWig file is already scalled (e.g. 1 million) and hence does perform scalling or normalization.

Usage

1
region_coverage(regions, format = "narrowPeak", bwFile, name = "coverage")

Arguments

regions

Either GenomicRanges object or a file in bed, narrowPeak or broadPeak format

format

format of the peak file. Should be one of bed, narrowPeak or broadPeak. This options must be provided if regions is a file.

bwFile

bigWig file from which the coverage will be calculated

name

Name of the coverage column. Default: coverage

Value

If the regions is a GRanges object, then same object is returned with additional coverage column. Otherwise a dataframe is returned.

Examples

1

lakhanp1/chipmine documentation built on March 6, 2021, 9:06 a.m.