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 changesPerforms structured validation of seq_data, ribbon_data and
gene_data so that problems can be found, understood and fixed before
plotting. The result is a "ggchord_validation" object with a
valid flag, errors (severe problems that make the plot
misleading), warnings (drawable but noteworthy issues), per-category
counts, a data summary, the original row numbers of every problem, and a
list of automatically fixable issues.
Usage
Code
validate_ggchord_data(
seq_data,
ribbon_data = NULL,
gene_data = NULL,
strict = FALSE,
check_coordinates = TRUE,
check_duplicates = TRUE,
check_self_links = TRUE
)Arguments
- seq_data
data.frame/tibble, required. Basic sequence information (columns
accver,length).- ribbon_data
data.frame/tibble, optional. Alignment results (columns
qaccver,saccver,qstart,qend,sstart,send).- gene_data
data.frame/tibble, optional. Gene annotation data (columns
accver,start,end,strand;annois optional).- strict
Logical. When
TRUE, collect issues and then stop if any severe problem is found. WhenFALSE(default), return the full diagnostic report without stopping.- check_coordinates
Logical, default
TRUE. Whether to check that ribbon/gene coordinates stay inside[1, sequence length].- check_duplicates
Logical, default
TRUE. Whether to look for fully duplicated, near-duplicated and highly overlapping records. Reciprocal overlap requires the intersection to cover at least 90 percent of each interval, including descending ribbon endpoints. Reversed feature bounds may cross a circular origin and are excluded from linear overlap diagnostics; exact duplicates are still reported.- check_self_links
Logical, default
TRUE. Whether to flag alignment rows whereqaccver == saccver.
Value
A "ggchord_validation" object (a list) with at least:
validLogical:
TRUEwhen there are no severe errors.errorsdata.frame of severe issues (table, category, row, column, message).
warningsdata.frame of non-severe issues (same columns).
summaryPer-category counts (table, category, severity, n).
data_summaryCounts of sequences/ribbons/genes, unknown IDs, out-of-range rows, etc.
invalid_rowsNamed list of original row numbers per problem category.
cleanabledata.frame of fixable issues with suggested actions.
Examples
Code
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
select(accver, length)
data(ribbon_data_example)
links <- ribbon_data_example |>
select(qaccver, saccver, qstart, qend, sstart, send)
data(gene_data_example)
genes <- gene_data_example |>
transmute(accver, start, end, strand = source_strand)
result <- validate_ggchord_data(seqs, links, genes)
result$valid