rduckhts_genbank: Create GenBank Feature Table

View source: R/duckhts.R

rduckhts_genbankR Documentation

Create GenBank Feature Table

Description

Creates a DuckDB table from a GenBank flat file using the DuckHTS extension. Features are emitted in read_gff's column shape, so a GenBank record substitutes for a GFF without a schema change. Locations built with join() or order() give one row per segment in biological order, complement(...) sets strand "-", and the GFF3 phase of each CDS segment is carried from /codon_start across segments. Parent links a feature to the gene sharing its /locus_tag wherever that gene appears in the record, repeated qualifiers become one key with comma-joined values, and valueless qualifiers read true. Records stream one at a time, and a record without a terminating // or with a malformed location is an error naming the feature and line.

Usage

rduckhts_genbank(
  con,
  table_name = NULL,
  path,
  attributes_map = FALSE,
  overwrite = FALSE,
  attributes = NULL
)

Arguments

con

A DuckDB connection with DuckHTS loaded

table_name

Name for the created table, or NULL to create the genbank_data view

path

Path to the GenBank flat file, optionally bgzipped

attributes_map

Logical. If TRUE, add a parsed MAP(VARCHAR, VARCHAR) column alongside the raw attribute string

overwrite

Logical. If TRUE, overwrites an existing table

attributes

Character vector of qualifier keys to expose as VARCHAR columns. Each equals attributes_map[key], including comma-joined repeated qualifiers and NA for an absent key, and is computed only when the query selects it. Key matching is case-sensitive: "ec_number" does not match /EC_number

Value

Invisible TRUE on success


Rduckhts documentation built on Oct. 25, 2026, 1:08 a.m.