Skip to contents

This function converts coverage and junction inputs of various types into standardized data frames for sashimi plot visualization. It supports the same input types as process_signal_input for coverage data (GRanges, data.frame, character vector of file paths, or named list), and processes junction data in parallel.

Usage

process_sashimi_input(
  coverage_data,
  junction_data,
  region,
  track_labels = NULL,
  junction_direction = c("alternate", "up", "down")
)

Arguments

coverage_data

A GRanges object, data frame, character vector of file paths, or named list. Same input types supported as ez_coverage.

junction_data

Junction input that must match the structure of coverage_data:

  • If coverage_data is a single source (GRanges, data.frame, or single file path), junction_data must also be a single source.

  • If coverage_data is a named list, junction_data must be a named list with the same names.

region

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

track_labels

Optional vector of track labels (used for character vector input)

junction_direction

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

Value

A list with two data frames: coverage_df and junction_df, both with a 'track' column when input is a list. junction_df has additional columns: y_start, y_end, arc_direction, start1, start2

Examples

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

# Named list input (multiple tracks)
cov_list <- list("Sample1" = cov_df1, "Sample2" = cov_df2)
junc_list <- list("Sample1" = junc_df1, "Sample2" = junc_df2)
result <- process_sashimi_input(cov_list, junc_list, "chr1:1-100")
} # }