Skip to content

Commit

Permalink
cleanup fix
Browse files Browse the repository at this point in the history
  • Loading branch information
babessell1 committed Jun 2, 2024
1 parent 5ff5ece commit 52963a4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions run_melt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ cleanup() {

# Remove CRAM files and associated output as well as:
# rename the vcf to have the {subject_name}.vcf
mv "${out}/SVA.final_comp.vcf" "${bname}.vcf"
mv "${out}/SVA.final_comp.vcf" "${out}/${bname}.vcf"

# make a text file saying the file finished moving (safegaurd for spot instance termination)
echo "moved" > "${bname}_moved.txt"

# remove all other files and directories
rm -f -r "${out}"

}


Expand Down Expand Up @@ -144,12 +141,12 @@ if [ "$task1_status" -ne 0 ] || [ "$task2_status" -ne 0 ]; then
# Determine which task failed and create a TAR for the successful task
if [ "$task1_status" -eq 0 ]; then # task 1 succeeded, only create a TAR for task 1
echo "Task 1 failed. Creating TAR for $name1 only..."
tar cf "out/${name1}.tar" "${bname1}.vcf"
tar cf "out/${name1}.tar" "output1/${bname1}.vcf"
# exit with a pass to ensure tibanna will take what it can get
exit 0
elif [ "$task2_status" -eq 0 ]; then # task 2 succeeded, only create a TAR for task 2
echo "Task 2 failed. Creating TAR for $name2 only..."
tar cf "out/${name2}.tar" "${bname2}.vcf"
tar cf "out/${name2}.tar" "output2/${bname2}.vcf"
# exit with a pass to ensure tibanna will take what it can get
exit 0
else
Expand All @@ -162,8 +159,13 @@ fi
# Both tasks succeeded, create a TAR with outputs
echo "${name1}___${name2}.tar"

# move vcfs to output directory
mv "output1/${bname1}.vcf" "output/${name1}.vcf"
mv "output2/${bname2}.vcf" "output/${name2}.vcf"

# print the contents of the current directory
echo "current directory"
echo "$(ls)"

tar cf "out/${name1}___${name2}.tar" "${bname1}.vcf" "${bname2}.vcf"
# tar the output directory
tar cf "out/${name1}___${name2}.tar" "output"

0 comments on commit 52963a4

Please sign in to comment.