예제 #1
0
void MolDataClass::getBackboneForResidue( const std::string& type, const unsigned& residuenum, const PDB& mypdb, std::vector<AtomNumber>& atoms ){
  std::string residuename=mypdb.getResidueName( residuenum );
  plumed_massert( MolDataClass::allowedResidue( type, residuename ), "residue " + residuename + " unrecognized for molecule type " + type );
  if( type=="protein" ){
     if( residuename=="GLY"){
         atoms.resize(5);
         atoms[0]=mypdb.getNamedAtomFromResidue("N",residuenum);
         atoms[1]=mypdb.getNamedAtomFromResidue("CA",residuenum);
         atoms[2]=mypdb.getNamedAtomFromResidue("HA1",residuenum);
         atoms[3]=mypdb.getNamedAtomFromResidue("C",residuenum);
         atoms[4]=mypdb.getNamedAtomFromResidue("O",residuenum);
     } else if( residuename=="ACE"){
         atoms.resize(1); 
         atoms[0]=mypdb.getNamedAtomFromResidue("C",residuenum);
     } else if( residuename=="NME"){
         atoms.resize(1); 
         atoms[0]=mypdb.getNamedAtomFromResidue("N",residuenum);
     } else {
         atoms.resize(5);
         atoms[0]=mypdb.getNamedAtomFromResidue("N",residuenum);
         atoms[1]=mypdb.getNamedAtomFromResidue("CA",residuenum); 
         atoms[2]=mypdb.getNamedAtomFromResidue("CB",residuenum);
         atoms[3]=mypdb.getNamedAtomFromResidue("C",residuenum);
         atoms[4]=mypdb.getNamedAtomFromResidue("O",residuenum);
     }
  } else {
     plumed_merror(type + " is not a valid molecule type");
  }
}
예제 #2
0
void MolDataClass::specialSymbol( const std::string& type, const std::string& symbol, const PDB& mypdb, std::vector<AtomNumber>& numbers ){
  if( type=="protein" ){
      if( symbol.find("phi")!=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("C",resnum-1); 
         numbers[1]=mypdb.getNamedAtomFromResidue("N",resnum);
         numbers[2]=mypdb.getNamedAtomFromResidue("CA",resnum);
         numbers[3]=mypdb.getNamedAtomFromResidue("C",resnum);
      } else if( symbol.find("psi")!=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("N",resnum); 
         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"); 
  }
}