Fix #219: Database cache dir defaults to download cache, not GTF directory#340
Merged
Conversation
When a Genome is constructed with a local GTF and no explicit cache_directory_path, the sqlite Database (and SequenceData caches) now write into the resolved download cache directory rather than the GTF's parent directory. This unblocks users pointing pyensembl at GTFs in read-only locations who previously hit a PermissionError on index(). Database's standalone fallback (cache next to GTF when no path provided) is unchanged so direct Database(...) callers behave as before. Bump version to 2.6.13.
Now that Genome hands the resolved download-cache dir (rather than the
FASTA's parent dir) to SequenceData, the target directory may not exist
yet when no remote files have been downloaded. Mirror Database.create's
ensure_dir call before dump_pickle.
Fixes test_missing_genome_sources.{test_transcript_fasta_only,test_protein_fasta_only}.
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
Genomeis built from a local GTF without an explicitcache_directory_path, the sqliteDatabase(and protein/transcriptSequenceDatacaches) are now created under the resolved download-cache directory instead of next to the source GTF. Closes Database path should not default to gtf path #219.Database's standalone fallback (write next to the GTF when nocache_directory_pathis passed) is unchanged, so callers constructingDatabasedirectly behave as before.Test plan
tests/test_database_cache_dir.pycovers both the fallback path (viaPYENSEMBL_CACHE_DIR) and the explicit-path casetests/test_ucsc_gtf.py(which exercisesgenome.index()with an explicit cache dir) still passes./lint.sh