From 98b5cfd7981ce47d398e980efe69688f1f7127e4 Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Tue, 10 May 2022 15:39:16 +0200
Subject: [PATCH] export is_nucleotide attribute for residues

---
 modules/mol/base/doc/entity.rst          | 11 +++++++++++
 modules/mol/base/pymod/export_residue.cc |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst
index aeb18459f..c0ff8b8c1 100644
--- a/modules/mol/base/doc/entity.rst
+++ b/modules/mol/base/doc/entity.rst
@@ -701,6 +701,13 @@ The Handle Classes
 
     :type: :class:`bool`
 
+  .. attribute:: nucleotide_linking
+  
+    Whether residue can form nucleotide bonds. This is determined based on
+    :attr:`chem_class` which is set when loading the structure.
+
+    :type: :class:`bool`
+
   .. attribute:: index
 
     Residue index (starting at 0) within chain.
@@ -797,6 +804,10 @@ The Handle Classes
   .. method:: IsPeptideLinking()
 
     See :attr:`peptide_linking`
+
+  .. method:: IsNucleotideLinking()
+
+    See :attr:`nucleotide_linking`
     
   .. method:: GetChain()
   
diff --git a/modules/mol/base/pymod/export_residue.cc b/modules/mol/base/pymod/export_residue.cc
index a8d652217..d4b741d3b 100644
--- a/modules/mol/base/pymod/export_residue.cc
+++ b/modules/mol/base/pymod/export_residue.cc
@@ -193,6 +193,8 @@ void export_Residue()
     .add_property("qualified_name", &ResidueBase::GetQualifiedName)
     .def("IsPeptideLinking", &ResidueBase::IsPeptideLinking)
     .add_property("peptide_linking", &ResidueBase::IsPeptideLinking)
+    .def("IsNucleotideLinking", &ResidueBase::IsNucleotideLinking)
+    .add_property("nucleotide_linking", &ResidueBase::IsNucleotideLinking)
     
     .def("GetCentralAtom", &ResidueBase::GetCentralAtom)
     .def("SetCentralAtom", &ResidueBase::SetCentralAtom)
-- 
GitLab