From daf36b3ecbf24910ea0567de77a4799fe0fc37ce Mon Sep 17 00:00:00 2001
From: Xavier Robin <xavier.robin@unibas.ch>
Date: Fri, 10 Feb 2023 16:38:09 +0100
Subject: [PATCH] doc: SCHWED-5783 ligand assigment

---
 modules/mol/alg/pymod/ligand_scoring.py | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/mol/alg/pymod/ligand_scoring.py b/modules/mol/alg/pymod/ligand_scoring.py
index 97d4dcd6a..e40fa9e16 100644
--- a/modules/mol/alg/pymod/ligand_scoring.py
+++ b/modules/mol/alg/pymod/ligand_scoring.py
@@ -570,9 +570,28 @@ class LigandScorer:
 
     def _assign_matrices(self, mat1, mat2, data, main_key):
         """
+        Perform the ligand assignment, ie find the mapping between model and
+        target ligands.
+
+        The algorithm starts by assigning the "best" mapping, and then discards
+        the target and model ligands (row, column) so that every model ligand
+        can be assigned to a single target ligand, and every target ligand
+        is only assigned to a single model ligand. Repeat until there is
+        nothing left to assign.
+
+        In case of a tie in values in `mat1`, it uses `mat2` to break the tie.
+
+        This algorithm doesn't guarantee a globally optimal assignment.
+
+        Both `mat1` and `mat2` should contain values between 0 and infinity,
+        with lower values representing better scores. Use the
+        :meth:`_reverse_lddt` method to convert lDDT values to such a score.
+
         :param mat1: the main ligand assignment criteria (RMSD or lDDT-PLI)
-        :param mat2:  the secondary ligand assignment criteria (lDDT-PLI or RMSD)
-        :param data: the data (either self._rmsd_full_matrix or self._lddt_pli_matrix
+        :param mat2: the secondary ligand assignment criteria (lDDT-PLI or RMSD)
+        :param data: the data (either self._rmsd_full_matrix or self._lddt_pli_matrix)
+        :param main_key: the key of data (dictionnaries within `data`) to
+               assign into out_main.
         :return: a tuple with 2 dictionaries of matrices containing the main
                  data, and details, respectively.
         """
-- 
GitLab