Calculates appropriate breaks and labels for x-axis when visualizing multiple chromosomes simultaneously. Adjusts break density based on chromosome length.
Value
A list with two elements:
breaks: Numeric vector of x-axis break positionslabels: Character vector of formatted labels
Details
The function:
Groups data by chromosome
Calculates chromosome lengths
Assigns more breaks to longer chromosomes (2-10 breaks per chromosome)
Formats labels in megabases (M)
Adds newlines before chromosome transitions for clarity
Useful for multi-chromosome Hi-C visualizations where chromosomes are displayed side-by-side.
Examples
if (FALSE) { # \dontrun{
# Get breaks and labels for multi-chromosome plot
df <- scaleData(cc, "balanced", log10)
breaks_labels <- getBreaksLabels(df)
ggplot(df) +
geom_hic() +
scale_x_continuous(
breaks = breaks_labels$breaks,
labels = breaks_labels$labels
)
} # }
