Complete canonical API text; task articles explain the workflows. Tutorials
Site guide · find your task
Setup and learning paths
HomeInstall and prepare the environmentChoose your learning moduleModule I · Chord
1.1 Tables and field meanings1.2 Produce and import comparisons1.3 Build the layers step by step1.4 Direction, curvature and clearance1.5 Filter and summarize links1.6 Full source-file workflow1.7 Complete chord showcaseModule II · Collinear
2.1 Reuse chord input tables2.2 Switch coordinates and add layers2.3 Routes, clearance and the ruler2.4 Compare CDS neighbourhoods2.5 Focus, anchors and segments2.6 Complete collinear showcaseModule III · Plasmid
3.1 DNA, annotations and 13 references3.2 From a circle to annotation layers3.3 Features, primers and restriction3.4 Thirteen plasmid references3.5 Complete plasmid casesConsult as needed · Data and layers
Prepare tables and coordinatesImport and convert dataImport nucleotide and protein alignmentsProject protein intervals to genomic coordinatesFeatures, stacking and genomic decorationLabels and local placementQuantitative tracksMappings, scales, guides and themesSet values by sequence and strandCommon adjustments and grammarExport, preview and diagnosticsLearning map and reference
Articles and complete workflowsFunction referenceReproducible galleryFrequently asked questionsMigrate to the candidate APITerminology and design sourcesDevelopment status and changesSelects 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.
Arguments
- seq_data
Sequence table containing unique
accverand positive integerlengthvalues. Optionalgenomeandgenome_idcolumns are retained in the returned windows.- feature_data
Feature table containing
feature_id,accver,start,end, and optionallystrand. Missing strand means unknown.- targets
Non-empty character vector of distinct
feature_idvalues. 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)