From c794b5992dd8ba073f7aa4c60455e968fe797bbf Mon Sep 17 00:00:00 2001 From: rhysnewell Date: Mon, 15 Jan 2024 03:31:22 +0000 Subject: [PATCH] fix: symlinks point to wrong location --- aviary/modules/binning/scripts/finalise_recovery.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aviary/modules/binning/scripts/finalise_recovery.py b/aviary/modules/binning/scripts/finalise_recovery.py index 72c052e6..444f7aa1 100644 --- a/aviary/modules/binning/scripts/finalise_recovery.py +++ b/aviary/modules/binning/scripts/finalise_recovery.py @@ -6,9 +6,10 @@ def check_and_remove_base_file(file_path) -> str: file_name = os.path.basename(file_path) if os.path.exists(file_name): os.remove(file_name) - + return file_name + if __name__ == '__main__': final_bins = snakemake.input.final_bins coverage_file = snakemake.input.coverm @@ -32,10 +33,10 @@ def check_and_remove_base_file(file_path) -> str: os.chdir('..') if len(gtdbtk) > 0: check_and_remove_base_file(output_taxonomy) - os.symlink(f"{gtdbtk}", output_taxonomy) + os.symlink(f"{os.path.dirname(gtdbtk)}", output_taxonomy) if len(singlem) > 0: check_and_remove_base_file(output_singlem) - os.symlink(f"{singlem}", output_singlem) + os.symlink(f"{os.path.dirname(singlem)}", output_singlem) for f in glob.glob('data/binning_bams/*.ba*'): os.remove(f)