Skip to content

feat: taxonomy info change and assembly manifest update#26

Merged
emilylm merged 7 commits into
mainfrom
taxon-info-and-manifest-update
May 20, 2026
Merged

feat: taxonomy info change and assembly manifest update#26
emilylm merged 7 commits into
mainfrom
taxon-info-and-manifest-update

Conversation

@emilylm

@emilylm emilylm commented May 20, 2026

Copy link
Copy Markdown
Collaborator

📌 Summary

This PR improves the taxonomy_info and assembly intent endpoints with several related enhancements. On the taxonomy side, it adds bulk upsert and NCBI refresh endpoints so existing records can be updated without re-importing from scratch. It also removes redundant columns. On the assembly side, the create manifest endpoint now accepts multiple Hi-C specimen sample IDs, allowing assemblies that draw Hi-C reads from more than one specimen to be correctly represented in the generated manifest. Some manifest fields were also updated to match the intended schema.


🔄 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Refactor (code change that neither fixes a bug nor adds a feature)
  • 📚 Documentation update
  • ⚙️ CI / build / tooling change

🧩 Key Changes

  • POST /taxonomy-info/bulk-upsert — new endpoint that inserts or updates taxonomy info rows and re-fetches NCBI data, mirroring the behaviour of the single-record create endpoint
  • POST /taxonomy-info/bulk-ncbi-refresh — new endpoint that re-syncs only the ncbi_* columns for a supplied list of existing taxon_ids, leaving upstream fields unchanged
  • Multiple Hi-C specimens in assembly intentAssemblyIntent.hic_specimen_sample_id (single UUID) replaced by hic_specimen_sample_ids (list of UUIDs); the manifest helper's routing check is now a set membership test, requiring minimal logic change
  • Taxonomy schema clean-up — removed redundant/outdated columns (defined_class, mito_ref, busco_dataset_name) and backfilled mitohifi_reference_species from mito_ref
  • Manifest field updates — added assembly_id to the generated manifest; removed PacBio file extension validation to be consistent with ONT and Hi-C handling
  • Migration 0003 — adds nullable hic_specimen_sample_ids JSONB column to assembly; the existing hic_specimen_sample_id FK column is retained and set to the first entry for backwards compatibility; removes defined_class (redundant with ncbi_class), mito_ref (redundant with mitohifi_reference_species), and
    busco_dataset_name (replaced by busco_odb10_dataset_name and busco_odb12_dataset_name).

✅ Checklist

  • Tests are passing locally / in CI
  • New tests have been added for new or changed functionality
  • Self-review completed
  • Documentation updated (if needed)
  • No sensitive data or secrets included

🔍 Review Notes

  • The four pre-existing test failures in test_endpoints_assemblies.py (manifest response shape, reads vs read_files key) were already failing on main before this branch — they are not regressions introduced here
  • hic_specimen_sample_ids has no DB-level FK constraint (stored as JSONB); referential integrity is enforced at the API layer via _validate_specimen_sample before any write. The long_read_specimen_sample_id remains the primary identifier for versioning and assembly identity
  • The bulk-ncbi-refresh endpoint skips rows that don't yet have a taxonomy_info record — callers should use bulk-import or bulk-upsert first if creating new rows is also needed

📎 Related Issues / Tickets

  • Closes #
  • Related to #

@emilylm
emilylm marked this pull request as ready for review May 20, 2026 09:56
@emilylm
emilylm force-pushed the taxon-info-and-manifest-update branch from 374e84a to 404503f Compare May 20, 2026 09:57
@emilylm
emilylm merged commit 94cffe1 into main May 20, 2026
2 checks passed
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.

1 participant