diff --git a/README.md b/README.md index 03f01cc2e3..e2655e5b50 100644 --- a/README.md +++ b/README.md @@ -250,3 +250,5 @@ External code/libraries bundled with CPPTRAJ * The code for quaternion RMSD calculation was adapted from code in [qcprot.c](https://theobald.brandeis.edu/qcp/qcprot.c) originally written by Douglas L. Theobald and Pu Lio (Brandeis University). * The code for reading numpy arrays in `src/libnpy` is from [libnpy](https://github.com/llohse/libnpy) written by Leon Merten Lohse et al. (Universität Göttingen). + +* The code for reading/writing atom/residue number fields in large PDB files (in `Hybrid36.cpp`) is adapted from code written by Ralf W. Grosse-Kunstleve in the Computational Crystallography Toolbox, https://doi.org/10.1107/S0021889801017824, https://raw.githubusercontent.com/cctbx/cctbx_project/master/iotbx/pdb/hybrid_36_c.c diff --git a/src/Command.cpp b/src/Command.cpp index 5fb2f4d163..b32338b530 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -41,6 +41,7 @@ #include "Exec_Random.h" #include "Exec_CompareClusters.h" #include "Exec_ParseTiming.h" +#include "Exec_Flush.h" // ----- SYSTEM ---------------------------------------------------------------- #include "Exec_System.h" // ----- COORDS ---------------------------------------------------------------- @@ -245,6 +246,7 @@ void Command::Init() { Command::AddCmd( new Exec_DataSetCmd(), Cmd::EXE, 1, "dataset" ); Command::AddCmd( new Exec_EnsFileExt(), Cmd::EXE, 1, "ensextension" ); Command::AddCmd( new Exec_Flatten(), Cmd::EXE, 1, "flatten" ); + Command::AddCmd( new Exec_Flush(), Cmd::EXE, 1, "flush" ); Command::AddCmd( new Exec_GenerateAmberRst(),Cmd::EXE, 1, "rst" ); Command::AddCmd( new Exec_Help(), Cmd::EXE, 1, "help" ); Command::AddCmd( new Exec_ListAll(), Cmd::EXE, 1, "list" ); diff --git a/src/DataFileList.cpp b/src/DataFileList.cpp index f3832f52c6..cfad69556c 100644 --- a/src/DataFileList.cpp +++ b/src/DataFileList.cpp @@ -356,6 +356,17 @@ void DataFileList::List() const { } } +/** Call write for all data files. and close out and clear all CpptrajFiles. */ +void DataFileList::Flush() { + WriteAllDF(); + for (CFarray::iterator it = cfList_.begin(); it != cfList_.end(); ++it) { + (*it)->CloseFile(); + delete *it; + } + cfList_.clear(); + cfData_.clear(); +} + // DataFileList::WriteAllDF() /** Call write for all DataFiles in list for which writeFile is true. Once * a file has been written set writeFile to false; it can be reset to diff --git a/src/DataFileList.h b/src/DataFileList.h index 571d30e721..e1c94a7ee4 100644 --- a/src/DataFileList.h +++ b/src/DataFileList.h @@ -70,6 +70,8 @@ class DataFileList { void List() const; /// Write all DataFiles in list that have not yet been written. void WriteAllDF(); + /// Write all DataFiles and close out all CpptrajFiles + void Flush(); /// \return true if DataFiles have not yet been written. bool UnwrittenData() const; /// Reset the write status of all DataFiles so they will be written diff --git a/src/Exec_Flush.cpp b/src/Exec_Flush.cpp new file mode 100644 index 0000000000..69d8e3bde5 --- /dev/null +++ b/src/Exec_Flush.cpp @@ -0,0 +1,15 @@ +#include "Exec_Flush.h" +#include "CpptrajStdio.h" + +// Exec_Flush::Help() +void Exec_Flush::Help() const +{ + mprintf(" Write any pending data files; close all other files.\n"); +} + +// Exec_Flush::Execute() +Exec::RetType Exec_Flush::Execute(CpptrajState& State, ArgList& argIn) +{ + State.DFL().Flush(); + return CpptrajState::OK; +} diff --git a/src/Exec_Flush.h b/src/Exec_Flush.h new file mode 100644 index 0000000000..472c5b9707 --- /dev/null +++ b/src/Exec_Flush.h @@ -0,0 +1,12 @@ +#ifndef INC_EXEC_FLUSH_H +#define INC_EXEC_FLUSH_H +#include "Exec.h" +/// +class Exec_Flush : public Exec { + public: + Exec_Flush() : Exec(GENERAL) {} + void Help() const; + DispatchObject* Alloc() const { return (DispatchObject*)new Exec_Flush(); } + RetType Execute(CpptrajState&, ArgList&); +}; +#endif diff --git a/src/Hybrid36.cpp b/src/Hybrid36.cpp new file mode 100644 index 0000000000..333b014643 --- /dev/null +++ b/src/Hybrid36.cpp @@ -0,0 +1,325 @@ +/*! C port of the hy36encode() and hy36decode() functions in the + hybrid_36.py Python prototype/reference implementation. + See the Python script for more information. + + This file has no external dependencies, NOT even standard C headers. + Optionally, use hybrid_36_c.h, or simply copy the declarations + into your code. + + This file is unrestricted Open Source (cctbx.sf.net). + Please send corrections and enhancements to cctbx@cci.lbl.gov . + + See also: http://cci.lbl.gov/hybrid_36/ + + Ralf W. Grosse-Kunstleve, Feb 2007. + */ + +/* The following #include may be commented out. + It is here only to enforce consistency of the declarations + and the definitions. + */ +//# incl ude +#include "Hybrid36.h" +#include "CpptrajStdio.h" +/* All static functions below are implementation details + (and not accessible from other translation units). + */ + +static +const char* +digits_upper() { return "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } + +static +const char* +digits_lower() { return "0123456789abcdefghijklmnopqrstuvwxyz"; } + +static +const char* +value_out_of_range() { return "value out of range."; } + +static +const char* invalid_number_literal() { return "invalid number literal."; } + +static +const char* unsupported_width() { return "unsupported width."; } + +static +void +fill_with_stars(unsigned width, char* result) +{ + while (width) { + *result++ = '*'; + width--; + } + *result = '\0'; +} + +static +void +encode_pure( + const char* digits, + unsigned digits_size, + unsigned width, + int value, + char* result) +{ + char buf[16]; + int rest; + unsigned i, j; + i = 0; + j = 0; + if (value < 0) { + j = 1; + value = -value; + } + while (1) { + rest = value / digits_size; + buf[i++] = digits[value - rest * digits_size]; + if (rest == 0) break; + value = rest; + } + if (j) buf[i++] = '-'; + for(j=i;j 127) { + *result = 0; + return invalid_number_literal(); + } + if (si == ' ') { + if (!have_non_blank) continue; + value *= digits_size; + } + else if (si == '-') { + if (have_non_blank) { + *result = 0; + return invalid_number_literal(); + } + have_non_blank = 1; + have_minus = 1; + continue; + } + else { + have_non_blank = 1; + dv = digits_values[si]; + if (dv < 0 || dv >= (int)digits_size) { + *result = 0; + return invalid_number_literal(); + } + value *= digits_size; + value += dv; + } + } + if (have_minus) value = -value; + *result = value; + return 0; +} + +/*! hybrid-36 encoder: converts integer value to string result + + width: must be 4 (e.g. for residue sequence numbers) + or 5 (e.g. for atom serial numbers) + + value: integer value to be converted + + result: pointer to char array of size width+1 or greater + on return result is null-terminated + + return value: pointer to error message, if any, + or 0 on success + + Example usage (from C++): + char result[4+1]; + const char* errmsg = hy36encode(4, 12345, result); + if (errmsg) throw std::runtime_error(errmsg); + */ +const char* +Cpptraj::Hybrid36::hy36encode(unsigned width, int value, char* result) +{ + int i = value; + if (width == 4U) { + if (i >= -999) { + if (i < 10000) { + encode_pure(digits_upper(), 10U, 4U, i, result); + return 0; + } + i -= 10000; + if (i < 1213056 /* 26*36**3 */) { + i += 466560 /* 10*36**3 */; + encode_pure(digits_upper(), 36U, 0U, i, result); + return 0; + } + i -= 1213056; + if (i < 1213056) { + i += 466560; + encode_pure(digits_lower(), 36U, 0U, i, result); + return 0; + } + } + } + else if (width == 5U) { + if (i >= -9999) { + if (i < 100000) { + encode_pure(digits_upper(), 10U, 5U, i, result); + return 0; + } + i -= 100000; + if (i < 43670016 /* 26*36**4 */) { + i += 16796160 /* 10*36**4 */; + encode_pure(digits_upper(), 36U, 0U, i, result); + return 0; + } + i -= 43670016; + if (i < 43670016) { + i += 16796160; + encode_pure(digits_lower(), 36U, 0U, i, result); + return 0; + } + } + } + else { + fill_with_stars(width, result); + return unsupported_width(); + } + fill_with_stars(width, result); + return value_out_of_range(); +} + +/*! hybrid-36 decoder: converts string s to integer result + + width: must be 4 (e.g. for residue sequence numbers) + or 5 (e.g. for atom serial numbers) + + s: string to be converted + does not have to be null-terminated + + s_size: size of s + must be equal to width, or an error message is + returned otherwise + + result: integer holding the conversion result + + return value: pointer to error message, if any, + or 0 on success + + Example usage (from C++): + int result; + const char* errmsg = hy36decode(width, "A1T5", 4, &result); + if (errmsg) throw std::runtime_error(errmsg); + */ +const char* +Cpptraj::Hybrid36::hy36decode(unsigned width, const char* s, unsigned s_size, int* result) +{ + static int first_call = 1; + static int digits_values_upper[128U]; + static int digits_values_lower[128U]; + static const char* + ie_range = "internal error hy36decode: integer value out of range."; + unsigned i; + int di; + const char* errmsg; + if (first_call) { + first_call = 0; + for(i=0;i<128U;i++) digits_values_upper[i] = -1; + for(i=0;i<128U;i++) digits_values_lower[i] = -1; + for(i=0;i<36U;i++) { + di = digits_upper()[i]; + if (di < 0 || di > 127) { + *result = 0; + return ie_range; + } + digits_values_upper[di] = i; + } + for(i=0;i<36U;i++) { + di = digits_lower()[i]; + if (di < 0 || di > 127) { + *result = 0; + return ie_range; + } + digits_values_lower[di] = i; + } + } + if (s_size == width) { + di = s[0]; + if (di >= 0 && di <= 127) { + if (digits_values_upper[di] >= 10) { + errmsg = decode_pure(digits_values_upper, 36U, s, s_size, result); + if (errmsg == 0) { + /* result - 10*36**(width-1) + 10**width */ + if (width == 4U) (*result) -= 456560; + else if (width == 5U) (*result) -= 16696160; + else { + *result = 0; + return unsupported_width(); + } + return 0; + } + } + else if (digits_values_lower[di] >= 10) { + errmsg = decode_pure(digits_values_lower, 36U, s, s_size, result); + if (errmsg == 0) { + /* result + 16*36**(width-1) + 10**width */ + if (width == 4U) (*result) += 756496; + else if (width == 5U) (*result) += 26973856; + else { + *result = 0; + return unsupported_width(); + } + return 0; + } + } + else { + errmsg = decode_pure(digits_values_upper, 10U, s, s_size, result); + if (errmsg) return errmsg; + if (!(width == 4U || width == 5U)) { + *result = 0; + return unsupported_width(); + } + return 0; + } + } + } + *result = 0; + return invalid_number_literal(); +} + +/** Encode value in hybrid36, print any error messages. */ +int Cpptraj::Hybrid36::Encode(unsigned width, int ival, char* result) +{ + const char* errmsg = hy36encode(width, ival, result); + if (errmsg != 0) { + mprinterr("Error: Hybrid36 encode: %s\n", errmsg); + return 1; + } + return 0; +} + +/** Decode hybrid36 value, print any error messages. */ +int Cpptraj::Hybrid36::Decode(unsigned width, const char* sval, int& ival) +{ + // TODO check length of sval? + const char* errmsg = hy36decode(width, sval, width, &ival); + if (errmsg != 0) { + mprinterr("Error: Hybrid36 decode: %s\n", errmsg); + return 1; + } + return 0; +} diff --git a/src/Hybrid36.h b/src/Hybrid36.h new file mode 100644 index 0000000000..d87ef90bad --- /dev/null +++ b/src/Hybrid36.h @@ -0,0 +1,19 @@ +#ifndef INC_HYBRID36_H +#define INC_HYBRID36_H +namespace Cpptraj { +/// Implement the PDB hybrid36 extensions +class Hybrid36 { + public: + Hybrid36() {} + /// Encode to H36: width (4/5), value to convert, resulting string + static int Encode(unsigned, int, char*); + /// Decode from H36: width (4/5), string to convert (size must be width), resulting int + static int Decode(unsigned, const char*, int&); + /// Convert integer value to string result + private: + static const char* hy36encode(unsigned, int, char*); + /// Convert string to integer result + static const char* hy36decode(unsigned, const char*, unsigned, int*); +}; +} +#endif diff --git a/src/PDBfile.cpp b/src/PDBfile.cpp index 147b748547..97187b9be7 100644 --- a/src/PDBfile.cpp +++ b/src/PDBfile.cpp @@ -1,9 +1,11 @@ #include // sscanf #include // atoi, atof #include // strncmp +#include // isalpha #include // std::copy #include "PDBfile.h" #include "CpptrajStdio.h" +#include "Hybrid36.h" #include "StringRoutines.h" // integerToString // ----- SSBOND Class ---------------------------------------------------------- @@ -163,21 +165,37 @@ PDBfile::Link& PDBfile::Link::operator=(Link const& rhs) { } // ===== PDBfile class ========================================================= -/// PDB record types -// NOTE: Must correspond with PDB_RECTYPE +/** PDB record types. NOTE: Must correspond with PDB_RECTYPE */ const char* PDBfile::PDB_RECNAME_[] = { "ATOM ", "HETATM", "CRYST1", "TER ", "END ", "ANISOU", "EndRec", "CONECT", "LINK ", "REMARK", "REMARK", "REMARK", 0 }; -/// CONSTRUCTOR +/** Must correspond to NumWrapType */ +const char* PDBfile::NumWrapTypeStr_[] = { + "Reset to zero", ///< RESET + "Hybrid36" ///< HYBRID36 +}; + +/** Corresponds to max int digit width plus null: -2147483647 */ +const unsigned int PDBfile::MAX_DIGIT_ = 12; + +/** CONSTRUCTOR */ PDBfile::PDBfile() : anum_(1), recType_(UNKNOWN), + wrapType_(HYBRID36), lineLengthWarning_(false), coordOverflow_(false), useCol21_(false) {} +/** Set atom/residue number wrap type */ +void PDBfile::SetWrapType(NumWrapType typeIn) +{ + wrapType_ = typeIn; + mprintf("\tPDB atom/residue number out of range mode: %s\n", NumWrapTypeStr_[wrapType_]); +} + // PDBfile::IsPDBkeyword() /** \return true if given string is a recognized PDB record keyword. * PDB record keywords are typically 6 characters long (including spaces), @@ -367,6 +385,29 @@ char PDBfile::pdb_AltLoc() const { return linebuffer_[16]; } +/** Decode atom number field. Automatically detect if hybrid36 encoding is present. */ +int PDBfile::decodeAtomNum(const char* ptrIn) +{ + int ival = 0; + bool isHy36 = false; + const char* ptr = ptrIn; + while (*ptr != '\0') { + if (isalpha(*ptr)) { + isHy36 = true; + break; + } + ++ptr; + } + //mprintf("DEBUG: decodeAtomNum '%s' isHy36=%i", ptrIn, (int)isHy36); + if (isHy36) { + wrapType_ = HYBRID36; + Cpptraj::Hybrid36::Decode(5, ptrIn, ival); + } else + ival = atoi(ptrIn); + //mprintf(" ival=%i\n", ival); // DEBUG + return ival; +} + /** \return Atom containing information from PDB ATOM/HETATM line. */ Atom PDBfile::pdb_Atom(char& altLoc, int& atnum) { // ATOM or HETATM keyword. @@ -375,7 +416,8 @@ Atom PDBfile::pdb_Atom(char& altLoc, int& atnum) { // Atom number (6-11) altLoc = linebuffer_[11]; linebuffer_[11] = '\0'; - atnum = atoi(linebuffer_+6); + //atnum = atoi(linebuffer_+6); + atnum = decodeAtomNum(linebuffer_+6); linebuffer_[11] = altLoc; // Atom name (12-16), alt location indicator (16) // Replace asterisks in name with single quotes. @@ -398,6 +440,28 @@ Atom PDBfile::pdb_Atom(char& altLoc, int& atnum) { return Atom(aname, eltString); } +/** Decode residue number field. Automatically detect if hybrid36 encoding is present. */ +int PDBfile::decodeResNum(const char* ptrIn) +{ + int ival = 0; + bool isHy36 = false; + const char* ptr = ptrIn; + while (*ptr != '\0') { + if (isalpha(*ptr)) { + isHy36 = true; + break; + } + ++ptr; + } + if (isHy36) { + wrapType_ = HYBRID36; + Cpptraj::Hybrid36::Decode(4, ptrIn, ival); + } else + ival = atoi(ptrIn); + return ival; +} + +/** \return Residue containing residue info from ATOM/HETATM record. */ Residue PDBfile::pdb_Residue() { // Res name (17-20), Replace asterisks with single quotes. char savechar = linebuffer_[20]; @@ -408,7 +472,8 @@ Residue PDBfile::pdb_Residue() { // Res num (22-26), insertion code (26) char icode = linebuffer_[26]; linebuffer_[26] = '\0'; - int resnum = atoi( linebuffer_+22 ); + //int resnum = atoi( linebuffer_+22 ); + int resnum = decodeResNum( linebuffer_+22 ); linebuffer_[26] = icode; return Residue( resName, resnum, icode, std::string(1, linebuffer_[21]) ); } @@ -526,7 +591,8 @@ int PDBfile::pdb_Bonds(int* bnd) { unsigned int end = lb + 5; char savechar = linebuffer_[end]; linebuffer_[end] = '\0'; - bnd[Nscan++] = atoi( linebuffer_ + lb ); + //bnd[Nscan++] = atoi( linebuffer_ + lb ); + bnd[Nscan++] = decodeAtomNum( linebuffer_ + lb ); linebuffer_[end] = savechar; } if (Nscan < 2) @@ -592,9 +658,11 @@ PDBfile::Link PDBfile::pdb_Link() { code2 = ' '; // Residue numbers TODO restore nulled chars? linebuffer_[26] = '\0'; - rnum1 = atoi(linebuffer_+22); + //rnum1 = atoi(linebuffer_+22); + rnum1 = decodeResNum(linebuffer_+22); linebuffer_[56] = '\0'; - rnum2 = atoi(linebuffer_+52); + //rnum2 = atoi(linebuffer_+52); + rnum2 = decodeResNum(linebuffer_+52); /* NOTE: sscanf may not reliable when width absolutely matters. int nscan = sscanf(linebuffer_+12, "%4s%c%3s%c%4i%c%4s%c%3s%c%4i%c", @@ -622,13 +690,31 @@ void PDBfile::WriteRecordHeader(PDB_RECTYPE Record, int anum, NameType const& na int resnum, char icode, const char* Elt) { char resName[6], atomName[5]; + char resNum[5], atomNum[6]; resName[5]='\0'; atomName[4]='\0'; // Residue number in PDB format can only be 4 digits wide - if (resnum > 9999) resnum = resnum % 10000; // Atom number in PDB format can only be 5 digits wide - if (anum > 99999) anum = anum % 100000; + resNum[4]='\0'; + atomNum[5]='\0'; + if (wrapType_ == RESET) { + // Reset the residue/atom numbering if out of range + if (resnum > 9999) + resnum = resnum % 10000; + else if (resnum < -999) + resnum = resnum % -1000; + snprintf(resNum, 5, "%4i", resnum); + if (anum > 99999) + anum = anum % 100000; + else if (anum < -9999) + anum = anum % -10000; + snprintf(atomNum, 6, "%5i", anum); + } else { + // Hybrid36 numbering + Cpptraj::Hybrid36::Encode(4, resnum, resNum); + Cpptraj::Hybrid36::Encode(5, anum, atomNum); + } // Residue names in PDB format are 3 chars long, right-justified, starting // at column 18, while the alternate location indicator is column 17. // In theory, 4 character residue names are not supported. In practice, there @@ -680,8 +766,8 @@ void PDBfile::WriteRecordHeader(PDB_RECTYPE Record, int anum, NameType const& na atomName[i+1] = name[i]; } // TODO if REMARK, which #? - Printf("%-6s%5i %-4s%5s%c%4i%c",PDB_RECNAME_[Record], anum, atomName, - resName, chain, resnum, icode); + Printf("%-6s%5s %-4s%5s%c%4s%c",PDB_RECNAME_[Record], atomNum, atomName, + resName, chain, resNum, icode); if (Record == TER) Printf("\n"); } @@ -828,7 +914,7 @@ void PDBfile::WriteTITLE(std::string const& titleIn) { /** Expect x, y, z, alpha, beta, gamma */ void PDBfile::WriteCRYST1(const double* box, const char* space_group) { if (box==0) return; - // RECROD A B C ALPHA BETA GAMMA SGROUP Z + // RECORD A B C ALPHA BETA GAMMA SGROUP Z Printf("CRYST1%9.3f%9.3f%9.3f%7.2f%7.2f%7.2f %-11s%4i\n", box[0], box[1], box[2], box[3], box[4], box[5], space_group, 1); } @@ -839,17 +925,44 @@ void PDBfile::WriteMODEL(int model) { Printf("MODEL %i\n", model); } +/** Wrap atom number. */ +void PDBfile::atomNumber(int anum, char* atomNum) +const +{ + //if (wrapType_ == RESET) { + // // Reset the atom numbering if out of range + // if (anum > 99999) + // anum = anum % 100000; + // else if (anum < -9999) + // anum = anum % -10000; + // snprintf(atomNum, 6, "%5i", anum); + //} else { + if (wrapType_ == HYBRID36) { + // Hybrid36 numbering + Cpptraj::Hybrid36::Encode(5, anum, atomNum); + } else { + // For backwards compat, allow overflow + snprintf(atomNum, MAX_DIGIT_, "%5i", anum); + } +} + /** Write CONECT record: 1-6 CONECT, 7-11 serial #, 12-16 serial # ... */ void PDBfile::WriteCONECT(int atnum, std::vector const& atrec, Atom const& atomIn) { if (atomIn.Nbonds() < 1) return; + // Atom number in PDB format can only be 5 digits wide + char atomNum[MAX_DIGIT_]; + atomNum[5]='\0'; // PDB V3.3 spec: target-atom serial #s carried on these records also occur in increasing order. Atom atom(atomIn); atom.SortBonds(); int nbond = 0; while (nbond < atom.Nbonds()) { - if ((nbond % 4) == 0) - Printf("CONECT%5i", atnum); - Printf("%5i", atrec[atom.Bond(nbond++)]); + if ((nbond % 4) == 0) { + atomNumber(atnum, atomNum); + Printf("CONECT%5s", atomNum); + } + atomNumber( atrec[atom.Bond(nbond++)], atomNum ); + Printf("%5s", atomNum); if ((nbond % 4) == 0 || nbond == atom.Nbonds()) Printf("\n"); } @@ -857,15 +970,48 @@ void PDBfile::WriteCONECT(int atnum, std::vector const& atrec, Atom const& /** This version is primarily intended for writing CONECT for disulfides. */ void PDBfile::WriteCONECT(int atnum1, int atnum2) { - Printf("CONECT%5i%5i\n", atnum1, atnum2); + char atomNum1[6]; + atomNum1[5]='\0'; + char atomNum2[6]; + atomNum2[5]='\0'; + atomNumber(atnum1, atomNum1); + atomNumber(atnum2, atomNum2); + Printf("CONECT%5s%5s\n", atomNum1, atomNum2); +} + +/** Wrap residue number */ +void PDBfile::resNumber(int resnum, char* resNum) +const +{ +// if (wrapType_ == RESET) { +// // Reset the residue/atom numbering if out of range +// if (resnum > 9999) +// resnum = resnum % 10000; +// else if (resnum < -999) +// resnum = resnum % -1000; +// snprintf(resNum, 5, "%4i", resnum); +// } else { + if (wrapType_ == HYBRID36) { + // Hybrid36 numbering + Cpptraj::Hybrid36::Encode(4, resnum, resNum); + } else { + // For backwards compat, allow overflow + snprintf(resNum, MAX_DIGIT_, "%4i", resnum); + } } void PDBfile::WriteSSBOND(int num, SSBOND const& ss, float distIn) { // TODO: SymOp + char resNum1[5]; + resNum1[4] = '\0'; + char resNum2[5]; + resNum2[3] = '\0'; + resNumber(ss.Rnum1(), resNum1); + resNumber(ss.Rnum2(), resNum2); //Printf("SSBOND %3i %3s %c %4i%c %3s %c %4i%c %6i %6i %5.2f\n", num, - Printf("SSBOND %3i %3s %c %4i%c %3s %c %4i%c %6s %6s %5.2f\n", num, - ss.name1(), ss.Chain1(), ss.Rnum1(), ss.Icode1(), - ss.name2(), ss.Chain2(), ss.Rnum2(), ss.Icode2(), "", "", distIn); + Printf("SSBOND %3i %3s %c %4s%c %3s %c %4s%c %6s %6s %5.2f\n", num, + ss.name1(), ss.Chain1(), resNum1, ss.Icode1(), + ss.name2(), ss.Chain2(), resNum2, ss.Icode2(), "", "", distIn); } void PDBfile::WriteENDMDL() { Printf("ENDMDL\n"); } diff --git a/src/PDBfile.h b/src/PDBfile.h index 6f38b8cae4..7bb382b026 100644 --- a/src/PDBfile.h +++ b/src/PDBfile.h @@ -12,8 +12,14 @@ class PDBfile : public CpptrajFile { // NOTE: PDB_RECNAME_ must correspond with this. enum PDB_RECTYPE {ATOM=0, HETATM, CRYST1, TER, END, ANISOU, END_OF_FILE, CONECT, LINK, MISSING_RES, MISSING_ATOM, MISSING_HET, UNKNOWN}; + /// Determine how to handle out of range residue/atom numbers. Correspond to NumWrapTypeStr_ + enum NumWrapType { RESET = 0, HYBRID36 }; /// CONSTRUCTOR PDBfile(); + + /// Set out of range atom/residue number wrap type + void SetWrapType(NumWrapType); + /// Check if either of the first two lines contain valid PDB records. static bool ID_PDB(CpptrajFile&); /// \return the type of the next PDB record read. @@ -46,6 +52,8 @@ class PDBfile : public CpptrajFile { Link pdb_Link(); /// \return current record type. PDB_RECTYPE RecType() const { return recType_; } + /// \return true if hybrid36 detected + bool HasHybrid36() const { return wrapType_ == HYBRID36; } // ------------------------------------------- /// Set whether column 21 can be used for 4-letter residue names. void SetUseCol21(bool b) { useCol21_ = b; } @@ -97,14 +105,26 @@ class PDBfile : public CpptrajFile { void readCRYST1(double*); /// Parse a MISSING residue line Residue missing_res() const; + /// Decode atom number field + inline int decodeAtomNum(const char*); + /// Decode residue number field + inline int decodeResNum(const char*); + /// Wrap atom number + inline void atomNumber(int, char*) const; + /// Wrap residue number + inline void resNumber(int, char*) const; int anum_; ///< Atom number for writing. PDB_RECTYPE recType_; ///< Current record type. + NumWrapType wrapType_; ///< How to handle out of range numbers bool lineLengthWarning_; ///< True if any read line is shorter than 80 char bool coordOverflow_; ///< True if coords on write exceed field width bool useCol21_; ///< If true, use column 21 for 4-char res name /// Recognized PDB record types; corresponds to PDB_RECTYPE static const char* PDB_RECNAME_[]; + /// Correspond to NumWrapType + static const char* NumWrapTypeStr_[]; + static const unsigned int MAX_DIGIT_; }; /// Hold information for an SSBOND record. class PDBfile::SSBOND { diff --git a/src/Parm_PDB.cpp b/src/Parm_PDB.cpp index 1f78255fbd..5ec25b6b3f 100644 --- a/src/Parm_PDB.cpp +++ b/src/Parm_PDB.cpp @@ -178,6 +178,8 @@ int Parm_PDB::ReadParm(FileName const& fname, Topology &TopIn) { mprintf("Warning: Could not read MISSING HETEROATOM section.\n"); } } // END loop over PDB records + if (infile.HasHybrid36()) + mprintf("\tPDB appears to have hybrid36 encoding in atom/residue number fields.\n"); if (hasMissingResidues) { mprintf("\t%zu missing residues.\n", missingResidues.size()); diff --git a/src/Traj_PDBfile.cpp b/src/Traj_PDBfile.cpp index 941b0b1f3a..b9b333d66c 100644 --- a/src/Traj_PDBfile.cpp +++ b/src/Traj_PDBfile.cpp @@ -378,6 +378,11 @@ int Traj_PDBfile::processWriteArgs(ArgList& argIn, DataSetList const& DSLin) { return 1; } } + // Out of range residue/atom number wrapping + if (argIn.hasKey("hybrid36")) + file_.SetWrapType(PDBfile::HYBRID36); // default + else if (argIn.hasKey("wrapnumbers")) + file_.SetWrapType(PDBfile::RESET); return 0; } diff --git a/src/Version.h b/src/Version.h index 9e8de678bc..b185cd9d81 100644 --- a/src/Version.h +++ b/src/Version.h @@ -12,7 +12,7 @@ * Whenever a number that precedes is incremented, all subsequent * numbers should be reset to 0. */ -#define CPPTRAJ_INTERNAL_VERSION "V7.2.0" +#define CPPTRAJ_INTERNAL_VERSION "V7.3.0" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif diff --git a/src/cpptrajdepend b/src/cpptrajdepend index 053e6367f1..b540b9c32e 100644 --- a/src/cpptrajdepend +++ b/src/cpptrajdepend @@ -194,7 +194,7 @@ CmapParmHolder.o : CmapParmHolder.cpp CmapParmHolder.h Constants.h CpptrajStdio. Cmd.o : Cmd.cpp Cmd.h DispatchObject.h CmdInput.o : CmdInput.cpp CmdInput.h StringRoutines.h CmdList.o : CmdList.cpp Cmd.h CmdList.h DispatchObject.h -Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h ActionTopWriter.h Action_AddAtom.h Action_Align.h Action_Angle.h Action_AreaPerMol.h Action_AtomMap.h Action_AtomicCorr.h Action_AtomicFluct.h Action_AutoImage.h Action_Average.h Action_AvgBox.h Action_Bounds.h Action_Box.h Action_Center.h Action_Channel.h Action_CheckChirality.h Action_CheckStructure.h Action_Closest.h Action_ClusterDihedral.h Action_Contacts.h Action_ConvertToFrac.h Action_CreateCrd.h Action_CreateReservoir.h Action_DNAionTracker.h Action_DSSP.h Action_Density.h Action_Diffusion.h Action_Dihedral.h Action_DihedralRMS.h Action_Dipole.h Action_DistRmsd.h Action_Distance.h Action_EneDecomp.h Action_Energy.h Action_Esander.h Action_FilterByData.h Action_FixAtomOrder.h Action_FixImagedBonds.h Action_GIST.h Action_Grid.h Action_GridFreeEnergy.h Action_HydrogenBond.h Action_Image.h Action_InfraredSpectrum.h Action_Jcoupling.h Action_Keep.h Action_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_MinMaxDist.h Action_Molsurf.h Action_MultiDihedral.h Action_MultiPucker.h Action_MultiVector.h Action_NAstruct.h Action_NMRrst.h Action_NativeContacts.h Action_OrderParameter.h Action_Outtraj.h Action_PairDist.h Action_Pairwise.h Action_Principal.h Action_Projection.h Action_Pucker.h Action_Radgyr.h Action_Radial.h Action_RandomizeIons.h Action_Remap.h Action_ReplicateCell.h Action_Rmsd.h Action_Rotate.h Action_RunningAvg.h Action_STFC_Diffusion.h Action_Scale.h Action_SetVelocity.h Action_Spam.h Action_Strip.h Action_Surf.h Action_SymmetricRmsd.h Action_Temperature.h Action_Test.h Action_Time.h Action_ToroidalDiffusion.h Action_Translate.h Action_Unstrip.h Action_Unwrap.h Action_Vector.h Action_VelocityAutoCorr.h Action_Volmap.h Action_Volume.h Action_Watershell.h Action_XtalSymm.h Analysis.h AnalysisList.h AnalysisState.h Analysis_AmdBias.h Analysis_AutoCorr.h Analysis_Average.h Analysis_CalcDiffusion.h Analysis_Clustering.h Analysis_ConstantPHStats.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.h Analysis_EvalPlateau.h Analysis_FFT.h Analysis_HausdorffDistance.h Analysis_Hist.h Analysis_IRED.h Analysis_Integrate.h Analysis_KDE.h Analysis_Lifetime.h Analysis_LowestCurve.h Analysis_Matrix.h Analysis_MeltCurve.h Analysis_Modes.h Analysis_MultiHist.h Analysis_Multicurve.h Analysis_Overlap.h Analysis_PhiPsi.h Analysis_Project.h Analysis_Regression.h Analysis_RemLog.h Analysis_Rms2d.h Analysis_RmsAvgCorr.h Analysis_Rotdif.h Analysis_RunningAvg.h Analysis_Slope.h Analysis_Spline.h Analysis_State.h Analysis_Statistics.h Analysis_TI.h Analysis_TICA.h Analysis_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AxisType.h BaseIOtype.h Box.h BoxArgs.h BufferedLine.h CharMask.h Cluster/Algorithm.h Cluster/BestReps.h Cluster/CentroidArray.h Cluster/Cframes.h Cluster/Control.h Cluster/DrawGraph.h Cluster/List.h Cluster/Metric.h Cluster/MetricArray.h Cluster/Node.h Cluster/Sieve.h Cluster/Silhouette.h ClusterMap.h Cmd.h CmdInput.h CmdList.h Command.h CompactFrameArray.h ComplexArray.h Constants.h Constraints.h ControlBlock.h ControlBlock_For.h CoordinateInfo.h Corr.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataFilter.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_RemLog.h DataSet_Vector.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_integer_mem.h DataSet_pH.h DataSet_string.h Deprecated.h DiffusionResults.h DihedralSearch.h Dimension.h DispatchObject.h Energy.h Energy/Ecalc_Nonbond.h Energy/EnergyDecomposer.h Energy/ErfcFxn.h Energy/EwaldParams.h Energy/PME_RecipParams.h Energy/VDW_LongRange_Correction.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h EwaldOptions.h ExclusionArray.h Exec.h Exec_AddMissingRes.h Exec_Analyze.h Exec_Build.h Exec_Calc.h Exec_CatCrd.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareClusters.h Exec_CompareEnergy.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CrdTransform.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_Desc.h Exec_Emin.h Exec_ExtendedComparison.h Exec_Flatten.h Exec_GenerateAmberRst.h Exec_Graft.h Exec_Help.h Exec_HmassRepartition.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_Mutate.h Exec_ParallelAnalysis.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_ParseTiming.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrepareForLeap.h Exec_PrintData.h Exec_Random.h Exec_ReadData.h Exec_ReadEnsembleData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_Sequence.h Exec_SequenceAlign.h Exec_Set.h Exec_Show.h Exec_SortEnsembleData.h Exec_Source.h Exec_SplitCoords.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_UpdateParameters.h Exec_ViewRst.h Exec_Zmatrix.h ExtendedSimilarity.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h GIST_PME.h Grid.h GridAction.h GridBin.h GridMover.h HistBin.h Hungarian.h ImageOption.h ImageTypes.h InputTrajCommon.h InteractionData.h MapAtom.h MaskArray.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NC_Routines.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParallelSetFrameNum.h ParameterTypes.h Parm/GB_Params.h PubFFT.h Pucker.h Pucker_PuckerMask.h Pucker_PuckerSearch.h Pucker_PuckerToken.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h Spline.h SplineFxnTable.h Structure/LeastSquaresPlane.h Structure/RingFinder.h StructureCheck.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Unit.h Vec3.h cuda_kernels/GistCudaSetup.cuh helpme_standalone.h molsurf.h +Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h ActionTopWriter.h Action_AddAtom.h Action_Align.h Action_Angle.h Action_AreaPerMol.h Action_AtomMap.h Action_AtomicCorr.h Action_AtomicFluct.h Action_AutoImage.h Action_Average.h Action_AvgBox.h Action_Bounds.h Action_Box.h Action_Center.h Action_Channel.h Action_CheckChirality.h Action_CheckStructure.h Action_Closest.h Action_ClusterDihedral.h Action_Contacts.h Action_ConvertToFrac.h Action_CreateCrd.h Action_CreateReservoir.h Action_DNAionTracker.h Action_DSSP.h Action_Density.h Action_Diffusion.h Action_Dihedral.h Action_DihedralRMS.h Action_Dipole.h Action_DistRmsd.h Action_Distance.h Action_EneDecomp.h Action_Energy.h Action_Esander.h Action_FilterByData.h Action_FixAtomOrder.h Action_FixImagedBonds.h Action_GIST.h Action_Grid.h Action_GridFreeEnergy.h Action_HydrogenBond.h Action_Image.h Action_InfraredSpectrum.h Action_Jcoupling.h Action_Keep.h Action_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_MinMaxDist.h Action_Molsurf.h Action_MultiDihedral.h Action_MultiPucker.h Action_MultiVector.h Action_NAstruct.h Action_NMRrst.h Action_NativeContacts.h Action_OrderParameter.h Action_Outtraj.h Action_PairDist.h Action_Pairwise.h Action_Principal.h Action_Projection.h Action_Pucker.h Action_Radgyr.h Action_Radial.h Action_RandomizeIons.h Action_Remap.h Action_ReplicateCell.h Action_Rmsd.h Action_Rotate.h Action_RunningAvg.h Action_STFC_Diffusion.h Action_Scale.h Action_SetVelocity.h Action_Spam.h Action_Strip.h Action_Surf.h Action_SymmetricRmsd.h Action_Temperature.h Action_Test.h Action_Time.h Action_ToroidalDiffusion.h Action_Translate.h Action_Unstrip.h Action_Unwrap.h Action_Vector.h Action_VelocityAutoCorr.h Action_Volmap.h Action_Volume.h Action_Watershell.h Action_XtalSymm.h Analysis.h AnalysisList.h AnalysisState.h Analysis_AmdBias.h Analysis_AutoCorr.h Analysis_Average.h Analysis_CalcDiffusion.h Analysis_Clustering.h Analysis_ConstantPHStats.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.h Analysis_EvalPlateau.h Analysis_FFT.h Analysis_HausdorffDistance.h Analysis_Hist.h Analysis_IRED.h Analysis_Integrate.h Analysis_KDE.h Analysis_Lifetime.h Analysis_LowestCurve.h Analysis_Matrix.h Analysis_MeltCurve.h Analysis_Modes.h Analysis_MultiHist.h Analysis_Multicurve.h Analysis_Overlap.h Analysis_PhiPsi.h Analysis_Project.h Analysis_Regression.h Analysis_RemLog.h Analysis_Rms2d.h Analysis_RmsAvgCorr.h Analysis_Rotdif.h Analysis_RunningAvg.h Analysis_Slope.h Analysis_Spline.h Analysis_State.h Analysis_Statistics.h Analysis_TI.h Analysis_TICA.h Analysis_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomMap.h AtomMask.h AxisType.h BaseIOtype.h Box.h BoxArgs.h BufferedLine.h CharMask.h Cluster/Algorithm.h Cluster/BestReps.h Cluster/CentroidArray.h Cluster/Cframes.h Cluster/Control.h Cluster/DrawGraph.h Cluster/List.h Cluster/Metric.h Cluster/MetricArray.h Cluster/Node.h Cluster/Sieve.h Cluster/Silhouette.h ClusterMap.h Cmd.h CmdInput.h CmdList.h Command.h CompactFrameArray.h ComplexArray.h Constants.h Constraints.h ControlBlock.h ControlBlock_For.h CoordinateInfo.h Corr.h Cph.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataFilter.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_RemLog.h DataSet_Vector.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_integer_mem.h DataSet_pH.h DataSet_string.h Deprecated.h DiffusionResults.h DihedralSearch.h Dimension.h DispatchObject.h Energy.h Energy/Ecalc_Nonbond.h Energy/EnergyDecomposer.h Energy/ErfcFxn.h Energy/EwaldParams.h Energy/PME_RecipParams.h Energy/VDW_LongRange_Correction.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h EwaldOptions.h ExclusionArray.h Exec.h Exec_AddMissingRes.h Exec_Analyze.h Exec_Build.h Exec_Calc.h Exec_CatCrd.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareClusters.h Exec_CompareEnergy.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CrdTransform.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_Desc.h Exec_Emin.h Exec_ExtendedComparison.h Exec_Flatten.h Exec_Flush.h Exec_GenerateAmberRst.h Exec_Graft.h Exec_Help.h Exec_HmassRepartition.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_Mutate.h Exec_ParallelAnalysis.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_ParseTiming.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrepareForLeap.h Exec_PrintData.h Exec_Random.h Exec_ReadData.h Exec_ReadEnsembleData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_Sequence.h Exec_SequenceAlign.h Exec_Set.h Exec_Show.h Exec_SortEnsembleData.h Exec_Source.h Exec_SplitCoords.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_UpdateParameters.h Exec_ViewRst.h Exec_Zmatrix.h ExtendedSimilarity.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h GIST_PME.h Grid.h GridAction.h GridBin.h GridMover.h HistBin.h Hungarian.h ImageOption.h ImageTypes.h InputTrajCommon.h InteractionData.h MapAtom.h MaskArray.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NC_Routines.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParallelSetFrameNum.h ParameterTypes.h Parm/GB_Params.h PubFFT.h Pucker.h Pucker_PuckerMask.h Pucker_PuckerSearch.h Pucker_PuckerToken.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h Spline.h SplineFxnTable.h Structure/LeastSquaresPlane.h Structure/RingFinder.h StructureCheck.h SymbolExporting.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Unit.h Vec3.h cuda_kernels/GistCudaSetup.cuh helpme_standalone.h molsurf.h CompactFrameArray.o : CompactFrameArray.cpp Box.h CompactFrameArray.h CoordinateInfo.h CpptrajStdio.h Matrix_3x3.h Parallel.h ReplicaDimArray.h Vec3.h ComplexArray.o : ComplexArray.cpp ArrayIterator.h ComplexArray.h Constraints.o : Constraints.cpp ArgList.h Atom.h AtomMask.h Box.h CharMask.h Constants.h Constraints.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskToken.h Matrix_3x3.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h Unit.h Vec3.h @@ -340,6 +340,7 @@ Exec_Desc.o : Exec_Desc.cpp Action.h ActionList.h ActionState.h Analysis.h Analy Exec_Emin.o : Exec_Emin.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h Constraints.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnergyArray.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Emin.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MdOpts.h MetaData.h Minimize_SteepestDescent.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h PotentialFunction.h PotentialTerm.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h Exec_ExtendedComparison.o : Exec_ExtendedComparison.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_ExtendedComparison.h ExtendedSimilarity.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h Exec_Flatten.o : Exec_Flatten.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Flatten.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NameType.h OnlineVarT.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h +Exec_Flush.o : Exec_Flush.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Flush.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h Exec_GenerateAmberRst.o : Exec_GenerateAmberRst.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_GenerateAmberRst.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h ImageOption.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h Exec_Graft.o : Exec_Graft.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h AssociatedData_Connect.h Atom.h AtomMask.h AtomType.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Graft.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h Structure/Builder.h Structure/InternalCoords.h Structure/Zmatrix.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h Exec_Help.o : Exec_Help.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomMask.h BaseIOtype.h Box.h Cmd.h CmdList.h Command.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Help.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h ParmFile.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Segment.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Unit.h Vec3.h @@ -405,6 +406,7 @@ GridMover.o : GridMover.cpp AssociatedData.h Atom.h AtomMask.h Box.h Constants.h GuessAtomHybridization.o : GuessAtomHybridization.cpp Atom.h AtomType.h Constants.h GuessAtomHybridization.h NameType.h ParameterTypes.h SymbolExporting.h HistBin.o : HistBin.cpp Constants.h CpptrajStdio.h Dimension.h HistBin.h Hungarian.o : Hungarian.cpp ArrayIterator.h Constants.h CpptrajStdio.h Hungarian.h Matrix.h +Hybrid36.o : Hybrid36.cpp CpptrajStdio.h Hybrid36.h ImageRoutines.o : ImageRoutines.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h CpptrajStdio.h DistRoutines.h Frame.h ImageOption.h ImageRoutines.h ImageTypes.h Image_List.h Image_List_Mask.h Image_List_Pair.h Image_List_Pair_CoM.h Image_List_Pair_First.h Image_List_Pair_Geom.h Image_List_Unit.h Image_List_Unit_CoM.h Image_List_Unit_First.h Image_List_Unit_Geom.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Unit.h Vec3.h Image_List_Mask.o : Image_List_Mask.cpp Atom.h AtomMask.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h Image_List.h Image_List_Mask.h MaskToken.h Matrix_3x3.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h Unit.h Vec3.h Image_List_Pair.o : Image_List_Pair.cpp Atom.h AtomMask.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h Image_List.h Image_List_Pair.h MaskToken.h Matrix_3x3.h ModXNA_Info.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Topology.h Unit.h Vec3.h @@ -429,7 +431,7 @@ NameType.o : NameType.cpp CpptrajStdio.h NameType.h NetcdfFile.o : NetcdfFile.cpp Atom.h AtomMask.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NC_Routines.h NameType.h NetcdfFile.h Parallel.h ParallelNetcdf.h ReplicaDimArray.h Residue.h Segment.h SymbolExporting.h Unit.h Vec3.h Version.h OMM_helpers.o : OMM_helpers.cpp Constants.h OMM_helpers.h ParameterTypes.h OutputTrajCommon.o : OutputTrajCommon.cpp ActionFrameCounter.h ArgList.h Atom.h AtomMask.h BaseIOtype.h Box.h Constants.h CoordinateInfo.h CpptrajStdio.h FileName.h FileTypes.h Frame.h FramePtrArray.h MaskToken.h Matrix_3x3.h ModXNA_Info.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Topology.h TrajectoryFile.h TrajectoryIO.h Unit.h Vec3.h -PDBfile.o : PDBfile.cpp Atom.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h NameType.h PDBfile.h Parallel.h Residue.h StringRoutines.h SymbolExporting.h +PDBfile.o : PDBfile.cpp Atom.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h Hybrid36.h NameType.h PDBfile.h Parallel.h Residue.h StringRoutines.h SymbolExporting.h PairList.o : PairList.cpp Atom.h AtomMask.h Box.h CoordinateInfo.h CpptrajStdio.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ReplicaDimArray.h Residue.h Segment.h StringRoutines.h SymbolExporting.h Timer.h Unit.h Vec3.h Parallel.o : Parallel.cpp Parallel.h ParallelNetcdf.o : ParallelNetcdf.cpp CpptrajStdio.h Parallel.h ParallelNetcdf.h diff --git a/src/cpptrajfiles b/src/cpptrajfiles index 6700328454..9a5f4bdc52 100644 --- a/src/cpptrajfiles +++ b/src/cpptrajfiles @@ -293,6 +293,7 @@ COMMON_SOURCES= \ Exec_Emin.cpp \ Exec_ExtendedComparison.cpp \ Exec_Flatten.cpp \ + Exec_Flush.cpp \ Exec_GenerateAmberRst.cpp \ Exec_Graft.cpp \ Exec_Help.cpp \ @@ -357,6 +358,7 @@ COMMON_SOURCES= \ GuessAtomHybridization.cpp \ HistBin.cpp \ Hungarian.cpp \ + Hybrid36.cpp \ ImageRoutines.cpp \ Image_List_Mask.cpp \ Image_List_Pair.cpp \