From 45895eaca341388041e91f9bbeafb2c4aa81e2d2 Mon Sep 17 00:00:00 2001 From: Carlo Camilloni <carlo.camilloni@gmail.com> Date: Fri, 20 Dec 2013 22:43:55 +0100 Subject: [PATCH] added omega as additional symbol for atom selection in proteins --- src/tools/MolDataClass.cpp | 10 ++++++++++ src/tools/MolDataClass.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tools/MolDataClass.cpp b/src/tools/MolDataClass.cpp index a080268d5..c29f13820 100644 --- a/src/tools/MolDataClass.cpp +++ b/src/tools/MolDataClass.cpp @@ -124,6 +124,16 @@ void MolDataClass::specialSymbol( const std::string& type, const std::string& sy numbers[1]=mypdb.getNamedAtomFromResidue("CA",resnum); numbers[2]=mypdb.getNamedAtomFromResidue("C",resnum); numbers[3]=mypdb.getNamedAtomFromResidue("N",resnum+1); + } else if( symbol.find("omega")!=std::string::npos ){ + std::size_t dash=symbol.find_first_of('-'); + unsigned resnum; Tools::convert( symbol.substr(dash+1), resnum ); + std::string resname = mypdb.getResidueName(resnum); + if( !allowedResidue( type, resname ) || isTerminalGroup( type, resname ) ) return ; + numbers.resize(4); + numbers[0]=mypdb.getNamedAtomFromResidue("CA",resnum); + numbers[1]=mypdb.getNamedAtomFromResidue("C",resnum); + numbers[2]=mypdb.getNamedAtomFromResidue("N",resnum+1); + numbers[3]=mypdb.getNamedAtomFromResidue("CA",resnum+1); } } else { plumed_merror(type + " is not a valid molecule type"); diff --git a/src/tools/MolDataClass.h b/src/tools/MolDataClass.h index 6247795da..8e2804f12 100644 --- a/src/tools/MolDataClass.h +++ b/src/tools/MolDataClass.h @@ -43,7 +43,7 @@ public: static void getBackboneForResidue( const std::string& type, const unsigned& residuenum, const PDB& mypdb, std::vector<AtomNumber>& atoms ); /// Return true if the residue is a terminal group e.g. ACE, NME for proteins static bool isTerminalGroup( const std::string& type, const std::string& residuename ); -/// Used to interpret special symbols - currently phi and psi +/// Used to interpret special symbols - currently phi and psi and omega static void specialSymbol( const std::string& type, const std::string& symbol, const PDB& mypdb, std::vector<AtomNumber>& numbers ); }; -- GitLab