Skip to contents
0.16.6 documentation

Complete canonical API text; task articles explain the workflows. Tutorials

Site guide · find your task

Crops through focus_ggchord_data() while retaining one sequence per window. Pass segments to coord_collinear() to place those sequences in shared display rows with explicit gaps and local reversals. Coordinates in the returned tables remain window-local and are never concatenated.

Usage

Code
segment_ggchord_data(
  seq_data,
  ribbon_data = NULL,
  gene_data = NULL,
  windows,
  point_data = NULL,
  cross_gap = c("split", "drop"),
  max_links = 10000
)

Arguments

seq_data

Full sequence table with unique accver and integer lengths.

ribbon_data

Optional paired interval table.

gene_data

Optional gene or generic feature table, including segments.

windows

Table with accver, start, end, unique locus_id, optional row_id (defaults to source accver) and orientation (1 or -1, defaults to 1). Bounds must be ordered, integral and within the sequence.

point_data

Optional point links with qaccver, saccver, qpos, spos.

cross_gap

How to handle interval links clipped by selected windows.

Positive integer upper bound on candidate ribbon/point copies. Increase explicitly for larger, intentionally overlapping views.

Value

A list containing focused seq_data, ribbon_data, gene_data, point_data, segments for the coordinate system, reversible source to window transforms, and a report with input row numbers for every output connection and omitted input rows. Each window retains its own source accession, origin, full length and truncation flags.

Details

cross_gap = "split" retains only the parts of each ribbon's linear endpoint correspondence that lie in both selected windows. Omitted regions are never bridged by one ribbon polygon. "drop" retains only links fully contained in a query and subject window. This is a display projection, not realignment. Point links survive only when both endpoints are retained. Overlapping windows can deliberately duplicate a source row; provenance identifies each copy, and max_links bounds the candidate expansion before allocation. Order in the window table is display order within each row.

Examples

Code
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
  select(accver, length)
windows <- tibble(
  accver = rep(seqs$accver[1], 2),
  start = c(1, floor(seqs$length[1] * .65)),
  end = c(floor(seqs$length[1] * .4), seqs$length[1]),
  locus_id = c("left_window", "right_window"), row_id = seqs$accver[1]
)
segment_ggchord_data(slice_head(seqs, n = 1), windows = windows)