From e879a641ed96b50d90f546d641e9270de1522c3c Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Tue, 6 Aug 2024 21:58:56 +0200
Subject: [PATCH] comparison actions: add ost version to json out

---
 actions/ost-compare-ligand-structures | 4 +++-
 actions/ost-compare-structures        | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/actions/ost-compare-ligand-structures b/actions/ost-compare-ligand-structures
index 112f8deaa..bd7631f5b 100644
--- a/actions/ost-compare-ligand-structures
+++ b/actions/ost-compare-ligand-structures
@@ -35,7 +35,7 @@ are exempt from this restriction, meaning any arbitrary ligand can be assessed.
 Output can be written in two format: JSON (default) or CSV, controlled by the
 --output-format/-of argument.
 
-Without additional options, the JSON ouput is a dictionary with three keys:
+Without additional options, the JSON ouput is a dictionary with four keys:
 
  * "model_ligands": A list of ligands in the model. If ligands were provided
    explicitly with --model-ligands, elements of the list will be the paths to
@@ -48,6 +48,7 @@ Without additional options, the JSON ouput is a dictionary with three keys:
  * "status": SUCCESS if everything ran through. In case of failure, the only
    content of the JSON output will be \"status\" set to FAILURE and an
    additional key: "traceback".
+ * "ost_version": The OpenStructure version used for computation.
 
 Each score is opt-in and the respective results are available in three keys:
 
@@ -850,6 +851,7 @@ def _Main():
                        cleaned_reference, cleaned_reference_ligands,
                        args)
 
+        out["ost_version"] = ost.__version__
         out["status"] = "SUCCESS"
         if args.output_format == "json":
             with open(args.output, 'w') as fh:
diff --git a/actions/ost-compare-structures b/actions/ost-compare-structures
index ff6115285..a93452aae 100644
--- a/actions/ost-compare-structures
+++ b/actions/ost-compare-structures
@@ -61,6 +61,7 @@ results:
  * "min_nuc_length"
  * "lddt_add_mdl_contacts"
  * "dockq_capri_peptide"
+ * "ost_version"
 
 The pairwise sequence alignments are computed with Needleman-Wunsch using
 BLOSUM62 (NUC44 for nucleotides). Many benchmarking scenarios preprocess the
@@ -963,6 +964,7 @@ def _Main():
         out["min_nuc_length"] = args.min_nuc_length
         out["lddt_add_mdl_contacts"] = args.lddt_add_mdl_contacts
         out["dockq_capri_peptide"] = args.dockq_capri_peptide
+        out["ost_version"] = ost.__version__
         out["status"] = "SUCCESS"
         with open(args.output, 'w') as fh:
             json.dump(out, fh, indent=4, sort_keys=False)
-- 
GitLab