gintervals.align | R Documentation |
Align intervals to the closest intervals in another set
gintervals.align(intervals, align_intervals, mindist = 0, maxdist = 0)
intervals |
intervals set to be aligned |
align_intervals |
intervals set to align to |
mindist |
minimum distance to consider for alignment |
maxdist |
maximum distance to consider for alignment |
An intervals set with the same number of rows as intervals
, where each interval
that has a neighbor with distance 0 in align_intervals
is replaced with that neighbor.
Intervals without a neighbor at distance 0 remain unchanged.
gintervals.neighbors
# Create sample intervals
intervals <- data.frame(
chrom = c("chr1", "chr1", "chr2"),
start = c(1000, 2000, 1500),
end = c(1100, 2100, 1600),
value = c(10, 20, 30)
)
intervals
# Create alignment target intervals
align_intervals <- data.frame(
chrom = c("chr1", "chr1"),
start = c(1000, 2050),
end = c(1100, 2150),
score = c(5, 6)
)
align_intervals
# Align intervals to align_intervals
aligned <- gintervals.align(intervals, align_intervals)
aligned
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.