本文整理汇总了C++中PDB::getNamedAtomFromResidue方法的典型用法代码示例。如果您正苦于以下问题:C++ PDB::getNamedAtomFromResidue方法的具体用法?C++ PDB::getNamedAtomFromResidue怎么用?C++ PDB::getNamedAtomFromResidue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDB
的用法示例。
在下文中一共展示了PDB::getNamedAtomFromResidue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getBackboneForResidue
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: specialSymbol
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");
}
}