github teaguesterling/plinking_duck v0.4.0
v0.4.0 — Structured genotypes, unified variants, flexible companions

latest releases: v0.9.2, v0.9.0, v0.8.2...
6 months ago

What's New

Genotype Output Modes

  • genotypes='struct' — STRUCT with named fields per sample (variant orient) or per variant (sample orient). Like 'columns' but as a single logical column with named field access (genotypes.SAMPLE1).
  • genotypes='counts' — STRUCT(hom_ref, het, hom_alt, missing) using PgrGetCounts for zero-decompression fast counting. Orders of magnitude faster than reading individual genotypes for large cohorts.
  • genotypes='stats' — Extends counts with derived statistics: n, af, maf, missing_rate, carrier_count, het_rate. Cross-validates against plink_freq and plink_missing.

Unified Variants Parameter

Flexible variant selection for read_pfile and read_pgen:

  • Single index: variants := 0
  • Single rsid: variants := 'rs123'
  • CPRA string: variants := '1:10000:A:G'
  • CPRA struct: variants := {chrom: '1', pos: 10000, ref: 'A', alt: 'G'}
  • Index range: variants := {start: 0, stop: 100}
  • Identifier range: variants := {start: 'rs1', stop: 'rs3'}
  • Lists of any of the above

Flexible Companion Sources

  • Parquet auto-discovery: .pvar.parquet and .psam.parquet are preferred over text formats when present (configurable via SET plinking_use_parquet_companions)
  • Arbitrary sources: pvar := and psam := accept CSV files, DuckDB tables, and views
  • read_pvar / read_psam accept any DuckDB-readable source as positional argument

Configuration & Filtering

  • plinking_max_threads config option: cap parallel scan threads across all functions
  • plink_glm p_threshold: scan-time p-value filtering for GWAS output reduction

Full Changelog

v0.3.0...v0.4.0

Don't miss a new plinking_duck release

NewReleases is sending notifications on new releases.