Skip to content

Conversation

@vinay-ebi
Copy link
Contributor

@vinay-ebi vinay-ebi commented Aug 5, 2025

This pull request refactors the way assembly accession-based paths are generated and used within the ensembl-metadata-api codebase.

Key Changes:

Introduced format_accession_path Utility:

Added a new function, format_accession_path, in src/ensembl/production/metadata/api/factories/utils.py.
This function takes an assembly accession (e.g., GCF_043381705.1) and converts it to a standardized path format (e.g., GCF/043/381/705/1).
It validates the accession format and raises errors for invalid formats.
Refactored Path Construction in Adaptors:

Updated genome.py and vep.py adaptors to use format_accession_path for path handling.
Replaced previous logic that constructed paths using the scientific name and accession, resulting in more consistent and structured paths.
Paths that previously looked like Saccharomyces_cerevisiae_S288c/GCA_000146045.2/... now look like GCA/000/146/045/2/....
Updated Tests:
Introduced new tests for the path generation to cover previous releases.
Updated existing tests to work with the change in expected data.
Updated ensembl_release.label data to match current standard and all associated tests

Adjusted tests in test_utils.py to match the new path format.
Added unit tests to validate the new format_accession_path utility, including tests for valid, invalid, and edge case inputs.

vinay-ebi and others added 4 commits August 5, 2025 21:05
-Updated get_paths to new path structure
-Defaults to is_current but accepts version (integrated or partial)
-Added input validation
-VEP code was simplified to call on the get_paths
-tests were updated and new tests created
-test data: ensembl_release.label was made to look like real data and associated tests were updated
@nwillhoft
Copy link
Contributor

Will need updates to this PR following schema updates in PR #169

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.

4 participants