cluster_bed: Cluster intervals

cluster_bedR Documentation

Cluster intervals

Description

This operation is similar to bedtools cluster. It reports each set of overlapping or “book-ended” features in an interval file.

Usage

cluster_bed(x, max_dist = 0)

Arguments

x

A GRanges

max_dist

Maximum distance between features allowed for features to be merged. Default is 0. That is, overlapping and/or book-ended features are merged.

Value

A GRanges. Compared

References

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

See Also

merge_bed()

Examples

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

# Basic usage
clustered <- cluster_bed(tbl)
head(clustered)

# Change the maximum distance allowed
clustered <- cluster_bed(tbl, max_dist = 10)
head(clustered)

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