changed traj save
authorAnatoly Titov <toluk@omrb.pnpi.spb.ru>
Mon, 4 Feb 2019 23:12:51 +0000 (02:12 +0300)
committerAnatoly Titov <toluk@omrb.pnpi.spb.ru>
Mon, 4 Feb 2019 23:12:51 +0000 (02:12 +0300)
src/fitng.cpp

index c317860a03a67a93d2a27dadae399009884b6640..6c30431ed31bacd72ebb225ed8a371ef6d15220b 100644 (file)
@@ -289,12 +289,13 @@ void MyFitNew (std::vector< RVec > a, std::vector< RVec > &b, std::vector< std::
 void printPDBtraj(const char* Fname, std::vector< std::vector < RVec > > trj, std::vector< std::vector< std::pair< int, int > > > prs, std::vector< int > ndx) {
     FILE* a = freopen (Fname, "w", stdout);
     for (int i = 1; i < trj.size(); i++) {
+        fprintf(a, "TITLE     test t= %9.5f step= %5d\nMODEL %d\n", (float)(i + 1), i + 1, i + 1);
         for (int j = 0; j < prs.size(); j++) {
             for (int k = 0; k < prs[j].size(); k++) {
                 printf("ATOM  %5d  CA   CA %5d    %8.3f%8.3f%8.3f%6.2f%6.2f      %4s%2s  \n", ndx[prs[j][k].first], ndx[prs[j][k].first], (trj[i][prs[j][k].first][0] * 10), (trj[i][prs[j][k].first][1] * 10), (trj[i][prs[j][k].first][2] * 10), 1.0, 20.0, "    ", " ");
             }
         }
-        printf("ENDMDL\n");
+        fprintf(a, "TER\nENDMDL\n");
     }
     printf("END\n");
     fclose(a);
@@ -569,6 +570,7 @@ Fitng::finishAnalysis(int nframes)
             break;
     }
 
+
     printPDBtraj(OutPutTrjName.c_str(), trajectory, pairs, index);
 }