feat(sample): control sample_type with enum_sample_type vocabulary#7
Merged
Conversation
Converts sample_type from free text to a controlled 42-value vocabulary backed by UBERON/PSI-MS/ChEBI accessions, applied consistently to sample and the denormalised copy on qc_file. Bumps the dictionary to 1.2.0. The enum definition carries no description of its own so it cannot compete with the description on the properties that $ref it. Existing sample_type values outside the enum will fail validation on re-submission and must be mapped before deployment; the other and not_reported values provide an escape hatch.
JoshuaHarris391
force-pushed
the
feat/sample-type-enum
branch
from
July 20, 2026 04:18
3224f23 to
6994619
Compare
Drops the OLS4 resolver links from the sample_type description on sample and qc_file, leaving the submitter-facing instruction. Both nodes keep identical wording.
Corrects the misspelling in the data_release description across all 29 node files in both dictionary folders. Description text only; no structural or property changes.
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.
Implements §2A and §3.5 of the proteomics/metabolomics implementation spec. This is the first of two PRs; the additive proteomics/metabolomics property work follows separately.
What changed
_definitions.yaml— newenum_sample_type: 42 values covering blood and derivatives, tissue, cell-based material, nucleic acids, protein/peptide, biofluids, organoid/xenograft and extracellular vesicles, plusotherandnot_reported. A parallelenumDeflist pins UBERON / PSI-MS / ChEBI accessions. The enum definition deliberately carries nodescriptionof its own — that would compete with the description on the properties that$refit. Researcher-facing guidance lives on the property, which is what the dictionary UI shows.sample.yamlandqc_file.yaml—sample_typechanges from free-texttype: stringto$ref: _definitions.yaml#/enum_sample_type, with the vocabulary guidance in the property description.qc_fileholds a denormalised copy of the sample block, so both were converted to keep the vocabulary consistent._settings.yaml— dictionary version1.1.6→1.2.0.Changes were made in
test_dict, bundled, validated, then mirrored toprod_dictviacopy_to_prod.sh. The two folders are byte-identical.Validation
All run under
poetry run(the baregen3schemadevon PATH is a pyenv shim at 2.3.5; this repo pins 2.6.1):Every node reports SUCCESS, no failures. In the bundle,
enum_sample_typeresolves to exactly{enum, enumDef}with 42 parallel entries and no description, andsample_typeon both nodes matches the shape of the existingsample_in_preservation. Norequired,links,uniqueKeysorsystemPropertieswere touched.Migration risk — please read before deploying
This is the only non-additive change in the whole spec. Any existing
sample_typevalue in the deployed commons that is not in the enum will fail validation on re-submission. Existing values need mapping first, e.g."Whole Blood"→whole_blood,"Frozen Blood"→whole_bloodplus the existingsample_in_preservationfield. Theother/not_reportedvalues limit breakage. No live records exist in this repo, so this is a sheepdog deployment concern rather than a repo one.Worth a look during review
The spec flagged several accessions as needing confirmation in OLS4 before deploying, and they are carried through as-is with inline comments marking them:
leukocytesandperipheral_blood_mononuclear_cells(cell-level, CL may be more precise),ascites_fluid,organoid,xenograft, and the two exosome values. These render in the dictionary viewer, so they are worth eyeballing.Pre-existing, not touched here
Three definitions in
_definitions.yamlstill carry their owndescriptionand have the same$ref-sibling conflict this PR avoids:enum_omics_type,release_state, anddata_bundle_state. Left alone to keep this PR scoped, but they are worth a follow-up cleanup.