From cfdc87755c1be7f9c5f0dbd4236679621e612d8f Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 24 Oct 2024 16:50:40 -0500 Subject: Add `jobid` to extraction directory Add the job id to help "group" files that belong to the same job. --- scripts/rqtl2/phenotypes_qc.py | 7 +++++-- 1 file 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) -- cgit v1.2.3