From ff4cdf009901c7d41425da2449b0caf8e6028365 Mon Sep 17 00:00:00 2001
From: Gerardo Tauriello <gerardo.tauriello@unibas.ch>
Date: Tue, 25 Jul 2017 16:02:55 +0200
Subject: [PATCH] Exported and documented ResidueHandle.is_protein

---
 modules/conop/doc/connectivity.rst       |  8 +++++---
 modules/mol/base/doc/entity.rst          | 11 +++++++++--
 modules/mol/base/doc/query.rst           |  5 ++---
 modules/mol/base/pymod/export_residue.cc |  4 ++++
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/modules/conop/doc/connectivity.rst b/modules/conop/doc/connectivity.rst
index 6fba126c2..636b8a710 100644
--- a/modules/conop/doc/connectivity.rst
+++ b/modules/conop/doc/connectivity.rst
@@ -60,9 +60,11 @@ The Processor base class
 
   .. attribute:: connect
 
-    Whether to connect atoms by bonds. Enabled by default. Turn this off if you
-    would like to speed up the loading process and do not require connectivity
-    information to be present in your structures.
+    Whether to connect atoms by bonds. Enabled by default. This also sets the
+    :attr:`~ost.mol.ResidueHandle.is_protein` property of residues when peptide
+    bonds are created. Turn this off if you would like to speed up the loading
+    process and do not require connectivity information to be present in your
+    structures.
 
     :type: :class:`bool`
 
diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst
index a9d2315f6..c3dd84b40 100644
--- a/modules/mol/base/doc/entity.rst
+++ b/modules/mol/base/doc/entity.rst
@@ -538,7 +538,14 @@ The Handle Classes
     Whether the residue is a ligand. When loading PDB structures, this property 
     is set based on the HET records. This also means, that this property will 
     most likely not be set properly for all except PDB files coming from 
-    pdb.org.
+    pdb.org. Also available as :meth:`IsLigand`, :meth:`SetIsLigand`.
+  
+  .. attribute:: is_protein
+  
+    Whether the residue is considered to be part of a protein. This is set when
+    loading a structure if the residue forms a feasible peptide bond to the
+    previous or next residue (see :meth:`~ost.conop.IsBondFeasible`). Also
+    available as :meth:`IsProtein`, :meth:`SetIsProtein`.
 
   .. attribute:: index
 
@@ -658,7 +665,7 @@ The Handle Classes
   .. attribute:: occupancy
   
     The atom's occupancy in the range 0 to 1. Read/write. Also available as 
-    meth:`GetOccupancy`, :meth:`SetOccupancy`.
+    :meth:`GetOccupancy`, :meth:`SetOccupancy`.
     :type: float
     
   .. attribute:: b_factor
diff --git a/modules/mol/base/doc/query.rst b/modules/mol/base/doc/query.rst
index c33b462e0..baa08d3fe 100644
--- a/modules/mol/base/doc/query.rst
+++ b/modules/mol/base/doc/query.rst
@@ -195,9 +195,8 @@ This index is the same for views and handles.
 **peptide** (bool): Whether the residue is :meth:`peptide linking
 <ResidueHandle.IsPeptideLinking>`.
 
-**protein** (bool): Whether the residue is considered to be part of a protein.
-This is set when loading a structure if the residue forms a feasible peptide
-bond to the previous or next residue.
+**protein** (bool): Whether the residue is considered to be
+:attr:`part of a protein <ResidueHandle.is_protein>`.
 
 **rbfac** (float): average B (temperature) factor of residue
 
diff --git a/modules/mol/base/pymod/export_residue.cc b/modules/mol/base/pymod/export_residue.cc
index 0108f5342..60566cfa5 100644
--- a/modules/mol/base/pymod/export_residue.cc
+++ b/modules/mol/base/pymod/export_residue.cc
@@ -202,6 +202,10 @@ void export_Residue()
     .add_property("is_ligand", &ResidueBase::IsLigand, &ResidueBase::SetIsLigand)
     .def("IsLigand", &ResidueBase::IsLigand)
     .def("SetIsLigand", &ResidueBase::SetIsLigand)
+    .add_property("is_protein", &ResidueBase::IsProtein,
+                                &ResidueBase::SetIsProtein)
+    .def("IsProtein", &ResidueBase::IsProtein)
+    .def("SetIsProtein", &ResidueBase::SetIsProtein)
     .add_property("number",
                    make_function(&ResidueBase::GetNumber,
                                  return_value_policy<copy_const_reference>()))
-- 
GitLab