Skip to contents
0.16.6 documentation

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

Site guide · find your task

Selects targets by feature_id and expands their genomic bounds using biological upstream/downstream directions. For a negative-strand target, upstream extends towards larger genomic coordinates. Unknown or bidirectional strands require equal upstream and downstream distances. Windows are clipped to the known full sequence length; clipping is reported.

Usage

Code
find_ggchord_loci(
  seq_data,
  feature_data,
  targets,
  upstream = 0,
  downstream = 0
)

Arguments

seq_data

Sequence table containing unique accver and positive integer length values. Optional genome and genome_id columns are retained in the returned windows.

feature_data

Feature table containing feature_id, accver, start, end, and optionally strand. Missing strand means unknown.

targets

Non-empty character vector of distinct feature_id values. Selection is exact; no annotation text or accession versions are guessed.

upstream, downstream

Single non-negative integer numbers of bases added before and after each target in its biological direction.

Value

An ordinary data frame in target order with target_id, locus_id, accver, start, end, strand, unexpanded target_start and target_end, requested extensions, and clipped_left/clipped_right. The target_source_rows list column identifies feature input rows used for each target. Coordinates refer to the supplied sequence table; no implicit change from focused coordinates to an earlier source is made.

Details

Repeated rows with the same feature_id represent segments of one target and must belong to the same sequence and strand. Their outer bounds define the target window. Different targets always produce separate windows, including overlapping targets on the same sequence. No intervening sequence is removed, concatenated or locally reversed. Ordered one-based inclusive genomic coordinates are required; origin-spanning circular features and protein coordinates need an explicit conversion before this operation.

The returned locus_id equals target_id. Pass the returned table as loci to focus_ggchord_data() to create independent focused sequences named by those IDs, including multiple windows from one source sequence.

Examples

Code
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
  select(accver, length)
data(gene_data_example)
genes <- gene_data_example |>
  transmute(accver, start, end, strand = source_strand)
genes <- genes |>
  mutate(feature_id = paste(accver, start, end, sep = ":"))
find_ggchord_loci(seqs, genes, targets = genes$feature_id[1], upstream = 100, downstream = 100)