Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions picrust2/pipeline.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -370,21 +370,22 @@ 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 "
"have not given the same table more than once for a domain.")

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,
Expand Down