From ab68e3e16c0b91d72f710d8eba77bb0f357faafa Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Wed, 28 Aug 2024 18:39:09 +0200
Subject: [PATCH] compare-structures: add rigid scores specific chain mapping
 in json output

---
 actions/ost-compare-structures | 6 +++++-
 modules/doc/actions.rst        | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/actions/ost-compare-structures b/actions/ost-compare-structures
index 0318a826c..9a466ce05 100644
--- a/actions/ost-compare-structures
+++ b/actions/ost-compare-structures
@@ -454,7 +454,10 @@ def _ParseArgs():
               "8.0] given these positions and transformation, \"oligo_gdtha\": "
               "same with thresholds [0.5, 1.0, 2.0, 4.0], \"rmsd\": RMSD given "
               "these positions and transformation, \"transform\": the used 4x4 "
-              "transformation matrix that superposes model onto reference."))
+              "transformation matrix that superposes model onto reference, "
+              "\"rigid_chain_mapping\": equivalent of \"chain_mapping\" which "
+              "is used for rigid scores (optimized for RMSD instead of "
+              "QS-score/lDDT)."))
 
     parser.add_argument(
         "--patch-scores",
@@ -895,6 +898,7 @@ def _Process(model, reference, args, model_format, reference_format):
         out["rmsd"] = _RoundOrNone(scorer.rmsd)
         data = scorer.rigid_transform.data
         out["transform"] = [data[i:i + 4] for i in range(0, len(data), 4)]
+        out["rigid_chain_mapping"] = scorer.rigid_mapping.GetFlatMapping()
 
     if args.patch_scores:
         out["model_interface_residues"] = \
diff --git a/modules/doc/actions.rst b/modules/doc/actions.rst
index fb5c7b9a0..d1794c49c 100644
--- a/modules/doc/actions.rst
+++ b/modules/doc/actions.rst
@@ -348,7 +348,9 @@ Details on the usage (output of ``ost compare-structures --help``):
                           thresholds [0.5, 1.0, 2.0, 4.0], "rmsd": RMSD given
                           these positions and transformation, "transform": the
                           used 4x4 transformation matrix that superposes model
-                          onto reference.
+                          onto reference, "rigid_chain_mapping": equivalent of
+                          "chain_mapping" which is used for rigid scores
+                          (optimized for RMSD instead of QS-score/lDDT).
     --patch-scores        Local interface quality score used in CASP15. Scores
                           each model residue that is considered in the interface
                           (CB pos within 8A of any CB pos from another chain (CA
-- 
GitLab