Learn R Programming

misha (version 5.3.1)

gintervals.coverage_fraction: Calculate fraction of genomic space covered by intervals

Description

Returns the fraction of a genomic space that is covered by a set of intervals.

Usage

gintervals.coverage_fraction(intervals1 = NULL, intervals2 = NULL)

Value

A single numeric value between 0 and 1 representing the fraction of 'intervals2' (or the genome) covered by 'intervals1'.

Arguments

intervals1

set of one-dimensional intervals (the covering set)

intervals2

set of one-dimensional intervals to be covered (default: NULL, meaning the entire genome)

Details

This function calculates what fraction of 'intervals2' is covered by 'intervals1'. If 'intervals2' is NULL, it calculates the fraction of the entire genome that is covered by 'intervals1'. Overlapping intervals in either set are automatically unified before calculation.

See Also

gintervals, gintervals.intersect, gintervals.covered_bp, gintervals.all

Examples

Run this code
# \dontshow{
options(gmax.processes = 2)
# }

gdb.init_examples()

# Create some intervals
intervs1 <- gscreen("dense_track > 0.15")
intervs2 <- gintervals(c("chr1", "chr2"), 0, c(100000, 100000))

# Calculate fraction of intervs2 covered by intervs1
gintervals.coverage_fraction(intervs1, intervs2)

# Calculate fraction of entire genome covered by intervs1
gintervals.coverage_fraction(intervs1)

Run the code above in your browser using DataLab