Read HPO's 2023 phenotype_to_genes.txt and backfill HPO to gene relations #1862 - #1864
Open
davmlaw wants to merge 1 commit into
Open
Read HPO's 2023 phenotype_to_genes.txt and backfill HPO to gene relations #1862#1864davmlaw wants to merge 1 commit into
davmlaw wants to merge 1 commit into
Conversation
…o gene relations #1862 load_phenotype_to_genes only knew the old seven column file, so the 2023 format imported as zero relations and every HPO term on a phenotype node warned it had no associated genes. The loader now detects the format from the first line, keeps OMIM rows for either, and raises if nothing is left. backfill_phenotype_to_genes (registered as a manual migration step when the latest OntologyVersion's phenotype_to_genes import owns no relations) downloads the current file and loads it into that existing import via OntologyBuilder(existing_import=...), so deployments gain the relations without a new OntologyVersion, annotation sub-version or gene annotation build. create_test_ontology_version now records imports that already exist, which was masked by the seeded test database.
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.
Addresses #1862 - every HPO term on a phenotype node warned "have no associated genes".
Cause
HPO changed phenotype_to_genes.txt in 2023 from seven columns behind a
#Format:comment to five columns with a header row.load_phenotype_to_genesread it with the old column names, thesource == mim2genefilter emptied the frame, and the import completed with zero relations.Changes
load_phenotype_to_genesdetects the format from the first line, keeps OMIM rows for either format, and raises if the frame is empty.processor_versionbumped to 2.OntologyBuilder(existing_import=...)writes into an existing import's partition instead of creating a new import.backfill_phenotype_to_genescommand: downloads the current file (or takes--phenotype_to_genes) and loads it into the import the latestOntologyVersionalready points at, so no new OntologyVersion / annotation sub-version / gene annotation build follows. Registered as a manual migration step (ontology/migrations/0028) whose test fires only when that import owns no relations.create_test_ontology_versionnow records imports that already exist (was masked by the seeded test database).claude/research/ontology.md.Verification
--keepdbdatabase.HP:0004808resolves to CEBPA, BRCA2, GATA2 and others. A second run is a no-op.After deploy
Gene annotation
hpo_terms/omim_termsfor the existing ontology version were built without these relations; the command printsgene_annotation --latest-releases --forcefor rebuilding them. Phenotype nodes cache empty term lookups for a day, so a term viewed before the backfill may keep its warning until then.🤖 Generated with Claude Code
https://claude.ai/code/session_01BtmQtLeDUcDJz5kMdEfhhe