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
Import local GenBank or GBFF records using an optional mature parser
Source:R/data-genbank.R
read_genbank.RdUses the public Bio.SeqIO.parse(..., "genbank") API in an explicitly
selected Python environment with Biopython installed. The R package
jsonlite exchanges structured temporary JSON with that process. This
function never installs packages, downloads records, or runs during plot
building. It reads all selected records into memory and is intended for
small to moderate local annotation files, not chromosome-scale streaming.
Usage
Code
read_genbank(
file = NULL,
files = NULL,
feature_types = NULL,
lengths = NULL,
python = "python3",
unsupported = c("error", "report"),
source_file = FALSE
)Arguments
- file
Optional path vector or glob patterns; read before
files.- files
Optional paths or wildcard patterns for several files.
- feature_types
Optional feature types to select.
NULLretains all.- lengths
Optional named numeric vector of known full sequence lengths, following
as_ggchord_seq().- python
Interpreter name or path, default
"python3". It must already have the optional Biopython package installed. No environment is modified.- unsupported
"error"or"report"for locations without a safe local interval representation.- source_file
Add
.source_filecolumns to output tables, defaultFALSE. File provenance is retained in the report regardless.
Value
A list with seq_data, named features$annotation, and report.
Tables can be supplied to prepare_ggchord_data(). Feature rows include
feature_id, parent_ids, segments, source record/feature indices,
qualifiers, source_location, partial_start/partial_end, and
location_operator. report$records retains the complete parsed source
CDS rows also expose source codon_start, genetic_code, biological
partial5/partial3, and translation_exception qualifiers for explicit
downstream coding-coordinate models. Missing CDS codon_start uses the
INSDC default 1, marked by codon_start_source = "format-default".
Bound-only flags remain in bound_partial5/bound_partial3; CDS partial
flags also record initial codon offset or terminal coding remainder, with
their evidence in partial5_source/partial3_source. They describe the
observed coding extent, not proof of a complete biological protein.
No per-segment phase values are invented. segment_order preserves the
source's declared coding-piece order independently of segment_index.
metadata, raw_files retains original text, and unplaced_features
identifies every selected feature not placed under "report".
Details
Record IDs, including accession versions, are retained exactly as returned
by the source parser. Full parsed record annotations, feature qualifiers,
source locations, and original file text are retained in report. Feature
IDs use explicit ID, then protein_id for CDS, then locus_tag, then a
non-placeholder parser feature ID. Missing IDs remain missing. Shared
locus_tag values do not invent gene/CDS parent relationships; explicit
Parent qualifiers become parent_ids.
Simple and joined local locations retain one-based inclusive segments
in parser order. Before/after fuzzy bounds retain their source descriptors
and partial flags; they are displayed at the reported boundary rather than
treated as exact biology. Remote locations, missing or unsupported fuzzy
positions, zero-width sites, and mixed-strand joined features are never
flattened into guessed intervals. unsupported = "error" stops by default;
"report" retains these features in report$unplaced_features instead.
An absent ORIGIN sequence does not imply an unknown declared length.
Truly missing/zero lengths require explicit lengths; feature endpoints
are never used to infer full lengths. Protein records require an explicit
protein-coordinate workflow instead of this nucleotide reader.