Skip to content

feat: build DSSTox database from a local zip - #347

Draft
seanthimons wants to merge 2 commits into
mainfrom
feat/dsstox-local-zip
Draft

seanthimons wants to merge 2 commits into
mainfrom
feat/dsstox-local-zip

Conversation

@seanthimons

@seanthimons seanthimons commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Blocked by #349 (synonym source policy). Do not merge or publish a rebuilt DB until it is resolved.

Summary

  • DSSTOX_ZIP=/path/to/DSSTox.zip Rscript data-raw/dsstox.R builds from a local zip: no Clowder lookup, no 180-day staleness skip. Version sidecar becomes <zip mtime date>|local; the next Clowder release reads as new and rebuilds once.
  • Raw headers are normalized to UPPER_SNAKE so newer exports (preferred name, IUPAC name, molecular formula) map onto the existing columns.
  • Columns missing from an export become NULL instead of failing the SQL (the newer dump has no IDENTIFIER synonym column).
  • New lookup values: DTXCID (sort_order 9), INCHI (10), QSAR_READY_SMILES (11), MS_READY_SMILES (12). MS-ready SMILES are shared across salts/parents, so a match there can return several DTXSIDs. Masses and last-updated are left out (not identifiers).
  • inst/dsstox/dsstox_build.R stays a byte-for-byte copy (it's what dss_install(build = TRUE) sources).

Known gap

The new export has no IDENTIFIER column (pipe-delimited synonyms in older dumps), so synonym lookups via dss_* will only hit preferred/IUPAC names.

Test plan

  • Synthetic 12k-row zip with the new header style: builds, expected parent_col set, _metadata + sidecar 2026-10-05|local
  • Real zip: build, DB_NAME=dsstox Rscript dev/db_smoke_check.R, then gh release upload db-latest dsstox.duckdb dsstox.version --clobber

DSSTOX_ZIP points data-raw/dsstox.R at a local DSSTox zip, skipping the
Clowder lookup and the staleness check. Raw headers are normalized
("preferred name" -> PREFERRED_NAME), columns missing from an export
become NULL, and DTXCID/INCHI are added as lookup identifiers.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants