aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-10-24 16:50:40 -0500
committerFrederick Muriuki Muriithi2024-10-24 16:50:40 -0500
commitcfdc87755c1be7f9c5f0dbd4236679621e612d8f (patch)
tree5869b498e5a85389e02090108fd72338c782292d /scripts
parentf8e45d54be507d5080e9a6a3a3026907f60507a9 (diff)
downloadgn-uploader-cfdc87755c1be7f9c5f0dbd4236679621e612d8f.tar.gz
Add `jobid` to extraction directory
Add the job id to help "group" files that belong to the same job.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rqtl2/phenotypes_qc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/rqtl2/phenotypes_qc.py b/scripts/rqtl2/phenotypes_qc.py
index d8bf3c2..2e7937f 100644
--- a/scripts/rqtl2/phenotypes_qc.py
+++ b/scripts/rqtl2/phenotypes_qc.py
@@ -1,5 +1,6 @@
"""Run quality control on phenotypes-specific files in the bundle."""
import sys
+import uuid
import shutil
import logging
import tempfile
@@ -111,11 +112,13 @@ def check_for_averages_files(
}
-def extract_bundle(bundle: Path, workdir: Path) -> tuple[Path, tuple[Path, ...]]:
+def extract_bundle(
+ bundle: Path, workdir: Path, jobid: uuid.UUID
+) -> tuple[Path, tuple[Path, ...]]:
"""Extract the bundle."""
with ZipFile(bundle) as zfile:
extractiondir = workdir.joinpath(
- f"{sha256_digest_over_file(bundle)}_phenotype_qc_{bundle.name}")
+ f"{str(jobid)}-{sha256_digest_over_file(bundle)}-{bundle.name}")
return extractiondir, rqtl2.extract(zfile, extractiondir)