Skip to content

Commit

Permalink
make paa_envs filename more unique
Browse files Browse the repository at this point in the history
  • Loading branch information
jluebeck committed Jun 2, 2023
1 parent 7f57b92 commit d374662
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PrepareAA.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions singularity/run_paa_singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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")
Expand Down

0 comments on commit d374662

Please sign in to comment.