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 changes
Project protein domains or genomic features through a spliced CDS map
Source:R/data-project.R
project_ggchord_features.RdProtein input uses one-based inclusive observed-residue coordinates. Genomic
output preserves exon gaps in segments and uses the parent's biological
strand; its outer envelope is not a claim that introns encode the domain.
The inverse projects only intersections with coding bases, reports excluded
bases, and uses the CDS feature ID as its protein coordinate namespace.
This namespace is not an inferred protein accession. Inputs may supply a
genomic segments list-column to describe disjoint genomic pieces.
Arguments
- feature_data
Domain/feature data frame with
feature_id,parent_id(or a single-valuedparent_idslist-column),startandend.- cds
A map from
build_ggchord_cds().- from
"protein"(default) or"genome".- codon_boundary
Inverse projection policy:
"error"or"expand".
Value
Ordinary feature table with projected accver, start, end,
strand, directionality, segments, parent IDs, genetic-code metadata,
source coordinates and a ggchord_projection provenance attribute.
Details
Each domain retains its explicit feature_id, single CDS parent, source
interval and source row. Source metadata survives with source_ prefixes
on name conflicts. Multiple biological parents must be expanded explicitly
before projection. Unknown parent, intronic-only, out-of-range, reversed,
inconsistent-strand and ambiguous codon-boundary input produce errors.
codon_boundary = "expand" explicitly permits an inverse interval to cover
partial codons and reports this expansion; it does not modify source bases.
Examples
Code
library(dplyr)
data(plasmid_example_pUC19)
feature_source <- find_common_features(plasmid_example_pUC19)
features <- feature_source |>
select(accver, start, end, strand, type, anno)
coding <- features |>
filter(anno == "AmpR", type == "CDS") |>
select(accver, start, end, strand) |>
mutate(feature_id = paste(accver, "AmpR", sep = ":"), phase = 0)
cds <- build_ggchord_cds(coding, genetic_code = 11)
# Select residues for display; this is not a detected domain.
selected <- tibble(
feature_id = "selected_residues", parent_id = coding$feature_id,
start = 2, end = 20
)
project_ggchord_features(selected, cds)