sadsadasd
authorMax <Infinity2573@gmail.com>
Mon, 19 Sep 2022 16:16:20 +0000 (19:16 +0300)
committerMax <Infinity2573@gmail.com>
Mon, 19 Sep 2022 16:16:20 +0000 (19:16 +0300)
src/dssptools.cpp

index 379be765764503084d7ea3864505140222cc4915..80548472cb1767d7b76b45da07811e49b048f3ff 100644 (file)
@@ -146,18 +146,23 @@ bool secondaryStructures::hasHBondBetween(std::size_t Donor, std::size_t Accepto
 
 bool secondaryStructures::NoChainBreaksBetween(std::size_t Resi1, std::size_t Resi2) const{
     bool flag{true};
+    std::size_t i{};
     if ( Resi1 < Resi2){
-        for (; Resi1 != Resi2; ++Resi1){
-            flag = !SecondaryStructuresStatusMap[Resi1].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi1 + 1]) || !SecondaryStructuresStatusMap[Resi1 + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi1]);
-        }
+        i = Resi1;
     }
     else if ( Resi1 > Resi2) {
-        for (; Resi2 != Resi1; ++Resi2){
-            flag = !SecondaryStructuresStatusMap[Resi2].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi2 + 1]) || !SecondaryStructuresStatusMap[Resi2 + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[Resi2]);
-        }
+        i = Resi2;
+    }
+    else{
+        return true;
     }
+
+    for (; i != Resi2; ++i){
+        flag = !(SecondaryStructuresStatusMap[i].isBreakPartnerWith(&SecondaryStructuresStatusMap[i + 1]) || SecondaryStructuresStatusMap[i + 1].isBreakPartnerWith(&SecondaryStructuresStatusMap[i]));
+    }
+
     if (!flag){
-        std::cout << "Chainbreak between " << Resi1 << " and " << Resi2 << std::endl;
+        std::cout << "Patternsearch has detected a CHAINBREAK between " << Resi1 << " and " << Resi2 << std::endl;
     }
     return flag;
 }