From f15405a0495860ee600c7c0445d4f78686ac7431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Fri, 29 May 2015 11:52:19 +0200 Subject: [PATCH 1/4] FullName option show residue's insertion code --- source/KERNEL/residue.C | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/KERNEL/residue.C b/source/KERNEL/residue.C index f2bbe1afa4..4fe9aa7f72 100644 --- a/source/KERNEL/residue.C +++ b/source/KERNEL/residue.C @@ -555,6 +555,11 @@ namespace BALL { full_name += String(getID()); } + if (BALL_RESIDUE_DEFAULT_INSERTION_CODE != insertion_code_ && + (type == ADD_RESIDUE_ID_AND_INSERTION_CODE || type == ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE)) + { + full_name += String(getInsertionCode()); + } return full_name; } From 23b79a7e02dd2f249b07efb42d2f7cb5e77cddfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Fri, 29 May 2015 12:07:15 +0200 Subject: [PATCH 2/4] residue.h Added InsertionCode FullName types Also got doxygen helped which was erratic on a separation of the ID with a colon. --- include/BALL/KERNEL/residue.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/BALL/KERNEL/residue.h b/include/BALL/KERNEL/residue.h index 962118e402..eb6899eae3 100644 --- a/include/BALL/KERNEL/residue.h +++ b/include/BALL/KERNEL/residue.h @@ -79,10 +79,14 @@ namespace BALL NO_VARIANT_EXTENSIONS, /// Add the residue variant extensions (e.g. '-C' for C-terminal residues) ADD_VARIANT_EXTENSIONS, - // Add the residue ID separated by a colon - ADD_RESIDUE_ID, - // Add the residue ID and the residue extension - ADD_VARIANT_EXTENSIONS_AND_ID + /// Add the residue ID, expected to be numeric, directly following the residue name + ADD_RESIDUE_ID, + /// Add the residue ID right after the residue extension (if available) or the name (otherwise). + ADD_VARIANT_EXTENSIONS_AND_ID, + /// After the residue ID show the insertion code + ADD_RESIDUE_ID_AND_INSERTION_CODE, + /// All: show the residue name with its optional extension, then the ID with its optional insertion code and the residue extension + ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE }; //@} From 624bbf775f32a0e5d7c1951a1131715932c19019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Fri, 29 May 2015 12:17:40 +0200 Subject: [PATCH 3/4] updated FullnameType in residue.sip also now falling back to getFullName method --- source/PYTHON/EXTENSIONS/BALL/residue.sip | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/PYTHON/EXTENSIONS/BALL/residue.sip b/source/PYTHON/EXTENSIONS/BALL/residue.sip index bd9f415668..6bb8286d2e 100644 --- a/source/PYTHON/EXTENSIONS/BALL/residue.sip +++ b/source/PYTHON/EXTENSIONS/BALL/residue.sip @@ -24,10 +24,15 @@ class Residue PROPERTY__CYCLIC, NUMBER_OF_PROPERTIES }; + // following the definition of FullNameType in BALL/KERNEL/residue.h enum FullNameType { NO_VARIANT_EXTENSIONS, - ADD_VARIANT_EXTENSIONS + ADD_VARIANT_EXTENSIONS, + ADD_RESIDUE_ID, + ADD_VARIANT_EXTENSIONS_AND_ID, + ADD_RESIDUE_ID_AND_INSERTION_CODE, + ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE }; Residue(); Residue(const Residue&, bool deep = true); @@ -86,7 +91,9 @@ class Residue SIP_PYOBJECT __str__(); %MethodCode - sipRes = PyString_FromString(String(String("Residue ") + sipCpp->getName() + sipCpp->getID() - + " { " + String(sipCpp->countAtoms()) + " atoms }").c_str()); + sipRes = PyString_FromString(String( + String("Residue ") + + sipCpp->getFullName(ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE) + + " { " + String(sipCpp->countAtoms()) + " atoms }").c_str()); %End }; From fc939e143e8aa99e677761ffcb6cff4caaaed06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Fri, 5 Jun 2015 17:08:58 +0200 Subject: [PATCH 4/4] Fixing python.sip build, adapting string rep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The enum element ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE was not seen, so it became the default. /homeLvm/moeller/alioth/debian-med-git/ball/source/PYTHON/EXTENSIONS/BALL/residue.sip: In function âObject* slot_Residue___str__(PyObject*)â/homeLvm/moeller/alioth/debian-med-git/ball/source/PYTHON/EXTENSIONS/BALL/residue.sip:96:51: error: âD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODEâas not declared in this scope + sipCpp->getFullName(ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE) --- source/PYTHON/EXTENSIONS/BALL/residue.sip | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/PYTHON/EXTENSIONS/BALL/residue.sip b/source/PYTHON/EXTENSIONS/BALL/residue.sip index 6bb8286d2e..e1168aae16 100644 --- a/source/PYTHON/EXTENSIONS/BALL/residue.sip +++ b/source/PYTHON/EXTENSIONS/BALL/residue.sip @@ -46,7 +46,7 @@ class Residue // Residue& operator = (const Residue& residue); void get(Residue&, bool deep = true) const; void swap(Residue&); - String getFullName(FullNameType type = ADD_VARIANT_EXTENSIONS) const; + String getFullName(FullNameType type = ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE) const; bool hasTorsionPhi() const; Angle getTorsionPhi() const; bool hasTorsionPsi() const; @@ -93,7 +93,7 @@ class Residue %MethodCode sipRes = PyString_FromString(String( String("Residue ") - + sipCpp->getFullName(ADD_VARIANT_EXTENSIONS_AND_ID_AND_INSERTION_CODE) + + sipCpp->getFullName() + " { " + String(sipCpp->countAtoms()) + " atoms }").c_str()); %End };