From aa6d89b49684629f28203fcc6810065d7f0d15ca Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Mon, 31 Jul 2023 14:11:13 +0200 Subject: [PATCH] Better handling when none of the fusions are processable by pVACfuse --- pvactools/lib/pipeline.py | 2 -- pvactools/tools/pvacfuse/run.py | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pvactools/lib/pipeline.py b/pvactools/lib/pipeline.py index 4e262b83c..d9002926f 100644 --- a/pvactools/lib/pipeline.py +++ b/pvactools/lib/pipeline.py @@ -350,7 +350,6 @@ def parse_outputs(self, chunks): for a in self.alleles: for epl in self.epitope_lengths: split_iedb_output_files = [] - status_message("Parsing binding predictions for Allele %s and Epitope Length %s - Entries %s" % (a, epl, fasta_chunk)) for method in self.prediction_algorithms: prediction_class = globals()[method] prediction = prediction_class() @@ -655,7 +654,6 @@ def parse_outputs(self, chunks, length): fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2) for a in self.alleles: split_iedb_output_files = [] - status_message("Parsing binding predictions for Allele %s and Epitope Length %s - Entries %s" % (a, length, fasta_chunk)) for method in self.prediction_algorithms: prediction_class = globals()[method] prediction = prediction_class() diff --git a/pvactools/tools/pvacfuse/run.py b/pvactools/tools/pvacfuse/run.py index 9a0c18b2b..3b56d2aa4 100644 --- a/pvactools/tools/pvacfuse/run.py +++ b/pvactools/tools/pvacfuse/run.py @@ -212,9 +212,10 @@ def main(args_input = sys.argv[1:]): pipeline = PvacbindPipeline(**run_arguments) pipeline.execute() intermediate_output_file = os.path.join(per_epitope_output_dir, "{}.all_epitopes.tsv".format(args.sample_name)) - output_file = os.path.join(per_epitope_output_dir, "{}.all_epitopes.final.tsv".format(args.sample_name)) - append_columns(intermediate_output_file, "{}.tsv".format(input_file), output_file) - output_files.append(output_file) + if os.path.exists(intermediate_output_file): + output_file = os.path.join(per_epitope_output_dir, "{}.all_epitopes.final.tsv".format(args.sample_name)) + append_columns(intermediate_output_file, "{}.tsv".format(input_file), output_file) + output_files.append(output_file) if epitope_length == max(epitope_lengths): # copy fasta to output dir fasta_file = os.path.join(output_dir, "{}.fasta".format(args.sample_name)) @@ -231,10 +232,12 @@ def main(args_input = sys.argv[1:]): #!!! make below call to create_net_class_report #create_combined_reports(output_files, all_epitopes_file, filtered_file, True, args) create_net_class_report(output_files, all_epitopes_file, filtered_file, args, run_arguments) + else: + print("\nNo processable fusions found. Aborting.\n") elif len(prediction_algorithms) == 0: print("No MHC class {} prediction algorithms chosen. Skipping MHC class I predictions.".format(mhc_class)) elif len(alleles) == 0: - print("No MHC class{} alleles chosen. Skipping MHC class I predictions.".format(mhc_class)) + print("No MHC class {} alleles chosen. Skipping MHC class II predictions.".format(mhc_class)) if len(class_i_prediction_algorithms) > 0 and len(class_i_alleles) > 0 and len(class_ii_prediction_algorithms) > 0 and len(class_ii_alleles) > 0: print("Creating combined reports")