This function returns all intervals in a genome that are not covered by at least one interval in the input.
complement_bed(x, genome = NULL)
x | A |
---|---|
genome | Specify the reference genome for the BED file. |
A GRanges
which is the complement of x
.
Manual page of bedtools complement
:
https://bedtools.readthedocs.io/en/latest/content/tools/complement.html
# 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) #> chrom start end #> 1: 1 0 249250621 #> 2: 2 0 243199373 #> 3: 3 0 198022430 #> 4: 4 0 191154276 #> 5: 5 0 180915260 #> 6: 6 0 171115067 #> ------- #> genome: unspecified.