aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorPjotr Prins2024-03-24 09:41:55 +0100
committerFrederick Muriuki Muriithi2024-09-12 07:20:32 -0500
commit047df9c4a01f860f76c5c8c605780009e3e3ce03 (patch)
tree1dea59ddc86c3b52276161505b0da1dab51f7b46 /gn3/computations
parent1c4286ec769bdea47c7950b905d78232366af1fe (diff)
downloadgenenetwork3-047df9c4a01f860f76c5c8c605780009e3e3ce03.tar.gz
Move assert_paths_exist into fs_helpers
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/gemma.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/gn3/computations/gemma.py b/gn3/computations/gemma.py
index 5a2616b..2c367ff 100644
--- a/gn3/computations/gemma.py
+++ b/gn3/computations/gemma.py
@@ -8,7 +8,7 @@ from typing import Optional, Dict
from typing import List
from typing import ValuesView
from gn3.commands import compose_gemma_cmd
-from gn3.fs_helpers import get_hash_of_files
+from gn3.fs_helpers import get_hash_of_files, assert_paths_exist
def generate_hash_of_string(unhashed_str: str) -> str:
@@ -41,17 +41,6 @@ def generate_pheno_txt_file(trait_filename: str,
return f"{tmpdir}/gn2/{trait_filename}"
-def assert_paths_exist(paths: ValuesView) -> bool:
- """Given a list of PATHS, throw error if any of them do not exist."""
- for path in paths:
- if not os.path.isfile(path):
- if throw_error:
- raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path)
- else:
- return False
- return True
-
-
# pylint: disable=R0913
def generate_gemma_cmd(gemma_cmd: str,
output_dir: str,