diff --git a/rptools/rpscore/__main__.py b/rptools/rpscore/__main__.py index 19df071..ecc9f73 100644 --- a/rptools/rpscore/__main__.py +++ b/rptools/rpscore/__main__.py @@ -6,7 +6,10 @@ Logger, getLogger ) -from os import path as os_path +from os import ( + path as os_path, + makedirs as os_makedirs +) from .rpscore import ( predict_score, ThermoError, @@ -81,6 +84,8 @@ def entry_point(): # Write results into the pathway pathway.set_global_score(score) # Write pathway into file + # Create the output directory if not exists + os_makedirs(os_path.dirname(args.outfile), exist_ok=True) pathway.to_rpSBML().write_to_file( args.outfile )