From 042481fe16869a080f9a835f4cd0bd9ed8c697ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20H=C3=A9risson?= Date: Tue, 16 Dec 2025 00:35:14 +0100 Subject: [PATCH] feat(rpscore): create output dir if does not exist --- rptools/rpscore/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 )