From d3217450da1e4a7a34e6406694e3f292b0673a33 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Thu, 19 Feb 2026 12:03:51 +0100 Subject: [PATCH] symlink hsp result if there in only one for one reference this simplifies automatic processing by external software like Galaxy easier. otherwise one would need to implement additional logic to detect this case. --- picrust2/pipeline.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/picrust2/pipeline.py b/picrust2/pipeline.py index 0a22ef8..2a40f63 100755 --- a/picrust2/pipeline.py +++ b/picrust2/pipeline.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from os import path +from os import path, symlink import sys from picrust2.default import (default_ref_dir_bac, default_ref_dir_arc, default_tables_bac, default_tables_arc, default_pathway_map) @@ -370,13 +370,15 @@ def full_pipeline_split(study_fasta, for pred in predicted_funcs_split: if func in pred: combining.append(pred) - + + out_file = path.join(output_folder, "combined_" + func + "_predicted.tsv.gz") if len(combining) == 1: predicted_funcs[func] = predicted_funcs_split[combining[0]] print("Warning: There was only one file for the function: "+ func + "\n" "Maybe that's fine if you used custom traits or there were no sequences " "matching one of the domains.", file=sys.stderr) - + os.symlink(predicted_funcs[func], out_file) + elif len(combining) > 2: sys.exit("More than two files were available for the function: " + func +"\n" "If you are using your own custom trait files, please check that you " @@ -384,7 +386,6 @@ def full_pipeline_split(study_fasta, else: print(combining, predicted_funcs_split) - out_file = path.join(output_folder, "combined_" + func + "_predicted.tsv.gz") combine_domain_predictions(predicted_funcs_split[combining[0]], predicted_funcs_split[combining[1]], out_file,