feat: update results reporting and assembly manifest generation#21
Merged
Conversation
…cimen_ids for assemblies
…r hi-c + long read data
…r hi-c + long read data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
This PR expands the assembly workflow to support specimen-driven assembly requests and downstream result reporting. It adds pre-intent specimen discovery for a taxon, nested specimen/sample/experiment/read lookup, stored JSON manifests with revised intent/versioning behavior, and stage-run reporting endpoints so assembly pipeline results and output files can be attached back to an assembly.
🔄 Type of Change
🧩 Key Changes
Added
GET /api/v1/assemblies/specimen-samples/{taxon_id}for specimen discovery - used by genome launcher to discover and select specimens for a genome assembly. It returns all specimen samples for a taxon includingsample_id,specimen_id,sex, andavailable_data_types, derived from experiments on the specimen itself plus lineage-linked derived samples. Reported data types now includePACBIO_SMRT,OXFORD_NANOPORE,Hi-C, andRNA-Seq(RNA-Seqis discovery-only for now and is not yet included in manifest generation).Added
GET /api/v1/samples/by-specimen/{taxon_id}/{specimen_id}/relatedto return the full specimen hierarchy for inspection/debugging, including the specimen sample, any linked derived samples, and all nested experiments and reads. The endpoint returns full experiment/read fields and supports encodedspecimen_idpath values, including spaces and/.Updated
POST /api/v1/assemblies/intent/{taxon_id}to require specimen in request. Callers now provide explicitlong_read_specimen_sample_idand optionalhic_specimen_sample_id; the endpoint, resolves derived samples, gathers the relevant experiments/reads, determines assembly data types, and generates a manifest from eligible reads only.Updated manifest persistence and retrieval so manifests are stored as JSON on the assembly record and can be fetched later via
GET /api/v1/assemblies/manifest/{taxon_id}andGET /api/v1/assemblies/{assembly_id}/manifest, making the manifest request flow more consistent and durible for downstream consumers.Updated assembly versioning so version allocation is scoped to the selected long-read specimen sample within a taxon, reflecting repeated assembly requests for the same organism with different specimen/data combinations.
Added assembly "stage-run" reporting endpoints:
GET /api/v1/assemblies/{assembly_id}/stage-runs,POST /api/v1/assemblies/{assembly_id}/stage-runs, andPATCH /api/v1/assemblies/{assembly_id}/stage-runs/{stage_run_id}. These support reporting results from different pipelines e.g. genomeassembly, ascc, curation-pretext, etc. Callers can provide 1) a flexible metadata object in json and 2) a list of files, for each pipeline step / stage. This has been kept flexible to facilitate the changing pipeline outputs, and allow new pipeline outputs to be reported without code changes.Added the supporting schema, model, migration, and test updates needed for the revised assembly flow, including manifest storage, specimen-oriented assembly fields, and stage-run/stage-run file support.
✅ Checklist
🔍 Review Notes
RNA-Seqis surfaced by the specimen discovery endpoint only. It is intentionally not yet included in assembly manifest generation, as we're not using this data yet (and don't know how we will use this data)📎 Related Issues / Tickets