Skip to contents

This function calculates appropriate y-axis limits for link/arc tracks based on the maximum genomic distance span and height factor. This ensures curves are not clipped and provides consistent spacing for multi-track plots.

Usage

calculate_link_ylim(data, height_factor = 0.15, direction = "down")

Arguments

data

A data frame with link/interaction data containing start1 and start2 columns

height_factor

Height of curves as proportion of genomic distance span

direction

Direction of curves: "down" (negative y) or "up" (positive y)

Value

A numeric vector of length 2 with y-axis limits c(ymin, ymax)

Examples

if (FALSE) { # \dontrun{
df <- data.frame(
  start1 = c(1000, 2000, 3000),
  start2 = c(5000, 6000, 7000)
)
ylim <- calculate_link_ylim(df, height_factor = 0.15, direction = "down")
} # }