diff --git a/doc/cpptraj.lyx b/doc/cpptraj.lyx index e4f2a92ea6..3c1518735e 100644 --- a/doc/cpptraj.lyx +++ b/doc/cpptraj.lyx @@ -11368,7 +11368,11 @@ bondinfo | bonds | printbonds \end_layout \begin_layout LyX-Code -bondinfo [parm | parmindex <#> | <#>] [] [] [out ] +bondinfo [parm | parmindex <#> | <#>] +\end_layout + +\begin_layout LyX-Code + [] [] [out ] [nointrares] \end_layout \begin_deeper @@ -11417,6 +11421,10 @@ parmindex ] File to print to (default STDOUT). \end_layout +\begin_layout Description +[nointrares] Do not print intra-residue bonds. +\end_layout + \end_deeper \begin_layout Standard Print bond information for atoms in for selected topology (first @@ -11486,7 +11494,11 @@ change [parm | parmindex <#> | <#> | \end_layout \begin_layout LyX-Code - addbond [req ] } + addbond [req ] +\end_layout + +\begin_layout LyX-Code + removebonds [] [out ] } \end_layout \begin_deeper @@ -11628,6 +11640,31 @@ addbond constant>] The bond force constant in kcal/mol*Angstrom. \end_layout +\end_deeper +\begin_layout Description +removebonds +\begin_inset space ~ +\end_inset + + +\begin_inset space ~ +\end_inset + +[] Remove bonds from atoms in . + If also given, remove bonds between atoms in and atoms + in . +\end_layout + +\begin_deeper +\begin_layout Description +[out +\begin_inset space ~ +\end_inset + +] If specified, write removed bonds to with format ' '. +\end_layout + \end_deeper \end_deeper \begin_layout Standard @@ -26990,7 +27027,7 @@ ref::[:[:]] +range>[:]] [refvalsout ] [founddihout ] \end_layout \begin_layout Standard @@ -27003,6 +27040,8 @@ Apply dihedrals from residues in previously loaded reference \series default above) can be specified in a comma-separated list; default is phi/psi. Note that in order to specify , must be specified. + The 'refvalsout' and 'founddihout' keywords can be used to print dihedrals + found in the reference and target structures respectively to files. \end_layout \begin_layout Subsubsection* @@ -31834,7 +31873,7 @@ secstruct \end_layout \begin_layout LyX-Code - [namec ] [nameo ] + [namec ] [nameo ] [namesg ] \begin_inset Separator latexpar \end_inset @@ -31947,6 +31986,19 @@ name>] Backbone carbonyl carbon atom name (default 'C'). name>] Backbone carbonyl oxygen atom name (default 'O'). \end_layout +\begin_layout Description +[namesg +\begin_inset space ~ +\end_inset + +] Cysteine sulfur atom name, used to ignore disulfide connectivity + (default 'SG'). +\end_layout + \begin_layout Standard Data Sets Created: \end_layout @@ -32105,6 +32157,25 @@ nameX cpptraj \shape default will print an informational message but the calculation will proceed normally. + If a residue has no atoms selected it will be skipped. + When determining residue connecivity, disulfide bonds will be ignored; + +\emph on +cpptraj +\emph default + identifies such bonds based on the +\series bold +namesg +\series default + atom name (default +\begin_inset Quotes eld +\end_inset + +SG +\begin_inset Quotes erd +\end_inset + +). \end_layout \begin_layout Standard diff --git a/src/Action_DSSP.cpp b/src/Action_DSSP.cpp index 9075abcc06..b84d2c74a0 100644 --- a/src/Action_DSSP.cpp +++ b/src/Action_DSSP.cpp @@ -274,6 +274,7 @@ Action_DSSP::Action_DSSP() : BB_C_("C"), BB_O_("O"), BB_CA_("CA"), + SG_("SG"), outfile_(0), dsspFile_(0), assignout_(0), @@ -287,9 +288,21 @@ void Action_DSSP::Help() const { "\t[assignout ] [totalout ] [ptrajformat]\n" "\t[betadetail]\n" "\t[namen ] [nameh ] [nameca ]\n" - "\t[namec ] [nameo ]\n" - " Calculate secondary structure content for residues in .\n" - " If sumout not specified, the filename specified by out is used with .sum suffix.\n"); + "\t[namec ] [nameo ] [namesg ]\n" + " Calculate secondary structure (SS) content for residues in .\n" + " The 'out' file will contain SS vs frame.\n" + " The 'sumout' file will contain total SS content for each residue, by SS type.\n" + " If sumout not specified, the filename specified by out is used with .sum suffix.\n" + " The 'assignout' file will contain the SS assignment foe each residue based\n" + " on the majority SS type.\n" + " The 'totalout' file will contain overall SS content vs frame, by SS type.\n" + " The 'ptrajformat' keyword will use characters instead of #s in the 'out' file.\n" + " The 'betadetail' keyword will print parallel/anti-parallel beta instead of\n" + " extended/bridge.\n" + " The backbone N, H, CA, C, and O atom names can be specifed with 'nameX' keywords.\n" + " The disulfide sulfur atom name can be specified with the 'nameSG' keyword.\n" + ); + } // Action_DSSP::Init() @@ -317,6 +330,8 @@ Action::RetType Action_DSSP::Init(ArgList& actionArgs, ActionInit& init, int deb if (!temp.empty()) BB_O_ = temp; temp = actionArgs.GetStringKey("nameca"); if (!temp.empty()) BB_CA_ = temp; + temp = actionArgs.GetStringKey("namesg"); + if (!temp.empty()) SG_ = temp; // Get masks if (Mask_.SetMaskString( actionArgs.GetMaskNext() )) return Action::ERR; @@ -383,6 +398,7 @@ Action::RetType Action_DSSP::Init(ArgList& actionArgs, ActionInit& init, int deb mprintf("\tOverall assigned SS will be written to %s\n", assignout_->Filename().full()); mprintf("\tBackbone Atom Names: N=[%s] H=[%s] C=[%s] O=[%s] CA=[%s]\n", *BB_N_, *BB_H_, *BB_C_, *BB_O_, *BB_CA_ ); + mprintf("\tDisulfide sulfur atom name: %s\n", *SG_); mprintf("# Citation: Kabsch, W.; Sander, C.; \"Dictionary of Protein Secondary Structure:\n" "# Pattern Recognition of Hydrogen-Bonded and Geometrical Features.\"\n" "# Biopolymers (1983), V.22, pp.2577-2637.\n" ); @@ -450,23 +466,34 @@ Action::RetType Action_DSSP::Setup(ActionSetup& setup) int nextresnum = -1; for (int at = thisRes.FirstAtom(); at != thisRes.LastAtom(); at++) { if ( setup.Top()[at].Element() != Atom::HYDROGEN ) { + bool isSGatom = (setup.Top()[at].Name() == SG_); for (Atom::bond_iterator ib = setup.Top()[at].bondbegin(); ib != setup.Top()[at].bondend(); ++ib) { - if ( setup.Top()[*ib].ResNum() < *ridx ) { - if (prevresnum != -1) - mprintf("Warning: Multiple previous residues for res %i\n", *ridx+1); - else - prevresnum = setup.Top()[*ib].ResNum(); - } else if ( setup.Top()[*ib].ResNum() > *ridx ) { - if (nextresnum != -1) - mprintf("Warning: Multiple next residues for res %i\n", *ridx+1); - else - nextresnum = setup.Top()[*ib].ResNum(); - } - } - } - } + // Skip the bonded atom if it is not in the mask + if (Mask_.AtomInCharMask(*ib)) { + // Do not follow disulfide bonds. + if (isSGatom && setup.Top()[*ib].Name() == SG_) { + mprintf("\tSkipping disulfide bond between %s and %s\n", + setup.Top().TruncResNameNum(setup.Top()[at].ResNum()).c_str(), + setup.Top().TruncResNameNum(setup.Top()[*ib].ResNum()).c_str()); + continue; + } + if ( setup.Top()[*ib].ResNum() < *ridx ) { + if (prevresnum != -1) + mprintf("Warning: Multiple previous residues for res %i\n", *ridx+1); + else + prevresnum = setup.Top()[*ib].ResNum(); + } else if ( setup.Top()[*ib].ResNum() > *ridx ) { + if (nextresnum != -1) + mprintf("Warning: Multiple next residues for res %i\n", *ridx+1); + else + nextresnum = setup.Top()[*ib].ResNum(); + } + } // END if atom in mask + } // END loop over bonded atoms + } // END atom is not hydrogen + } // END loop over residue atoms # ifdef DSSPDEBUG mprintf("\t %8i < %8i < %8i\n", prevresnum+1, *ridx+1, nextresnum+1); # endif @@ -476,40 +503,54 @@ Action::RetType Action_DSSP::Setup(ActionSetup& setup) } // Determine if this residue is selected if (Mask_.AtomsInCharMask(thisRes.FirstAtom(), thisRes.LastAtom())) { - Res->SetSelected( true ); - ++nResSelected; // Determine atom indices + bool hasAtoms = false; for (int at = thisRes.FirstAtom(); at != thisRes.LastAtom(); at++) { - if ( setup.Top()[at].Name() == BB_C_ ) Res->SetC( at*3 ); - else if ( setup.Top()[at].Name() == BB_O_ ) Res->SetO( at*3 ); - else if ( setup.Top()[at].Name() == BB_N_ ) Res->SetN( at*3 ); - else if ( setup.Top()[at].Name() == BB_H_ ) Res->SetH( at*3 ); - else if ( setup.Top()[at].Name() == BB_CA_ ) Res->SetCA( at*3 ); + if ( setup.Top()[at].Name() == BB_C_ ) { Res->SetC( at*3 ); hasAtoms = true; } + else if ( setup.Top()[at].Name() == BB_O_ ) { Res->SetO( at*3 ); hasAtoms = true; } + else if ( setup.Top()[at].Name() == BB_N_ ) { Res->SetN( at*3 ); hasAtoms = true; } + else if ( setup.Top()[at].Name() == BB_H_ ) { Res->SetH( at*3 ); hasAtoms = true; } + else if ( setup.Top()[at].Name() == BB_CA_ ) { Res->SetCA( at*3 ); hasAtoms = true; } } - // Check if residue is missing atoms - if (Res->IsMissingAtoms()) { - mprintf("Warning: Res %s is missing atoms", setup.Top().TruncResNameNum( *ridx ).c_str()); - if (Res->C() == -1) mprintf(" %s", *BB_C_); - if (Res->O() == -1) mprintf(" %s", *BB_N_); - if (Res->N() == -1) mprintf(" %s", *BB_O_); - if (Res->H() == -1) mprintf(" %s", *BB_H_); - if (Res->CA() == -1) mprintf(" %s", *BB_CA_); - mprintf("\n"); - } - // Set up DataSet if necessary - if (Res->Dset() == 0) { - md.SetIdx( *ridx+1 ); - md.SetLegend( setup.Top().TruncResNameNum( *ridx ) ); - // Setup DataSet for this residue - Res->SetDset( Init_.DSL().AddSet( dt, md ) ); + if (!hasAtoms) { + mprintf("Warning: No atoms selected for res %s; skipping.\n", + setup.Top().TruncResNameNum( *ridx ).c_str()); + } else { + Res->SetSelected( true ); + ++nResSelected; + for (int at = thisRes.FirstAtom(); at != thisRes.LastAtom(); at++) + { + if ( setup.Top()[at].Name() == BB_C_ ) Res->SetC( at*3 ); + else if ( setup.Top()[at].Name() == BB_O_ ) Res->SetO( at*3 ); + else if ( setup.Top()[at].Name() == BB_N_ ) Res->SetN( at*3 ); + else if ( setup.Top()[at].Name() == BB_H_ ) Res->SetH( at*3 ); + else if ( setup.Top()[at].Name() == BB_CA_ ) Res->SetCA( at*3 ); + } + // Check if residue is missing atoms + if (Res->IsMissingAtoms()) { + mprintf("Warning: Res %s is missing atoms", setup.Top().TruncResNameNum( *ridx ).c_str()); + if (Res->C() == -1) mprintf(" %s", *BB_C_); + if (Res->O() == -1) mprintf(" %s", *BB_N_); + if (Res->N() == -1) mprintf(" %s", *BB_O_); + if (Res->H() == -1) mprintf(" %s", *BB_H_); + if (Res->CA() == -1) mprintf(" %s", *BB_CA_); + mprintf("\n"); + } + // Set up DataSet if necessary if (Res->Dset() == 0) { - mprinterr("Error: Could not allocate DSSP data set for residue %i\n", *ridx+1); - return Action::ERR; + md.SetIdx( *ridx+1 ); + md.SetLegend( setup.Top().TruncResNameNum( *ridx ) ); + // Setup DataSet for this residue + Res->SetDset( Init_.DSL().AddSet( dt, md ) ); + if (Res->Dset() == 0) { + mprinterr("Error: Could not allocate DSSP data set for residue %i\n", *ridx+1); + return Action::ERR; + } + if (outfile_ != 0) outfile_->AddDataSet( Res->Dset() ); } - if (outfile_ != 0) outfile_->AddDataSet( Res->Dset() ); } - } // END residue is selected + } // END residue is selected by Mask } mprintf("\t%u of %i solute residues selected.\n", nResSelected, soluteRes.Size()); diff --git a/src/Action_DSSP.h b/src/Action_DSSP.h index ca552d5c0d..b325cee490 100644 --- a/src/Action_DSSP.h +++ b/src/Action_DSSP.h @@ -85,6 +85,7 @@ class Action_DSSP : public Action { NameType BB_C_; ///< Protein C atom name ('C') NameType BB_O_; ///< Protein C-O atom name ('O') NameType BB_CA_; ///< Protein alpha C name ('CA') + NameType SG_; ///< Protein cysteine sulfur name for detecting disulfides CharMask Mask_; ///< Mask used to determine selected residues. DataFile* outfile_; ///< Output Data file DataFile* dsspFile_; ///< Sum output file diff --git a/src/Action_MakeStructure.cpp b/src/Action_MakeStructure.cpp index 40b3111d8a..5b39e9405e 100644 --- a/src/Action_MakeStructure.cpp +++ b/src/Action_MakeStructure.cpp @@ -6,7 +6,11 @@ #include "StringRoutines.h" // convertToDouble, convertToInteger // CONSTRUCTOR -Action_MakeStructure::Action_MakeStructure() : debug_(0) { +Action_MakeStructure::Action_MakeStructure() : + CurrentParm_(0), + debug_(0), + foundDihOut_(0) +{ // Initially known structure types. SS.push_back(SS_TYPE( -57.8, -47.0, 0.0, 0.0, 0, "alpha" )); SS.push_back(SS_TYPE( 57.8, 47.0, 0.0, 0.0, 0, "left" )); @@ -34,6 +38,7 @@ int Action_MakeStructure::FindSStype(std::string const& typeIn) return SS_EMPTY; } +// Action_MakeStructure::Help() void Action_MakeStructure::Help() const { mprintf("\t\n" " Apply dihedrals to specified residues using arguments found in ,\n" @@ -55,7 +60,7 @@ void Action_MakeStructure::Help() const { "\t5) '::::::[:]'\n" "\t Apply to dihedral defined by atoms , , , and .\n"); DihedralSearch::OffsetHelp(); - mprintf("\t6) 'ref::[:[:]]'\n" + mprintf("\t6) 'ref::[:[:]] [refvalsout ] [founddihout ]'\n" "\t Apply dihedrals from reference to residues in range .\n" "\t If is specified, use those residues from reference. The\n" "\t dihedral types to be used can be specified in a comma-separated list;\n" @@ -70,7 +75,13 @@ Action::RetType Action_MakeStructure::Init(ArgList& actionArgs, ActionInit& init { debug_ = debugIn; secstruct_.clear(); - // Get all arguments + CpptrajFile* refvalsout = init.DFL().AddCpptrajFile( actionArgs.GetStringKey("refvalsout"), + "Ref dihedral types/values", + DataFileList::TEXT ); + foundDihOut_ = init.DFL().AddCpptrajFile( actionArgs.GetStringKey("founddihout"), + "Found dihedrals", + DataFileList::TEXT ); + // Get all makestructure arguments std::string ss_expr = actionArgs.GetStringNext(); while ( !ss_expr.empty() ) { ArgList ss_arg(ss_expr, ":"); @@ -152,6 +163,9 @@ Action::RetType Action_MakeStructure::Init(ArgList& actionArgs, ActionInit& init if (debug_ > 0) mprintf("\t Res %i %s = %g\n", dih->ResNum()+1, dih->Name().c_str(), torsion*Constants::RADDEG); + if (refvalsout != 0) + refvalsout->Printf("Res %i %s = %g\n", dih->ResNum()+1, dih->Name().c_str(), + torsion*Constants::RADDEG); } secstruct_.push_back( ss_holder ); @@ -377,7 +391,13 @@ Action::RetType Action_MakeStructure::Setup(ActionSetup& setup) { for (DihedralSearch::mask_it dih = ss->dihSearch_.begin(); dih != ss->dihSearch_.end(); ++dih) { - mprintf("\tDihedral in residue %i = %f\n", dih->ResNum()+1, *(theta++)*Constants::RADDEG); + if (foundDihOut_ != 0) { + mprintf("\tFound dihedrals being written to '%s'\n", foundDihOut_->Filename().full()); + foundDihOut_->Printf("\tDihedral %s in residue %i = %f\n", + dih->Name().c_str(), dih->ResNum()+1, *(theta++)*Constants::RADDEG); + } else + mprintf("\tDihedral %s in residue %i = %f\n", + dih->Name().c_str(), dih->ResNum()+1, *(theta++)*Constants::RADDEG); ss->Rmasks_.push_back( DihedralSearch::MovingAtoms(setup.Top(), dih->A1(), dih->A2()) ); } diff --git a/src/Action_MakeStructure.h b/src/Action_MakeStructure.h index c7eb2f9570..36f1891a44 100644 --- a/src/Action_MakeStructure.h +++ b/src/Action_MakeStructure.h @@ -12,8 +12,7 @@ class Action_MakeStructure : public Action { Action::RetType Setup(ActionSetup&); Action::RetType DoAction(int, ActionFrame&); void Print() {} - Topology* CurrentParm_; // DEBUG - int debug_; + /// Hold secondary structure/turn/single dihedral types. class SS_TYPE { public: @@ -41,5 +40,9 @@ class Action_MakeStructure : public Action { int sstype_idx; ///< Pointer to corresponding SS_TYPE. }; std::vector secstruct_; + + Topology* CurrentParm_; ///< Hold current topology for DoAction(). + int debug_; + CpptrajFile* foundDihOut_; ///< File to write dihedrals found by Setup() to. }; #endif diff --git a/src/Atom.cpp b/src/Atom.cpp index e886a2a709..06c7554136 100644 --- a/src/Atom.cpp +++ b/src/Atom.cpp @@ -196,6 +196,16 @@ Atom &Atom::operator=(Atom other) { return *this; } +/** Remove the specified bond to index if it exists. */ +void Atom::RemoveBondToIdx(int idx) { + std::vector newBonds_; + for (std::vector::const_iterator it = bonds_.begin(); it != bonds_.end(); ++it) + { + if (*it != idx) newBonds_.push_back( *it ); + } + bonds_ = newBonds_; +} + // Atom::SortBonds() void Atom::SortBonds() { sort( bonds_.begin(), bonds_.end() ); diff --git a/src/Atom.h b/src/Atom.h index 9f4d892bf1..272a618f87 100644 --- a/src/Atom.h +++ b/src/Atom.h @@ -44,9 +44,11 @@ class Atom { inline bond_iterator bondbegin() const { return bonds_.begin(); } inline bond_iterator bondend() const { return bonds_.end(); } inline int Bond(int idx) const { return bonds_[idx]; } + std::vector const& BondIdxArray() const { return bonds_; } /// Add atom index # to this atoms list of bonded atoms. void AddBondToIdx(int idxIn) { bonds_.push_back( idxIn ); } void ClearBonds() { bonds_.clear() ; } + void RemoveBondToIdx(int); void SortBonds(); // TODO: Use this routine in AtomMap etc /// \return true if this atom is bonded to given atom index diff --git a/src/Command.cpp b/src/Command.cpp index 92eccfac76..842deae3b4 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -23,6 +23,7 @@ #include "Exec_Help.h" #include "Exec_ParallelAnalysis.h" #include "Exec_Precision.h" +#include "Exec_PrepareForLeap.h" #include "Exec_PrintData.h" #include "Exec_ReadData.h" #include "Exec_ReadEnsembleData.h" @@ -248,6 +249,7 @@ void Command::Init() { Command::AddCmd( new Exec_LoadCrd(), Cmd::EXE, 1, "loadcrd" ); Command::AddCmd( new Exec_LoadTraj(), Cmd::EXE, 1, "loadtraj" ); Command::AddCmd( new Exec_PermuteDihedrals(), Cmd::EXE, 1, "permutedihedrals" ); + Command::AddCmd( new Exec_PrepareForLeap(), Cmd::EXE, 1, "prepareforleap" ); Command::AddCmd( new Exec_RotateDihedral(), Cmd::EXE, 1, "rotatedihedral" ); Command::AddCmd( new Exec_SplitCoords(), Cmd::EXE, 1, "splitcoords" ); // TRAJECTORY diff --git a/src/Cpptraj.cpp b/src/Cpptraj.cpp index 8104450502..30185baf8f 100644 --- a/src/Cpptraj.cpp +++ b/src/Cpptraj.cpp @@ -634,7 +634,7 @@ int Cpptraj::Interactive() { // Write logfile header entry: date, cmd line opts, topologies logfile_.Printf("# %s\n", TimeString().c_str()); if (!commandLine_.empty()) - logfile_.Write(commandLine_.c_str(), commandLine_.size()*sizeof(char)); + logfile_.Printf("# Args: %s\n", commandLine_.c_str()); DataSetList tops = State_.DSL().GetSetsOfType("*", DataSet::TOPOLOGY); if (!tops.empty()) { logfile_.Printf("# Loaded topologies:\n"); diff --git a/src/CpptrajState.cpp b/src/CpptrajState.cpp index 6e42a67a9a..fde3cac7ec 100644 --- a/src/CpptrajState.cpp +++ b/src/CpptrajState.cpp @@ -346,14 +346,17 @@ int CpptrajState::RemoveDataSet( ArgList& argIn ) { mprinterr("Error: No data set(s) specified for removal.\n"); return 1; } - DataSetList tempDSL = DSL_.GetMultipleSets( removeArg ); - if (!tempDSL.empty()) { - for (DataSetList::const_iterator ds = tempDSL.begin(); - ds != tempDSL.end(); ++ds) - { - mprintf("\tRemoving \"%s\"\n", (*ds)->legend()); - RemoveDataSet( *ds ); + while (!removeArg.empty()) { + DataSetList tempDSL = DSL_.GetMultipleSets( removeArg ); + if (!tempDSL.empty()) { + for (DataSetList::const_iterator ds = tempDSL.begin(); + ds != tempDSL.end(); ++ds) + { + mprintf("\tRemoving \"%s\"\n", (*ds)->legend()); + RemoveDataSet( *ds ); + } } + removeArg = argIn.GetStringNext(); } return 0; } diff --git a/src/DataSetList.cpp b/src/DataSetList.cpp index d0f99e9c30..fb1b4507be 100644 --- a/src/DataSetList.cpp +++ b/src/DataSetList.cpp @@ -1049,7 +1049,7 @@ Topology* DataSetList::GetTopology(ArgList& argIn) const { return ((DataSet_Topology*)top)->TopPtr(); } -const char* DataSetList::TopIdxArgs = "parm | parmindex <#> | <#>"; +const char* DataSetList::TopIdxArgs = "parm | crdset | parmindex <#> | <#>"; // DataSetList::GetTopByIndex() /** \return Topology specfied by a keyword, or if no keywords specified @@ -1064,6 +1064,13 @@ Topology* DataSetList::GetTopByIndex(ArgList& argIn) const { int err; DataSet* top = GetTopByKeyword( argIn, err ); if (err) return 0; + // Check coords sets + std::string crdset = argIn.GetStringKey("crdset"); + if (!crdset.empty()) { + top = FindSetOfGroup(crdset, DataSet::COORDINATES); + if ( top == 0) return 0; + return ((DataSet_Coords*)top)->TopPtr(); + } if (top == 0) { // For backwards compat., check for single integer arg. int topindex = argIn.getNextInteger(-1); if (topindex > -1 && topindex < (int)TopList_.size()) diff --git a/src/DihedralSearch.cpp b/src/DihedralSearch.cpp index d47038b701..5961ceaed7 100644 --- a/src/DihedralSearch.cpp +++ b/src/DihedralSearch.cpp @@ -10,6 +10,7 @@ const DihedralSearch::DihedralType DihedralSearch::D_END = MetaData::PUCKER; /// Token to store pre-defined dihedral types. struct DihedralSearch::DIH_TYPE { int cidx; ///< Index of the "central" atom (i.e. what res should it belong to) + int offset; ///< Res offset for atoms: -2 to 2 DihedralType type; ///< Dihedral MetaData type const char* an0; ///< First atom name const char* an1; ///< Second atom name @@ -19,44 +20,44 @@ struct DihedralSearch::DIH_TYPE { /** Recognized dihedral types go here. */ const DihedralSearch::DIH_TYPE DihedralSearch::DIH[] = { - { 2, MetaData::PHI, "C" , "N" , "CA" , "C" }, // PHI: C0-N1-CA1-C1 - { 2, MetaData::PSI, "N" , "CA" , "C" , "N" }, // PSI: N0-CA0-C0-N1 - { 2, MetaData::CHIP, "N" , "CA" , "CB" , "CG" }, // Protein CHI: R,N,D,Q,E,H,L,K,M,F,P,W,Y - { 2, MetaData::CHIP, "N" , "CA" , "CB" , "SG" }, // Protein CHI: C - { 2, MetaData::CHIP, "N" , "CA" , "CB" , "CG1" }, // Protein CHI: I,V - { 2, MetaData::CHIP, "N" , "CA" , "CB" , "OG" }, // Protein CHI: S - { 2, MetaData::CHIP, "N" , "CA" , "CB" , "OG1" }, // Protein CHI: T - { 2, MetaData::CHI2, "CA" , "CB" , "CG" , "CD" }, // Protein CHI2: R, Q, E, I, K, P - { 2, MetaData::CHI2, "CA" , "CB" , "CG" , "OD1" }, // Protein CHI2: N, D - { 2, MetaData::CHI2, "CA" , "CB" , "CG" , "ND1" }, // Protein CHI2: H - { 2, MetaData::CHI2, "CA" , "CB" , "CG" , "CD1" }, // Protein CHI2: L, F, W, Y - { 2, MetaData::CHI2, "CA" , "CB" , "CG" , "SD" }, // Protein CHI2: M - { 2, MetaData::CHI3, "CB" , "CG" , "CD" , "NE" }, // Protein CHI3: R - { 2, MetaData::CHI3, "CB" , "CG" , "CD" , "OE1" }, // Protein CHI3: Q, E - { 2, MetaData::CHI3, "CB" , "CG" , "CD" , "CE" }, // Protein CHI3: K - { 2, MetaData::CHI3, "CB" , "CG" , "SD" , "CE" }, // Protein CHI3: M - { 2, MetaData::CHI4, "CG" , "CD" , "NE" , "CZ" }, // Protein CHI4: R - { 2, MetaData::CHI4, "CG" , "CD" , "CE" , "NZ" }, // Protein CHI4: K - { 2, MetaData::CHI5, "CD" , "NE" , "CZ" , "NH1" }, // Protein CHI5: R - { 2, MetaData::OMEGA, "CA" , "C" , "N" , "CA" }, // OMEGA: CA0-C0-N1-CA1 - { 2, MetaData::ALPHA, "O3'", "P" , "O5'", "C5'" }, // ALPHA: - { 2, MetaData::BETA, "P" , "O5'", "C5'", "C4'" }, // BETA: - { 2, MetaData::GAMMA, "O5'", "C5'", "C4'", "C3'" }, // GAMMA: - { 2, MetaData::DELTA, "C5'", "C4'", "C3'", "O3'" }, // DELTA: - { 2, MetaData::EPSILON, "C4'", "C3'", "O3'", "P" }, // EPSILON: - { 1, MetaData::ZETA, "C3'", "O3'", "P" , "O5'" }, // ZETA: - { 2, MetaData::NU0, "C4'", "O4'", "C1'", "C2'" }, // NU0: Nucleic pucker - { 2, MetaData::NU1, "O4'", "C1'", "C2'", "C3'" }, // NU1: Nucleic pucker - { 2, MetaData::NU2, "C1'", "C2'", "C3'", "C4'" }, // NU2: Nucleic pucker - { 2, MetaData::NU3, "C2'", "C3'", "C4'", "O4'" }, // NU3: Nucleic pucker - { 2, MetaData::NU4, "C3'", "C4'", "O4'", "C1'" }, // NU4: Nucleic pucker - { 2, MetaData::CHIN, "O4'", "C1'", "N9", "C4" }, // Nucleic CHI: Purine (A, G) - { 2, MetaData::CHIN, "O4'", "C1'", "N1", "C2" }, // Nucleic CHI: Pyrimidine (U, T, C) - { 2, MetaData::H1P, "H1'", "C1'", "N9", "C4" }, // Nucleic H1' sugar pucker-base (purine) - { 2, MetaData::H1P, "H1'", "C1'", "N1", "C2" }, // Nucleic H1' sugar pucker-base (pyrim.) - { 2, MetaData::C2P, "C2'", "C1'", "N9", "C4" }, // Nucleic C2' sugar pucker-base (purine) - { 2, MetaData::C2P, "C2'", "C1'", "N1", "C2" }, // Nucleic C2' sugar pucker-base (pyrim.) - { 2, MetaData::UNDEFINED, 0, 0, 0, 0 } + { 2, -1, MetaData::PHI, "C" , "N" , "CA" , "C" }, // Protein PHI: C0-N1-CA1-C1 + { 2, 1, MetaData::PSI, "N" , "CA" , "C" , "N" }, // Protein PSI: N0-CA0-C0-N1 + { 2, 0, MetaData::CHIP, "N" , "CA" , "CB" , "CG" }, // Protein CHI: R,N,D,Q,E,H,L,K,M,F,P,W,Y + { 2, 0, MetaData::CHIP, "N" , "CA" , "CB" , "SG" }, // Protein CHI: C + { 2, 0, MetaData::CHIP, "N" , "CA" , "CB" , "CG1" }, // Protein CHI: I,V + { 2, 0, MetaData::CHIP, "N" , "CA" , "CB" , "OG" }, // Protein CHI: S + { 2, 0, MetaData::CHIP, "N" , "CA" , "CB" , "OG1" }, // Protein CHI: T + { 2, 0, MetaData::CHI2, "CA" , "CB" , "CG" , "CD" }, // Protein CHI2: R, Q, E, I, K, P + { 2, 0, MetaData::CHI2, "CA" , "CB" , "CG" , "OD1" }, // Protein CHI2: N, D + { 2, 0, MetaData::CHI2, "CA" , "CB" , "CG" , "ND1" }, // Protein CHI2: H + { 2, 0, MetaData::CHI2, "CA" , "CB" , "CG" , "CD1" }, // Protein CHI2: L, F, W, Y + { 2, 0, MetaData::CHI2, "CA" , "CB" , "CG" , "SD" }, // Protein CHI2: M + { 2, 0, MetaData::CHI3, "CB" , "CG" , "CD" , "NE" }, // Protein CHI3: R + { 2, 0, MetaData::CHI3, "CB" , "CG" , "CD" , "OE1" }, // Protein CHI3: Q, E + { 2, 0, MetaData::CHI3, "CB" , "CG" , "CD" , "CE" }, // Protein CHI3: K + { 2, 0, MetaData::CHI3, "CB" , "CG" , "SD" , "CE" }, // Protein CHI3: M + { 2, 0, MetaData::CHI4, "CG" , "CD" , "NE" , "CZ" }, // Protein CHI4: R + { 2, 0, MetaData::CHI4, "CG" , "CD" , "CE" , "NZ" }, // Protein CHI4: K + { 2, 0, MetaData::CHI5, "CD" , "NE" , "CZ" , "NH1" }, // Protein CHI5: R + { 2, -2, MetaData::OMEGA, "CA" , "C" , "N" , "CA" }, // Protein OMEGA: CA0-C0-N1-CA1 + { 2, -1, MetaData::ALPHA, "O3'", "P" , "O5'", "C5'" }, // Nucelic ALPHA: O3'0-P1-O5'1-C5'1 + { 2, 0, MetaData::BETA, "P" , "O5'", "C5'", "C4'" }, // Nucleic BETA: + { 2, 0, MetaData::GAMMA, "O5'", "C5'", "C4'", "C3'" }, // Nucelic GAMMA: + { 2, 0, MetaData::DELTA, "C5'", "C4'", "C3'", "O3'" }, // Nucleic DELTA: + { 2, 1, MetaData::EPSILON, "C4'", "C3'", "O3'", "P" }, // Nucleic EPSILON: C4'0-C3'0-O3'0-P1 + { 1, 2, MetaData::ZETA, "C3'", "O3'", "P" , "O5'" }, // Nucleic ZETA: C3'0-O3'0-P1-O5'1 + { 2, 0, MetaData::NU0, "C4'", "O4'", "C1'", "C2'" }, // NU0: Nucleic pucker + { 2, 0, MetaData::NU1, "O4'", "C1'", "C2'", "C3'" }, // NU1: Nucleic pucker + { 2, 0, MetaData::NU2, "C1'", "C2'", "C3'", "C4'" }, // NU2: Nucleic pucker + { 2, 0, MetaData::NU3, "C2'", "C3'", "C4'", "O4'" }, // NU3: Nucleic pucker + { 2, 0, MetaData::NU4, "C3'", "C4'", "O4'", "C1'" }, // NU4: Nucleic pucker + { 2, 0, MetaData::CHIN, "O4'", "C1'", "N9", "C4" }, // Nucleic CHI: Purine (A, G) + { 2, 0, MetaData::CHIN, "O4'", "C1'", "N1", "C2" }, // Nucleic CHI: Pyrimidine (U, T, C) + { 2, 0, MetaData::H1P, "H1'", "C1'", "N9", "C4" }, // Nucleic H1' sugar pucker-base (purine) + { 2, 0, MetaData::H1P, "H1'", "C1'", "N1", "C2" }, // Nucleic H1' sugar pucker-base (pyrim.) + { 2, 0, MetaData::C2P, "C2'", "C1'", "N9", "C4" }, // Nucleic C2' sugar pucker-base (purine) + { 2, 0, MetaData::C2P, "C2'", "C1'", "N1", "C2" }, // Nucleic C2' sugar pucker-base (pyrim.) + { 2, 0, MetaData::UNDEFINED, 0, 0, 0, 0 } }; // DihedralSearch::ListKnownTypes() @@ -99,6 +100,7 @@ DihedralSearch::DihedralToken::DihedralToken(int off, NameType const& an2, NameType const& an3, std::string const& name) : centerIdx_(2), + offset_(off), name_(name), type_(MetaData::UNDEFINED) { @@ -113,6 +115,7 @@ DihedralSearch::DihedralToken::DihedralToken(int off, // CONSTRUCTOR - Recognized type DihedralSearch::DihedralToken::DihedralToken(DIH_TYPE const& dih) : centerIdx_(dih.cidx), + offset_(dih.offset), name_(MetaData::TypeString(dih.type)), type_(dih.type) { @@ -123,15 +126,34 @@ DihedralSearch::DihedralToken::DihedralToken(DIH_TYPE const& dih) : } /// \return index of atom named aname bonded to atm in Topology top, or -1 if not found. -static inline int FindNameBondedTo(Atom const& atm, Topology const& top, NameType const& aname) +/** \param atm Current atom to search. + * \param top Current topology + * \param aname Bonded atom Name to search for + * \param resnum Residue number of the 'central' atom. + * \param numShouldBeDifferent Whether the bonded atom residue number should be different + */ +static inline int FindNameBondedTo(Atom const& atm, Topology const& top, NameType const& aname, + int resnum, bool numShouldBeDifferent) { int atomX = -1; for (Atom::bond_iterator bat = atm.bondbegin(); bat != atm.bondend(); ++bat) - if (top[*bat].Name() == aname) - { - atomX = *bat; - break; + { + if (top[*bat].Name() == aname) { + if ( numShouldBeDifferent ) { + // Bonded residue num should not match resnum + if ( top[*bat].ResNum() != resnum) { + atomX = *bat; + break; + } + } else { + //Bonded residue num should match resnum + if ( top[*bat].ResNum() == resnum) { + atomX = *bat; + break; + } + } } + } return atomX; } @@ -144,6 +166,19 @@ DihedralSearch::DihedralMask { Residue const& Res = topIn.Res(resIn); int atIdx[4]; + // Determine whether atoms should be in different residues. + bool isDifferentRes[4]; + if (offset_ == -2) { + isDifferentRes[0] = true; isDifferentRes[1] = true; isDifferentRes[2] = false; isDifferentRes[3] = false; + } else if (offset_ == -1) { + isDifferentRes[0] = true; isDifferentRes[1] = false; isDifferentRes[2] = false; isDifferentRes[3] = false; + } else if (offset_ == 1) { + isDifferentRes[0] = false; isDifferentRes[1] = false; isDifferentRes[2] = false; isDifferentRes[3] = true; + } else if (offset_ == 2) { + isDifferentRes[0] = false; isDifferentRes[1] = false; isDifferentRes[2] = true; isDifferentRes[3] = true; + } else { + isDifferentRes[0] = false; isDifferentRes[1] = false; isDifferentRes[2] = false; isDifferentRes[3] = false; + } // See if central atom exists. atIdx[centerIdx_] = -1; for (int at = Res.FirstAtom(); at != Res.LastAtom(); at++) @@ -157,14 +192,14 @@ DihedralSearch::DihedralMask // Find atoms in forward direction. for (int i = centerIdx_+1; i < 4; i++) { - int idx = FindNameBondedTo(topIn[atIdx[i-1]], topIn, aname_[i]); + int idx = FindNameBondedTo(topIn[atIdx[i-1]], topIn, aname_[i], resIn, isDifferentRes[i]); if (idx == -1) return DihedralMask(); atIdx[i] = idx; } // Find atoms in reverse direction. for (int i = centerIdx_-1; i > -1; i--) { - int idx = FindNameBondedTo(topIn[atIdx[i+1]], topIn, aname_[i]); + int idx = FindNameBondedTo(topIn[atIdx[i+1]], topIn, aname_[i], resIn, isDifferentRes[i]); if (idx == -1) return DihedralMask(); atIdx[i] = idx; } diff --git a/src/DihedralSearch.h b/src/DihedralSearch.h index 23384b7602..080bee6c66 100644 --- a/src/DihedralSearch.h +++ b/src/DihedralSearch.h @@ -64,7 +64,7 @@ class DihedralSearch { /// Hold dihedral type information used for searching. class DihedralSearch::DihedralToken { public: - DihedralToken() : centerIdx_(2), type_(MetaData::UNDEFINED) {} + DihedralToken() : centerIdx_(2), offset_(0), type_(MetaData::UNDEFINED) {} /// Constructor for custom dihedral type DihedralToken(int, NameType const&, NameType const&, NameType const&, NameType const&, std::string const&); @@ -77,6 +77,7 @@ class DihedralSearch::DihedralToken { void SetAtomName(int i, NameType const& n) { aname_[i] = n; } private: int centerIdx_; ///< Index of the "central" dihedral atom (determines res#). + int offset_; ///< Help determine which atoms are in which residues NameType aname_[4]; ///< Dihedral atom names. std::string name_; ///< Dihedral type name. DihedralType type_; ///< Dihedral type. diff --git a/src/Exec_Change.cpp b/src/Exec_Change.cpp index 2e40d90d01..fbe61e46e6 100644 --- a/src/Exec_Change.cpp +++ b/src/Exec_Change.cpp @@ -10,7 +10,8 @@ void Exec_Change::Help() const "\t{ resname from to |\n" "\t chainid of to |\n" "\t atomname from to |\n" - "\t addbond [req ] }\n" + "\t addbond [req ] |\n" + "\t removebonds [] [out ]}\n" " Change specified parts of topology or topology of a COORDS data set.\n", DataSetList::TopArgs); } @@ -19,7 +20,7 @@ void Exec_Change::Help() const Exec::RetType Exec_Change::Execute(CpptrajState& State, ArgList& argIn) { // Change type - enum ChangeType { UNKNOWN = 0, RESNAME, CHAINID, ATOMNAME, ADDBOND }; + enum ChangeType { UNKNOWN = 0, RESNAME, CHAINID, ATOMNAME, ADDBOND, REMOVEBONDS }; ChangeType type = UNKNOWN; if (argIn.hasKey("resname")) type = RESNAME; @@ -29,6 +30,8 @@ Exec::RetType Exec_Change::Execute(CpptrajState& State, ArgList& argIn) type = ATOMNAME; else if (argIn.hasKey("addbond")) type = ADDBOND; + else if (argIn.hasKey("removebonds")) + type = REMOVEBONDS; if (type == UNKNOWN) { mprinterr("Error: No change type specified.\n"); return CpptrajState::ERR; @@ -43,8 +46,11 @@ Exec::RetType Exec_Change::Execute(CpptrajState& State, ArgList& argIn) return CpptrajState::ERR; } parm = cset->TopPtr(); - } else + mprintf("\tUsing topology from COORDS set '%s'\n", cset->legend()); + } else { parm = State.DSL().GetTopology( argIn ); + mprintf("\tUsing topology: %s\n", parm->c_str()); + } if (parm == 0) return CpptrajState::ERR; int err = 0; switch (type) { @@ -52,6 +58,7 @@ Exec::RetType Exec_Change::Execute(CpptrajState& State, ArgList& argIn) case CHAINID : err = ChangeChainID(*parm, argIn); break; case ATOMNAME : err = ChangeAtomName(*parm, argIn); break; case ADDBOND : err = AddBond(*parm, argIn); break; + case REMOVEBONDS : err = RemoveBonds(State, *parm, argIn); break; case UNKNOWN : err = 1; // sanity check } if (err != 0) return CpptrajState::ERR; @@ -194,6 +201,75 @@ int Exec_Change::FindBondTypeIdx(Topology const& topIn, BondArray const& bonds, return bidx; } +// Exec_Change::RemoveBonds() +int Exec_Change::RemoveBonds(CpptrajState& State, Topology& topIn, ArgList& argIn) const { + AtomMask mask1, mask2; + std::string str1 = argIn.GetMaskNext(); + if (str1.empty()) { + mprinterr("Error: Must specify at least 1 atom mask.\n"); + return 1; + } + if (mask1.SetMaskString( str1 )) return 1; + if (topIn.SetupIntegerMask( mask1 )) return 1; + if (mask1.None()) { + mprinterr("Error: %s selects no atoms.\n", str1.c_str()); + return 1; + } + std::string str2 = argIn.GetMaskNext(); + if (!str2.empty()) { + if (mask2.SetMaskString( str2 )) return 1; + if (topIn.SetupIntegerMask( mask2 )) return 1; + if (mask2.None()) { + mprinterr("Error: %s selects no atoms.\n", str2.c_str()); + return 1; + } + } + CpptrajFile* outfile = State.DFL().AddCpptrajFile(argIn.GetStringKey("out"), "RemovedBonds", + DataFileList::TEXT, true); + if (outfile == 0) { + mprinterr("Internal Error: RemoveBonds could not get an output file.\n"); + return 1; + } + const char* prefix = ""; + if (outfile->IsStream()) + prefix = "\t\t"; + + if (str2.empty()) { + mprintf("\tRemoving bonds to atoms selected by %s (%i atoms).\n", + str1.c_str(), mask1.Nselected()); + for (AtomMask::const_iterator atm = mask1.begin(); atm != mask1.end(); ++atm) { + std::string atmStr = topIn.ResNameNumAtomNameNum(*atm); + // Make a copy of the atoms bonds array because it will be modified. + std::vector atoms = topIn[*atm].BondIdxArray(); + for (std::vector::const_iterator bnd = atoms.begin(); bnd != atoms.end(); ++bnd) + { + int ret = topIn.RemoveBond(*atm, *bnd); + if (ret == 0) + outfile->Printf("%s%s to %s\n", prefix, atmStr.c_str(), + topIn.ResNameNumAtomNameNum(*bnd).c_str()); + } + } + } else { + mprintf("\tRemoving any bonds between atoms selected by %s (%i atoms)\n" + "\tand %s (%i atoms).\n", str1.c_str(), mask1.Nselected(), + str2.c_str(), mask2.Nselected()); + for (AtomMask::const_iterator atm1 = mask1.begin(); atm1 != mask1.end(); ++atm1) { + std::string atmStr = topIn.ResNameNumAtomNameNum(*atm1); + for (AtomMask::const_iterator atm2 = mask2.begin(); atm2 != mask2.end(); ++atm2) { + int ret = topIn.RemoveBond(*atm1, *atm2); + if (ret == 0) + outfile->Printf("%s%s to %s\n", prefix,atmStr.c_str(), + topIn.ResNameNumAtomNameNum(*atm2).c_str()); + } + } + } + // Since molecule info has likely changed, re-determine + topIn.DetermineMolecules(); + + return 0; +} + + // Exec_Change::AddBond() int Exec_Change::AddBond(Topology& topIn, ArgList& argIn) const { AtomMask mask1, mask2; diff --git a/src/Exec_Change.h b/src/Exec_Change.h index c53c1e3529..8fec0e35df 100644 --- a/src/Exec_Change.h +++ b/src/Exec_Change.h @@ -16,5 +16,6 @@ class Exec_Change : public Exec { static inline int Setup1atomMask(AtomMask&, Topology const&, std::string const&); static inline int FindBondTypeIdx(Topology const&, BondArray const&, TypeNameHolder const&); int AddBond(Topology&, ArgList&) const; + int RemoveBonds(CpptrajState&, Topology&, ArgList&) const; }; #endif diff --git a/src/Exec_PrepareForLeap.cpp b/src/Exec_PrepareForLeap.cpp new file mode 100644 index 0000000000..99fce08af3 --- /dev/null +++ b/src/Exec_PrepareForLeap.cpp @@ -0,0 +1,90 @@ +#include "Exec_PrepareForLeap.h" +#include "CpptrajStdio.h" +#include "DistRoutines.h" + +// Exec_PrepareForLeap::Help() +void Exec_PrepareForLeap::Help() const +{ + mprintf("\tcrdset [frame <#>] out \n" + "\t[cysmask ] [disulfidecut ] [newcysname ]\n" + "\t[leapunitname ]\n" + ); +} + +static inline void ChangeResName(Residue& res, NameType const& nameIn) { + if (res.Name() != nameIn) { + mprintf("\tChanging residue %s to %s\n", *(res.Name()), *nameIn); + res.SetName( nameIn ); + } +} + +// Exec_PrepareForLeap::Execute() +Exec::RetType Exec_PrepareForLeap::Execute(CpptrajState& State, ArgList& argIn) +{ + std::string crdset = argIn.GetStringKey("crdset"); + if (crdset.empty()) { + mprinterr("Error: Must specify COORDS set with 'crdset'\n"); + return CpptrajState::ERR; + } + DataSet* ds = State.DSL().FindSetOfGroup( crdset, DataSet::COORDINATES ); + if (ds == 0) { + mprinterr("Error: No COORDS set found matching %s\n", crdset.c_str()); + return CpptrajState::ERR; + } + DataSet_Coords& coords = static_cast( *((DataSet_Coords*)ds) ); + int tgtframe = argIn.getKeyInt("frame", 1) - 1; + mprintf("\tUsing frame %i from COORDS set %s\n", tgtframe+1, coords.legend()); + if (tgtframe < 0 || tgtframe >= (int)coords.Size()) { + mprinterr("Error: Frame is out of range.\n"); + return CpptrajState::ERR; + } + Frame frameIn = coords.AllocateFrame(); + coords.GetFrame(tgtframe, frameIn); + + std::string leapunitname = argIn.GetStringKey("leapunitname", "m"); + mprintf("\tUsing leap unit name: %s\n", leapunitname.c_str()); + + CpptrajFile* outfile = State.DFL().AddCpptrajFile(argIn.GetStringKey("out"), + "LEaP Input", DataFileList::TEXT); + if (outfile == 0) return CpptrajState::ERR; + + // Disulfide search + double disulfidecut = argIn.getKeyDouble("disulfidecut", 2.1); + std::string newcysnamestr = argIn.GetStringKey("newcysname", "CYX"); + NameType newcysname(newcysnamestr); + mprintf("\tCysteine residues involved in disulfide bonds will be changed to: %s\n", *newcysname); + std::string cysmaskstr = argIn.GetStringKey("cysmask", ":CYS@SG"); + mprintf("\tSearching for disulfide bonds with a cutoff of %g Ang.\n", disulfidecut); + AtomMask cysmask; + if (cysmask.SetMaskString( cysmaskstr )) { + mprinterr("Error: Could not set up CYS mask string %s\n", cysmaskstr.c_str()); + return CpptrajState::ERR; + } + if (coords.Top().SetupIntegerMask( cysmask )) return CpptrajState::ERR; + cysmask.MaskInfo(); + if (cysmask.None()) + mprintf("Warning: No cysteine sulfur atoms selected by %s\n", cysmaskstr.c_str()); + else { + double cut2 = disulfidecut * disulfidecut; + // Try to find potential disulfide sites. + for (AtomMask::const_iterator at1 = cysmask.begin(); at1 != cysmask.end(); ++at1) { + for (AtomMask::const_iterator at2 = at1 + 1; at2 != cysmask.end(); ++at2) { + // TODO imaging? + double r2 = DIST2_NoImage(frameIn.XYZ(*at1), frameIn.XYZ(*at2)); + if (r2 < cut2) { + mprintf("\tPotential disulfide: %s to %s (%g Ang.)\n", + coords.Top().ResNameNumAtomNameNum(*at1).c_str(), + coords.Top().ResNameNumAtomNameNum(*at2).c_str(), sqrt(r2)); + outfile->Printf("bond %s.%i.%s %s.%i.%s\n", + leapunitname.c_str(), coords.Top()[*at1].ResNum()+1, *(coords.Top()[*at1].Name()), + leapunitname.c_str(), coords.Top()[*at2].ResNum()+1, *(coords.Top()[*at2].Name())); + ChangeResName(coords.TopPtr()->SetRes(coords.Top()[*at1].ResNum()), newcysname); + ChangeResName(coords.TopPtr()->SetRes(coords.Top()[*at2].ResNum()), newcysname); + } + } + } + } + + + return CpptrajState::OK; +} diff --git a/src/Exec_PrepareForLeap.h b/src/Exec_PrepareForLeap.h new file mode 100644 index 0000000000..1aa39cbb70 --- /dev/null +++ b/src/Exec_PrepareForLeap.h @@ -0,0 +1,12 @@ +#ifndef INC_EXEC_PREPAREFORLEAP_H +#define INC_EXEC_PREPAREFORLEAP_H +#include "Exec.h" +/// Do common tasks to prepare a structure to be loaded into tleap +class Exec_PrepareForLeap : public Exec { + public: + Exec_PrepareForLeap() : Exec(HIDDEN) {} + void Help() const; + DispatchObject* Alloc() const { return (DispatchObject*)new Exec_PrepareForLeap(); } + RetType Execute(CpptrajState&, ArgList&); +}; +#endif diff --git a/src/Exec_Top.cpp b/src/Exec_Top.cpp index 374f6f5273..bf1d0a8070 100644 --- a/src/Exec_Top.cpp +++ b/src/Exec_Top.cpp @@ -51,15 +51,18 @@ static int CommonSetup(TopInfo& info, CpptrajState& State, ArgList& argIn, const mprintf("\tOutput to '%s'\n", outfile->Filename().full()); err = info.SetupTopInfo( outfile, parm, REF.RefPtr() ); } + if (argIn.hasKey("nointrares")) + info.SetNoIntraRes(true); return err; } // ----------------------------------------------------------------------------- void Exec_BondInfo::Help() const { - mprintf("\t[%s] [] [] [out ]\n", DataSetList::TopIdxArgs); + mprintf("\t[%s] [] [] [out ] [nointrares]\n", DataSetList::TopIdxArgs); mprintf(" For specified topology (first by default) either print bond info for all\n" " atoms in , or print info for bonds with first atom in and\n" - " second atom in .\n"); + " second atom in . If 'nointrares' is specified, only print bonds\n" + " that are between residues.\n"); } Exec::RetType Exec_BondInfo::Execute(CpptrajState& State, ArgList& argIn) { diff --git a/src/Parm_Amber.cpp b/src/Parm_Amber.cpp index 6cc98cf5b3..f99dfa78b6 100644 --- a/src/Parm_Amber.cpp +++ b/src/Parm_Amber.cpp @@ -745,13 +745,22 @@ int Parm_Amber::ReadResidueNames(Topology& TopIn, FortranData const& FMT) { // Parm_Amber::ReadResidueAtomNums() int Parm_Amber::ReadResidueAtomNums(Topology& TopIn, FortranData const& FMT) { if (SetupBuffer(F_RESNUMS, values_[NRES], FMT)) return 1; - for (int idx = 0; idx != values_[NRES]; idx++) { - int atnum = atoi(file_.NextElement()) - 1; - TopIn.SetRes(idx).SetFirstAtom( atnum ); - if (idx > 0) TopIn.SetRes(idx-1).SetLastAtom( atnum ); - TopIn.SetRes(idx).SetOriginalNum( idx+1 ); + // Each entry in the array is the start atom (indexed from 1) for + // the corresponding residue. Do all but the final residue. + int numRes = values_[NRES]; + int firstAtom = atoi(file_.NextElement()) - 1; + for (int idx = 1; idx < numRes; idx++) { + Residue& currentRes = TopIn.SetRes(idx-1); + int lastAtom = atoi(file_.NextElement()) - 1; + currentRes.SetFirstAtom( firstAtom ); + currentRes.SetLastAtom( lastAtom ); + currentRes.SetOriginalNum( idx ); + firstAtom = lastAtom; } - TopIn.SetRes( values_[NRES]-1 ).SetLastAtom( values_[NATOM] ); + // Do the final residue + TopIn.SetRes(numRes-1).SetFirstAtom( firstAtom ); + TopIn.SetRes(numRes-1).SetLastAtom( values_[NATOM] ); + TopIn.SetRes(numRes-1).SetOriginalNum( numRes ); return 0; } diff --git a/src/Residue.cpp b/src/Residue.cpp index 5fdf91f0fa..e6aa8e66a1 100644 --- a/src/Residue.cpp +++ b/src/Residue.cpp @@ -24,6 +24,9 @@ char Residue::ConvertResName(std::string const& r) { if (r.compare(0,3,"HIE")==0) return 'H'; // NE-protonated (HIS) if (r.compare(0,3,"HID")==0) return 'H'; // ND-protonated if (r.compare(0,3,"HIP")==0) return 'H'; // NE/ND protonated + if (r.compare(0,3,"HSE")==0) return 'H'; // CHARMM NE-protonated + if (r.compare(0,3,"HSD")==0) return 'H'; // CHARMM ND-protonated + if (r.compare(0,3,"HSP")==0) return 'H'; // CHARMM NE/ND-protonated if (r.compare(0,3,"ILE")==0) return 'I'; if (r.compare(0,3,"LEU")==0) return 'L'; if (r.compare(0,3,"LYS")==0) return 'K'; diff --git a/src/TopInfo.cpp b/src/TopInfo.cpp index e8dbfcb401..31a38af7b1 100644 --- a/src/TopInfo.cpp +++ b/src/TopInfo.cpp @@ -17,7 +17,8 @@ TopInfo::TopInfo() : Awidth_(0), amn_width_(0), max_aname_len_(0), - toStdout_(false) + toStdout_(false), + noIntraRes_(false) {} /// CONSTRUCTOR - To Stdout @@ -28,7 +29,8 @@ TopInfo::TopInfo(Topology const* pIn) : amn_width_(0), max_type_len_(0), max_aname_len_(0), - toStdout_(false) + toStdout_(false), + noIntraRes_(false) { SetupTopInfo( 0, pIn, 0 ); } @@ -106,6 +108,7 @@ int TopInfo::PrintAtomInfo(std::string const& maskExpression) const { if ( mask.None() ) mprinterr("\tSelection is empty.\n"); else { + mprintf("%i atoms selected.\n", mask.Nselected()); int width = DigitWidth(parm_->Natom()); if (width < 5) width = 5; int nWidth = maxAtomNamesWidth(mask); @@ -159,6 +162,7 @@ int TopInfo::PrintResidueInfo(std::string const& maskExpression) const { mprinterr("\tSelection is empty.\n"); else { std::vector resNums = parm_->ResnumsSelectedBy(mask); + mprintf("%zu residues selected.\n", resNums.size()); int rn_width = maxResNameWidth( resNums ); int awidth = std::max(5, DigitWidth(parm_->Natom())); @@ -264,6 +268,7 @@ int TopInfo::PrintMoleculeInfo(std::string const& maskString) const { mprintf("\tSelection is empty.\n"); else { std::vector molNums = parm_->MolnumsSelectedBy( mask ); + mprintf("%zu molecules.\n", molNums.size()); int mn_width = maxMolNameWidth( molNums ); int awidth = std::max(5, DigitWidth(parm_->Natom())); int rwidth = std::max(5, DigitWidth(parm_->Nres())); @@ -397,6 +402,10 @@ void TopInfo::PrintBonds(BondArray const& barray, BondParmArray const& bondparm, printBond = (mask1.AtomInCharMask(atom1) && mask2.AtomInCharMask(atom2)); else printBond = (mask1.AtomInCharMask(atom1) || mask1.AtomInCharMask(atom2)); + if (noIntraRes_ && printBond) { + if ( (*parm_)[atom1].ResNum() == (*parm_)[atom2].ResNum() ) + printBond = false; + } if (printBond) { outfile_->Printf("%*i", nw, nb); int bidx = batom->Idx(); diff --git a/src/TopInfo.h b/src/TopInfo.h index c963586eb5..bb62d983cb 100644 --- a/src/TopInfo.h +++ b/src/TopInfo.h @@ -14,6 +14,7 @@ class TopInfo { /// CONSTRUCTOR - Take pointer to topology, output to STDOUT TopInfo(Topology const*); ~TopInfo(); + void SetNoIntraRes(bool b) { noIntraRes_ = b; } int SetupTopInfo(CpptrajFile*, Topology const*, DataSet_Coords*); int SetupTopInfo(Topology const* p, DataSet_Coords* c) { return SetupTopInfo(0, p, c); } @@ -54,5 +55,6 @@ class TopInfo { int max_type_len_; ///< Max width of atom type name in topology int max_aname_len_; ///< Max width of atom name in topology bool toStdout_; + bool noIntraRes_; ///< If true, ignore intra-residue bonds/angles/dihedrals etc }; #endif diff --git a/src/Topology.cpp b/src/Topology.cpp index e004e622b9..fc1cd93549 100644 --- a/src/Topology.cpp +++ b/src/Topology.cpp @@ -169,6 +169,18 @@ std::string Topology::TruncResAtomNameNum(int atom) const { return TruncResAtomName(atom) + "_" + integerToString(atom+1); } +/** Given an atom number, return a string containing the corresponding + * residue name and number, and atom name and number, all separated + * by spaces: + * " + */ +std::string Topology::ResNameNumAtomNameNum(int atom) const { + if (atom < 0 || atom >= (int)atoms_.size()) return std::string(""); + int res = atoms_[atom].ResNum(); + return residues_[res].Name().Truncated() + " " + integerToString(res+1) + " " + + atoms_[atom].Name().Truncated() + " " + integerToString(atom+1); +} + // Topology::AtomMaskName() /** \return A string of format :r@a where r is atoms residue number and * a is atoms name. @@ -182,6 +194,10 @@ std::string Topology::AtomMaskName(int atom) const { return maskName; } +/** Given an atom number, return a string containing atom name and + * number with format: + * "_" + */ std::string Topology::TruncAtomNameNum(int atom) const { if (atom < 0 || atom >= (int)atoms_.size()) return std::string(""); std::string atom_name = atoms_[atom].Name().Truncated(); @@ -287,9 +303,6 @@ int Topology::AddTopAtom(Atom const& atomIn, Residue const& resIn) ( residues_.back().OriginalResNum() == resIn.OriginalResNum() && residues_.back().Name() != resIn.Name() ) ) { - // Last atom of old residue is == current # atoms. - if (!residues_.empty()) - residues_.back().SetLastAtom( atoms_.size() ); // First atom of new residue is == current # atoms. residues_.push_back( resIn ); residues_.back().SetFirstAtom( atoms_.size() ); @@ -599,6 +612,56 @@ static inline int WarnOutOfRange(int Natom, int atom, const char* type) { return 0; } +/** Remove a bond between atom 1 and atom2, update the atoms array. + * Does not modify bond parameters. + * \return 0 if a bond was successfully removed, -1 if no bond exists, and 1 if an error occurs. + */ +int Topology::RemoveBond(int atom1, int atom2) +{ + // Check if atoms are out of range. + if (WarnOutOfRange(atoms_.size(), atom1, "bond")) return 1; + if (WarnOutOfRange(atoms_.size(), atom2, "bond")) return 1; + // Ensure the bond exists. + bool exists = false; + for (Atom::bond_iterator ba = atoms_[atom1].bondbegin(); + ba != atoms_[atom1].bondend(); ++ba) + if ( *ba == atom2 ) { + exists = true; + break; + } + if (!exists) { + mprintf("Warning: No bond exists between atoms %i and %i\n", atom1+1, atom2+1); + return -1; + } + bool a1H = (atoms_[atom1].Element() == Atom::HYDROGEN); + bool a2H = (atoms_[atom2].Element() == Atom::HYDROGEN); + BondArray* tgtArray; + if (a1H || a2H) + tgtArray = &bondsh_; + else + tgtArray = &bonds_; + // Search the array. + BondArray::iterator bnd = tgtArray->begin(); + for (; bnd != tgtArray->end(); ++bnd) { + if (atom1 == bnd->A1()) { + if (atom2 == bnd->A2()) break; + } + if (atom2 == bnd->A1()) { + if (atom1 == bnd->A2()) break; + } + } + // Sanity check + if (bnd == tgtArray->end()) { + mprinterr("Internal Error: Bond %i %i not found in internal bond array.\n", atom1+1, atom2+1); + return 1; + } + tgtArray->erase( bnd ); + atoms_[atom1].RemoveBondToIdx( atom2 ); + atoms_[atom2].RemoveBondToIdx( atom1 ); + return 0; +} + + // Topology::AddBond() /** Create a bond between atom1 and atom2, update the atoms array. * For bonds to H always insert the H second. diff --git a/src/Topology.h b/src/Topology.h index 777265ea6f..b254d343cc 100644 --- a/src/Topology.h +++ b/src/Topology.h @@ -77,6 +77,7 @@ class Topology { void AddBond(int, int, int); void AddBond(BondType const&, bool); void AddBond(int, int, BondParmType const&); + int RemoveBond(int, int); void AssignBondParams(ParmHolder const&); // ----- Angle-specific routines ------------- size_t Nangles() const { return angles_.size()+anglesh_.size(); } @@ -129,8 +130,10 @@ class Topology { std::string TruncResAtomName(int) const; /// Format: @ std::string TruncResNameAtomName(int) const; - /// Format: _@_ + /// Format: _@_ std::string TruncResAtomNameNum(int) const; + /// Format: + std::string ResNameNumAtomNameNum(int) const; /// Format: :@ std::string AtomMaskName(int) const; /// Format: _ diff --git a/src/Version.h b/src/Version.h index ad0bfc4585..1222020cf2 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 "V4.25.13" +#define CPPTRAJ_INTERNAL_VERSION "V4.26.0" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif diff --git a/src/cpptrajdepend b/src/cpptrajdepend index da9bcfc240..e311a93346 100644 --- a/src/cpptrajdepend +++ b/src/cpptrajdepend @@ -157,7 +157,7 @@ Cluster_ReadInfo.o : Cluster_ReadInfo.cpp ArgList.h ArrayIterator.h AssociatedDa 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 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_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_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_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_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_Molsurf.h Action_MultiDihedral.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_Time.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_Clustering.h Analysis_ConstantPHStats.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.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_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_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMap.h AtomMask.h AtomType.h AxisType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.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 DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_Mat3x3.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 DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h Energy.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Analyze.h Exec_Calc.h Exec_CatCrd.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_GenerateAmberRst.h Exec_Help.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_ParallelAnalysis.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrintData.h Exec_ReadData.h Exec_ReadEnsembleData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_SequenceAlign.h Exec_Set.h Exec_Show.h Exec_SortEnsembleData.h Exec_SplitCoords.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_UpdateParameters.h Exec_ViewRst.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h Grid.h GridAction.h GridBin.h HistBin.h Hungarian.h ImageTypes.h ImagedAction.h InputTrajCommon.h MapAtom.h MaskArray.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Spline.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 TypeNameHolder.h Vec3.h cuda_kernels/GistCudaSetup.cuh molsurf.h +Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.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_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_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_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_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_Molsurf.h Action_MultiDihedral.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_Time.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_Clustering.h Analysis_ConstantPHStats.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.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_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_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMap.h AtomMask.h AtomType.h AxisType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.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 DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_Mat3x3.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 DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h Energy.h Energy_Sander.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_Analyze.h Exec_Calc.h Exec_CatCrd.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_GenerateAmberRst.h Exec_Help.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_ParallelAnalysis.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrepareForLeap.h Exec_PrintData.h Exec_ReadData.h Exec_ReadEnsembleData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_SequenceAlign.h Exec_Set.h Exec_Show.h Exec_SortEnsembleData.h Exec_SplitCoords.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_UpdateParameters.h Exec_ViewRst.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h Grid.h GridAction.h GridBin.h HistBin.h Hungarian.h ImageTypes.h ImagedAction.h InputTrajCommon.h MapAtom.h MaskArray.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h RemdReservoirNC.h ReplicaDimArray.h ReplicaInfo.h Residue.h Spline.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 TypeNameHolder.h Vec3.h cuda_kernels/GistCudaSetup.cuh molsurf.h ComplexArray.o : ComplexArray.cpp ArrayIterator.h ComplexArray.h Constraints.o : Constraints.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h AtomType.h Box.h CharMask.h Constants.h Constraints.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h SymbolExporting.h Topology.h TypeNameHolder.h Vec3.h ControlBlock_For.o : ControlBlock_For.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.h BaseIOtype.h Box.h Constants.h ControlBlock.h ControlBlock_For.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 FileIO.h FileName.h FileTypes.h ForLoop.h ForLoop_dataSetBlocks.h ForLoop_integer.h ForLoop_list.h ForLoop_mask.h ForLoop_overSets.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h @@ -264,6 +264,7 @@ Exec_ParmStrip.o : Exec_ParmStrip.cpp Action.h ActionList.h ActionState.h Analys Exec_ParmWrite.o : Exec_ParmWrite.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.h BaseIOtype.h BondSearch.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_ParmWrite.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h Exec_PermuteDihedrals.o : Exec_PermuteDihedrals.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.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_CRD.h DataSet_Coords_REF.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOutList.h Exec.h Exec_PermuteDihedrals.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h ImagedAction.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h PairList.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Random.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StructureCheck.h SymbolExporting.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h TrajectoryFile.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h TypeNameHolder.h Vec3.h Exec_Precision.o : Exec_Precision.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.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_Precision.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h +Exec_PrepareForLeap.o : Exec_PrepareForLeap.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.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_PrepareForLeap.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h Exec_PrintData.o : Exec_PrintData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.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_PrintData.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h Exec_ReadData.o : Exec_ReadData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.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_ReadData.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h Exec_ReadEnsembleData.o : Exec_ReadEnsembleData.cpp Action.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h AtomType.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_ReadEnsembleData.h FileIO.h FileName.h FileTypes.h Frame.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterHolders.h ParameterSet.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h SymbolExporting.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Trajin.h TrajinList.h TrajoutList.h TypeNameHolder.h Vec3.h diff --git a/src/cpptrajfiles b/src/cpptrajfiles index d8593aa396..220c072077 100644 --- a/src/cpptrajfiles +++ b/src/cpptrajfiles @@ -264,6 +264,7 @@ COMMON_SOURCES= \ Exec_ParmWrite.cpp \ Exec_PermuteDihedrals.cpp \ Exec_Precision.cpp \ + Exec_PrepareForLeap.cpp \ Exec_PrintData.cpp \ Exec_ReadData.cpp \ Exec_ReadEnsembleData.cpp \ diff --git a/test/Test_DSSP/ftufabi.assign.dat.save b/test/Test_DSSP/ftufabi.assign.dat.save index 89babbfba4..9781175b64 100644 --- a/test/Test_DSSP/ftufabi.assign.dat.save +++ b/test/Test_DSSP/ftufabi.assign.dat.save @@ -13,6 +13,6 @@ 201 SNFKKMLDYN AMVSPLKKNV DIMEVGNTVA FLCSDMATGI TGEVVHVDAG SS TTHHHHH HHHSSS HHHHHHHHH HHTSTT S SEEE SS -251 YHCVSMGNVL LEHHHHHHnT - GGG S SSSS +251 YHCVSMGNVL LEHHHHHH + GGG S SSSS