From d3746629cb60f414fa889eae1a54904ac9c566cf Mon Sep 17 00:00:00 2001 From: Jens Luebeck Date: Thu, 1 Jun 2023 19:37:25 -0700 Subject: [PATCH] make paa_envs filename more unique --- PrepareAA.py | 2 +- singularity/run_paa_singularity.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PrepareAA.py b/PrepareAA.py index d6b9e8f..ec7bb32 100755 --- a/PrepareAA.py +++ b/PrepareAA.py @@ -155,7 +155,7 @@ def run_cnvkit(ckpy_path, nthreads, outdir, bamfile, seg_meth='cbs', normal=None cmd = "gzip -f " + cnrFile logging.info(cmd) call(cmd, shell=True) - if normal: + if normal and not args.ref == "GRCh38_viral": cmd = "rm " + stripRefG + " " + stripRefG + ".fai" logging.info(cmd) call(cmd, shell=True) diff --git a/singularity/run_paa_singularity.py b/singularity/run_paa_singularity.py index a7ae3b8..ba8938a 100755 --- a/singularity/run_paa_singularity.py +++ b/singularity/run_paa_singularity.py @@ -285,12 +285,13 @@ def metadata_helper(metadata_args): sys.exit(1) # write exported envs to env-file - with open("paa_envs.txt", 'w') as env_file: + env_outname = "paa_envs_" + args.sample_name + ".txt" + with open("env_outname", 'w') as env_file: env_file.write('argstring="' + argstring + '"\n') env_file.write("SAMPLE_NAME=" + args.sample_name) # assemble a singularity command string - sing_string = "singularity exec --no-home --cleanenv --env-file paa_envs.txt --bind $AA_DATA_REPO:" \ + sing_string = "singularity exec --no-home --cleanenv --env-file " + env_outname + " --bind $AA_DATA_REPO:" \ "/home/data_repo --bind " + bamdir + ":/home/bam_dir --bind " + norm_bamdir + ":/home/norm_bam_dir " \ "--bind " + cnvdir + ":/home/bed_dir --bind " + args.output_directory + ":/home/output --bind " \ "$HOME/mosek:/home/mosek/ " + args.sif + " bash /home/run_paa_script.sh " @@ -303,6 +304,7 @@ def metadata_helper(metadata_args): call("chmod +x ./paa_singularity.sh", shell=True) call("./paa_singularity.sh", shell=True) call("rm paa_singularity.sh", shell=True) +call("rm -f " + env_outname, shell=True) if no_data_repo: cmd = "rm -rf " + data_repo_d print("Cleaning up data repo")