Skip to content

Commit

Permalink
Merge pull request #325 from griffithlab/netmhccons_error
Browse files Browse the repository at this point in the history
Retry making prediction if NetMHCcons throws `len(peptide_list) != len(scores)` error
  • Loading branch information
susannasiebert committed Apr 24, 2019
2 parents b1f7dd8 + 26cd5ae commit 809ad13
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/call_iedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ def main(args_input = sys.argv[1:]):

prediction_class = getattr(sys.modules[__name__], args.method)
prediction_class_object = prediction_class()
(response_text, output_mode) = prediction_class_object.predict(args.input_file, args.allele, args.epitope_length, args.iedb_executable_path, args.iedb_retries)

try:
(response_text, output_mode) = prediction_class_object.predict(args.input_file, args.allele, args.epitope_length, args.iedb_executable_path, args.iedb_retries)
except Exception as err:
if str(err) == 'len(peptide_list) != len(scores)':
(response_text, output_mode) = prediction_class_object.predict(args.input_file, args.allele, args.epitope_length, args.iedb_executable_path, args.iedb_retries)
else:
raise err

tmp_output_file = args.output_file + '.tmp'
if output_mode == 'pandas':
Expand Down

0 comments on commit 809ad13

Please sign in to comment.