Skip to contents

This function processes coverage and junction data for sashimi plot visualization. It calculates y-positions for arc endpoints based on direction: "up" arcs start at coverage height, "down" arcs start at zero, and "alternate" assigns alternating directions to junctions sorted by start position.

Usage

process_sashimi_data(
  coverage_data,
  junction_data,
  region,
  junction_direction = c("alternate", "up", "down")
)

Arguments

coverage_data

Coverage input: a data frame with seqnames, start, end, score columns, or a file path to a bedGraph/bigWig file

junction_data

Junction input: a data frame with seqnames, start, end, score columns, or a file path to a BED file. start/end represent the splice junction coordinates.

region

A genomic region string in the format "chr:start-end"

junction_direction

Direction of junction arcs: "alternate" (default), "up", or "down"

Value

A list with two data frames: coverage_df and junction_df. junction_df has additional columns: y_start, y_end (arc endpoint y-values), arc_direction ("up" or "down" for each junction)

Examples

if (FALSE) { # \dontrun{
coverage <- data.frame(
  seqnames = "chr1", start = 1:100, end = 2:101, score = runif(100, 0, 10)
)
junctions <- data.frame(
  seqnames = "chr1", start = c(20, 40, 60), end = c(35, 55, 80), score = c(5, 10, 3)
)
result <- process_sashimi_data(coverage, junctions, "chr1:1-100")
} # }