Skip to contents
0.16.6 documentation

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

Site guide · find your task

Protein 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.

Usage

Code
project_ggchord_features(
  feature_data,
  cds,
  from = c("protein", "genome"),
  codon_boundary = c("error", "expand")
)

Arguments

feature_data

Domain/feature data frame with feature_id, parent_id (or a single-valued parent_ids list-column), start and end.

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)