dnaext
database-dna-sequencing · Compact DNA and k-mer types with IUPAC matching and SP-GiST indexes
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102453 | dnaext | database-dna-sequencing | 1.0 | TYPE | C |
PostgreSQL · 16, 17
Usage
Sources:
dnaext 1.0 is an academic C extension for compact DNA sequences and k-mer analysis. The reviewed source documents PostgreSQL 16 and 17. Installation needs a superuser; no preload or restart is required. No explicit license grant was found in this source revision.
Store and Query Sequences
dna and kmer accept case-insensitive A, C, G and T and reject other bases. qkmer accepts IUPAC ambiguity symbols, including N for any base. generate_kmers(dna, k) returns sliding windows with step one; length reports the number of bases for all three types.
Operators and Limits
kmer equality and hashing support GROUP BY, DISTINCT, hash joins and hash indexes. The kmer_spgist_ops operator class accelerates equality and ^@ prefix queries. The pattern operator qkmer @> kmer tests ambiguity matches; it is not an additional SP-GiST strategy. There is no B-tree ordering or ORDER BY support for k-mers.
Both short types hold at most 32 bases. A dna value has a 16-bit length limit of 65,535 bases, but values are not compressed or stored out of line: a row must fit in a database page, so roughly 30,000 bases is the practical single-column limit on an 8 kB page. Split long genomes into reads or fragments.
Server-side FASTQ Loading
load_fastq_data(filename, maximum_insertions, table_to_be_filled) reads a file on the PostgreSQL server and inserts accepted reads into the target table’s dna_seq column. Reads containing unknown bases are skipped. The server process must be able to read the path. PUBLIC execution is revoked and the implementation checks superuser status; this is not a client-side file upload API.