Skip to content

Commit

Permalink
update path defs to point to new ensembl cache location
Browse files Browse the repository at this point in the history
  • Loading branch information
bkmarzouk committed Nov 21, 2023
1 parent a230634 commit b9c1c4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/SOPRANO/core/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ class _GatherReferences:
sizes_done: Set[int] = set()

def _dest_directory(self, release: int):
return Directories.data(self.species) / f"{release}_{self.assembly}"
return (
Directories.ensembl_downloads(self.species)
/ f"{release}_{self.assembly}"
)

def _dest_fa_gz(self, release: int, _toplevel: bool):
return self._dest_directory(release) / filename_from_url(
Expand Down
7 changes: 6 additions & 1 deletion src/SOPRANO/utils/path_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
_SOPRANO_SCRIPTS = _SOPRANO_SRC / "scripts"
_SOPRANO_R = _SOPRANO_SRC / "R"
_SOPRANO_DATA = _SOPRANO_SRC / "data"
_SOPRANO_HOMO_SAPIENS = _SOPRANO_DATA / "homo_sapiens"
_SOPRANO_IMMUNO = _SOPRANO_SRC / "immunopeptidomes"
_SOPRANO_IMMUNO_HUMANS = _SOPRANO_IMMUNO / "human"
_SOPRANO_EXAMPLES = _SOPRANO_SRC / "examples"
Expand All @@ -15,6 +14,8 @@
# Common dirs from repository root
_SOPRANO_REPO = _SOPRANO_SRC.parent.parent
_SOPRANO_DEFAULT_CACHE = _SOPRANO_REPO / "pipeline_cache"
_SOPRANO_ENSEMBL_CACHE = _SOPRANO_REPO / "ensembl_downloads"
_SOPRANO_HOMO_SAPIENS = _SOPRANO_ENSEMBL_CACHE / "homo_sapiens"

# Test dirs
_SOPRANO_TESTS = _SOPRANO_REPO / "tests"
Expand Down Expand Up @@ -49,6 +50,10 @@ def r_scripts(sub_path_item="") -> pathlib.Path:
def data(sub_path_item="") -> pathlib.Path:
return _SOPRANO_DATA.joinpath(sub_path_item)

@staticmethod
def ensembl_downloads(sub_path_item="") -> pathlib.Path:
return _SOPRANO_ENSEMBL_CACHE.joinpath(sub_path_item)

@staticmethod
def genomes_homo_sapiens(sub_path_item="") -> pathlib.Path:
return _SOPRANO_HOMO_SAPIENS.joinpath(sub_path_item)
Expand Down
4 changes: 3 additions & 1 deletion tests/units/_app_utils_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
@pytest.fixture
def mock_genome_dir():
assembly, release = "FOO", 999
mock_dir = Directories.data() / "homo_sapiens" / f"{release}_{assembly}"
mock_dir = (
Directories.ensembl_downloads("homo_sapiens") / f"{release}_{assembly}"
)

return assembly, release, mock_dir

0 comments on commit b9c1c4a

Please sign in to comment.