Repository navigation
Conversation
ga4gh_enref replaces each referable attribute with the referenced object's CURIE as a plain string, then identifies the parent. _recurse_ga4gh_serialize returned that string unchanged, so the parent's digest was computed over "ga4gh:SL.<digest>" instead of "<digest>". An Allele enref'd without a precomputed id therefore got a different VA id than the same Allele inlined. Serialize plain GA4GH CURIE strings to their digest, the same way iriReference.ga4gh_serialize already does. test_enref2's fixture carried the id produced by this bug (VA.LDzK...); it now uses the id ga4gh_identify gives for that Allele (VA.0AeP..., as in ga4gh#440).
This branch has not been deployed
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.
vrs_enrefgives a different id thanga4gh_identifyfor an object whose ids aren't set yet. This is the "allele ID is wrong" case from #596:ga4gh_enrefreplaceslocationwith the location's CURIE as a plain string and then identifies the allele._recurse_ga4gh_serializereturns plain strings unchanged, so the allele digest is computed over"ga4gh:SL.<digest>"instead of"<digest>".iriReference.ga4gh_serializealready strips the prefix, but a plain string didn't get that treatment.This change serializes plain GA4GH CURIE strings to their digest too, so the enref'd form and the inlined form give the same id.
test_enref2was passing a precomputed id that came from this bug (VA.LDzK...); it now uses the idga4gh_identifyreturns for that allele (VA.0AeP..., the same one shown in #440).An alternative is to have
ga4gh_enrefassigniriReference(_id)instead of a string. I went with the serializer because it also covers users who set a reference by hand, and it doesn't change whatenreffed.location == "ga4gh:SL..."returns. Happy to switch if you prefer.Note for downstream stores: any ids that were computed by
vrs_enrefitself before this fix differ from the onesga4gh_identifygives.Tests: new
test_enref_without_precomputed_idsfails on main and passes here; full suite passes locally; ruff clean.Refs #596