asdsad
authorMax <Infinity2573@gmail.com>
Mon, 29 Aug 2022 23:04:34 +0000 (02:04 +0300)
committerMax <Infinity2573@gmail.com>
Mon, 29 Aug 2022 23:04:34 +0000 (02:04 +0300)
src/dssptools.cpp

index 6b407fcc6498bec034dc00e34a8c119815341508..3442810c9a3dfc17fc7182c24fe3855466f5379b 100644 (file)
@@ -744,20 +744,6 @@ void DsspTool::initAnalysis(/*const TrajectoryAnalysisSettings &settings,*/const
            if( proLINE.compare("PRO") == 0 ){
                IndexMap[i].is_proline = true;
            }
-           IndexMap[i].prevResi = &(IndexMap[i - 1]);
-
-           IndexMap[i - 1].nextResi = &(IndexMap[i]);
-
-//           std::cout << "Resi " << IndexMap[i].info->nr << *(IndexMap[i].info->name) << std::endl;
-//           std::cout << "Prev resi is " << IndexMap[i].prevResi->info->nr << *(IndexMap[i].prevResi->info->name) << std::endl;
-//           std::cout << "Prev resi's next resi is " << IndexMap[i - 1].nextResi->info->nr << *(IndexMap[i - 1].nextResi->info->name) << std::endl;
-             std::cout << IndexMap[i].prevResi->info->nr;
-             std::cout << *(IndexMap[i - 1].prevResi->info->name) ;
-             std::cout << " have CA = " << IndexMap[i].prevResi->getIndex(backboneAtomTypes::AtomCA) ;
-             std::cout << " C = " << IndexMap[i].prevResi->getIndex(backboneAtomTypes::AtomC);
-             std::cout << " O = " << IndexMap[i].prevResi->getIndex(backboneAtomTypes::AtomO);
-             std::cout << " N = " << IndexMap[i].prevResi->getIndex(backboneAtomTypes::AtomN);
-             std::cout << " H = " << IndexMap[i].prevResi->getIndex(backboneAtomTypes::AtomH) << std::endl;
 
        }
        std::string atomname(*(top.atoms()->atomname[static_cast<std::size_t>(*ai)]));
@@ -787,6 +773,23 @@ void DsspTool::initAnalysis(/*const TrajectoryAnalysisSettings &settings,*/const
 //           std::cout << "Atom " << atomname << " №" << *ai << " From Resi " << *(top.atoms()->resinfo[i].name) << " №" << resicompare << std::endl;
 //       }
    }
+
+   for (std::size_t j {1}; j < IndexMap.size(); ++j){
+       IndexMap[j].prevResi = &(IndexMap[j - 1]);
+
+       IndexMap[j - 1].nextResi = &(IndexMap[j]);
+
+//           std::cout << "Resi " << IndexMap[i].info->nr << *(IndexMap[i].info->name) << std::endl;
+//           std::cout << "Prev resi is " << IndexMap[i].prevResi->info->nr << *(IndexMap[i].prevResi->info->name) << std::endl;
+//           std::cout << "Prev resi's next resi is " << IndexMap[i - 1].nextResi->info->nr << *(IndexMap[i - 1].nextResi->info->name) << std::endl;
+         std::cout << IndexMap[j].prevResi->info->nr;
+         std::cout << *(IndexMap[j].prevResi->info->name) ;
+         std::cout << " have CA = " << IndexMap[j].prevResi->getIndex(backboneAtomTypes::AtomCA) ;
+         std::cout << " C = " << IndexMap[j].prevResi->getIndex(backboneAtomTypes::AtomC);
+         std::cout << " O = " << IndexMap[j].prevResi->getIndex(backboneAtomTypes::AtomO);
+         std::cout << " N = " << IndexMap[j].prevResi->getIndex(backboneAtomTypes::AtomN);
+         std::cout << " H = " << IndexMap[j].prevResi->getIndex(backboneAtomTypes::AtomH) << std::endl;
+   }
 }
 
 void DsspTool::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc)