From aacdb58b6fbafd691f3c96711a6245c63fe3185e Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Fri, 15 Jun 2012 15:32:19 +0200
Subject: [PATCH] added docs for CopyResidue and friends

---
 modules/conop/doc/aminoacid.rst  | 54 +++++++++++++++++++++++++++++++-
 modules/conop/src/nonstandard.hh | 34 ++++++++++----------
 2 files changed, 70 insertions(+), 18 deletions(-)

diff --git a/modules/conop/doc/aminoacid.rst b/modules/conop/doc/aminoacid.rst
index 2dd39c057..fe42a4c63 100644
--- a/modules/conop/doc/aminoacid.rst
+++ b/modules/conop/doc/aminoacid.rst
@@ -67,4 +67,56 @@ Converter functions
   .. method:: Empty()
   
     Whether the set is empty, i.e. doesn't contain any amino acids.
-    
+
+
+Maping functions
+--------------------------------------------------------------------------------
+
+The following functions help to convert one residue into another by reusing as
+much as possible from the present atoms. They are mainly meant to map from
+standard amino acid to other standard amino acids or from modified amino acids
+to standard amino acids.
+
+.. function:: CopyResidue(src_res, dst_res, editor)
+
+  Copies the atoms of ``src_res`` to ``dst_res`` using the residue names of
+  as guide to decide which of the atoms should be copied. If ``src_res`` and
+  ``dst_res`` have the same name, or ``src_res`` is a modified version of
+  ``dst_res``, CopyConserved will be called, otherwise CopyNonConserved will
+  be called.
+
+  :returns: true if the residue could be copied, false if not.
+
+.. function:: CopyConserved(src_res, dst_res, editor)
+
+  Copies the atoms of ``src_res`` to ``dst_res`` assuming that the parent
+  amino acid of ``src_res`` (or ``src_res`` itself) are identical to ``dst_res``.
+
+  If ``src_res`` and ``dst_res`` are identical, all heavy atoms are copied
+  ``to dst_res``. If ``src_res`` is a modified version of ``dst_res`` and the
+  modification is a pure addition (e.g. the phosphate group of phosphoserine),
+  the modification is stripped off and all other heavy atoms are copied to
+  ``dst_res``. If the modification is not a pure addition, only the backbone
+  heavy atoms are copied to ``dst_res``.
+
+  Additionally, the selenium atom of MSE is converted to sulphur.
+
+  :param src_res: The source residue
+  :type src_res: :class:`~mol.ResidueHandle`
+  :param dst_res: The destination residue
+  :type dst_res: :class:`~mol.ResidueHandle`
+
+  :returns: a tuple of bools stating whether the residue could be copied and
+    whether the Cbeta atom was inserted into the ``dst_res``.
+
+.. function:: CopyNonConserved(src_res, dst_res, editor)
+
+  Copies the heavy backbone atoms of ``src_res`` to ``dst_res``.
+
+  :param src_res: The source residue
+  :type src_res: :class:`~mol.ResidueHandle`
+  :param dst_res: The destination residue
+  :type dst_res: :class:`~mol.ResidueHandle`
+
+  :returns: a tuple of bools stating whether the residue could be copied and
+    whether the Cbeta atom was inserted into the ``dst_res``.
diff --git a/modules/conop/src/nonstandard.hh b/modules/conop/src/nonstandard.hh
index f8ad1cfa3..50a214715 100644
--- a/modules/conop/src/nonstandard.hh
+++ b/modules/conop/src/nonstandard.hh
@@ -37,8 +37,8 @@ namespace ost { namespace conop {
 
                              
 bool DLLEXPORT_OST_CONOP CopyResidue(ost::mol::ResidueHandle src_res,
-                             ost::mol::ResidueHandle dst_res, 
-                             ost::mol::XCSEditor& edi);
+                                     ost::mol::ResidueHandle dst_res,
+                                     ost::mol::XCSEditor& edi);
                              
 /// \brief copies all atom of src_res to dst_res
 /// \param has_cbeta will be set to true if the src_res has a cbeta and the 
@@ -46,9 +46,9 @@ bool DLLEXPORT_OST_CONOP CopyResidue(ost::mol::ResidueHandle src_res,
 
                              
 bool DLLEXPORT_OST_CONOP CopyIdentical(ost::mol::ResidueHandle src_res,
-                             ost::mol::ResidueHandle dst_res, 
-                             ost::mol::XCSEditor& edi, 
-                             bool& has_cbeta);
+                                       ost::mol::ResidueHandle dst_res,
+                                       ost::mol::XCSEditor& edi,
+                                       bool& has_cbeta);
 
 /// \brief copies atoms of src_res to dst_res
 ///
@@ -60,9 +60,9 @@ bool DLLEXPORT_OST_CONOP CopyIdentical(ost::mol::ResidueHandle src_res,
 
                              
 bool DLLEXPORT_OST_CONOP CopyConserved(ost::mol::ResidueHandle src_res, 
-                             ost::mol::ResidueHandle dst_res, 
-                             ost::mol::XCSEditor& edi,
-                             bool& has_cbeta);
+                                       ost::mol::ResidueHandle dst_res,
+                                       ost::mol::XCSEditor& edi,
+                                       bool& has_cbeta);
 
 /// \brief construct dst_res in case src_res and dst_res are not conserved.
 /// 
@@ -71,24 +71,24 @@ bool DLLEXPORT_OST_CONOP CopyConserved(ost::mol::ResidueHandle src_res,
 
 
 bool DLLEXPORT_OST_CONOP CopyNonConserved(ost::mol::ResidueHandle src_res, 
-                                ost::mol::ResidueHandle dst_res, 
-                                ost::mol::XCSEditor& edi, 
-                                bool& has_cbeta);
+                                          ost::mol::ResidueHandle dst_res,
+                                          ost::mol::XCSEditor& edi,
+                                          bool& has_cbeta);
 
 /// \brief construct dst_res from src_res when src_res is an MSE
 
 bool DLLEXPORT_OST_CONOP CopyMSE(ost::mol::ResidueHandle src_res, 
-                       ost::mol::ResidueHandle dst_res, 
-                       ost::mol::XCSEditor& edi, 
-                       bool& has_cbeta);
+                                 ost::mol::ResidueHandle dst_res,
+                                 ost::mol::XCSEditor& edi,
+                                 bool& has_cbeta);
                        
 /// \brief construct a dst_res with only atoms matching the standard aminoacid
 /// from src_res when src_res is an is modified
                             
 bool DLLEXPORT_OST_CONOP CopyModified(ost::mol::ResidueHandle src_res, 
-                            ost::mol::ResidueHandle dst_res, 
-                            ost::mol::XCSEditor& edi, 
-                            bool& has_cbeta);
+                                      ost::mol::ResidueHandle dst_res,
+                                      ost::mol::XCSEditor& edi,
+                                      bool& has_cbeta);
 
 
 
-- 
GitLab