Fix gmx do_dssp CHARMM support
authorPaul Bauer <paul.bauer.q@gmail.com>
Wed, 11 Nov 2020 14:36:20 +0000 (15:36 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 11 Nov 2020 14:38:32 +0000 (15:38 +0100)
The tool would not work correctly due to issues with detecting some
oxygen molecules.

Fixes #3568

docs/release-notes/2020/2020.5.rst
src/gromacs/gmxana/gmx_do_dssp.cpp

index 5b4ac5b5af0868034ee5805b4e09d055aa78ea7b..cfe31a2d33b70ec1a5045803c7712742c4b40319 100644 (file)
@@ -55,6 +55,11 @@ combination of temperature / pressure coupling algorithms.
 Fixes for ``gmx`` tools
 ^^^^^^^^^^^^^^^^^^^^^^^
 
+Improve CHARMM support in gmx do_dssp
+"""""""""""""""""""""""""""""""""""""
+
+:issue:`3568`
+
 Fixes that affect portability
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
index f47b978ed5c1ddf39b5ca2fc7dec6150f83ad540..0d31a64b3aa671d72bf0d126e8cc12f9f3e72da2 100644 (file)
@@ -258,23 +258,14 @@ static gmx_bool* bPhobics(t_atoms* atoms)
 
 static void check_oo(t_atoms* atoms)
 {
-    char* OOO;
+    char* OOO = gmx_strdup("O");
 
-    int i;
-
-    OOO = gmx_strdup("O");
-
-    for (i = 0; (i < atoms->nr); i++)
+    for (int i = 0; (i < atoms->nr); i++)
     {
-        if (std::strcmp(*(atoms->atomname[i]), "OXT") == 0)
-        {
-            *atoms->atomname[i] = OOO;
-        }
-        else if (std::strcmp(*(atoms->atomname[i]), "O1") == 0)
-        {
-            *atoms->atomname[i] = OOO;
-        }
-        else if (std::strcmp(*(atoms->atomname[i]), "OC1") == 0)
+        if ((std::strcmp(*(atoms->atomname[i]), "OXT") == 0)
+            || (std::strcmp(*(atoms->atomname[i]), "O1") == 0)
+            || (std::strcmp(*(atoms->atomname[i]), "OC1") == 0)
+            || (std::strcmp(*(atoms->atomname[i]), "OT1") == 0))
         {
             *atoms->atomname[i] = OOO;
         }