complement_bed: Generate complement

View source: R/manipulation.R

complement_bedR Documentation

Generate complement

Description

This function returns all intervals in a genome that are not covered by at least one interval in the input.

Usage

complement_bed(x, genome = NULL)

Arguments

x

A GRanges.

genome

Specify the reference genome for the BED file. genome can be a valid genome name in GenomeInfoDb::Seqinfo(), e.g. GRCh37, or hs37-1kg, which is a genome shipped with this package, or any custom chromosome size files (local or remote). If NULL, will try to obtain such information from input data. Refer to read_bed().

Value

A GRanges which is the complement of x.

References

Manual page of bedtools complement: https://bedtools.readthedocs.io/en/latest/content/tools/complement.html

See Also

subtract_bed()

Examples

# Load BED tables
tbl <- read_bed(system.file("extdata", "example_merge.bed", package = "bedtorch"), use_gr = FALSE)

# Basic usage
result <- complement_bed(tbl, "hs37-1kg")
head(result)

haizi-zh/bedtorch documentation built on July 1, 2022, 10:40 a.m.