当前位置: 首页>>代码示例>>C++>>正文


C++ PDB::getResidueName方法代码示例

本文整理汇总了C++中PDB::getResidueName方法的典型用法代码示例。如果您正苦于以下问题:C++ PDB::getResidueName方法的具体用法?C++ PDB::getResidueName怎么用?C++ PDB::getResidueName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PDB的用法示例。


在下文中一共展示了PDB::getResidueName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
  }
}
开发者ID:juvejones,项目名称:plumed2,代码行数:29,代码来源:MolDataClass.cpp

示例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"); 
  }
}  
开发者ID:juvejones,项目名称:plumed2,代码行数:37,代码来源:MolDataClass.cpp

示例3: main


//.........这里部分代码省略.........
      	Stopwatch sw3;
      	sw3.start();	
        for(unsigned int j=0;j<ntest;j++)rmsd->calc_DDistDRef_Rot_DRotDPos( r_run, derivatives,DDistDRef, Rotation , DRotDPos, squared); 
      	sw3.stop();	
      	cout<<"WITH ROTATION MATRIX DERIVATIVE: \n"<<sw3<<endl;

        Matrix<std::vector<Vector> > DRotDRef(3,3);
      	Stopwatch sw4;
      	sw4.start();	
        for(unsigned int j=0;j<ntest;j++)rmsd->calc_DDistDRef_Rot_DRotDPos_DRotDRef( r_run, derivatives ,DDistDRef, Rotation , DRotDPos, DRotDRef, squared); 
      	sw4.stop();	
      	cout<<"WITH ROTATION MATRIX DERIVATIVE OF REEFERENCE: \n"<<sw4<<endl;
      	// duplicate the atoms
      	unsigned s=r_run.size();
      	for (unsigned int i=0;i<s;i++){r_run.push_back(r_run[i]);r_ref.push_back(r_ref[i]);r_al.push_back(r_al[i]);r_disp.push_back(r_disp[i]);}
      
      }
  } 
  // Task 9: check the rotation
  if(std::find(task.begin(), task.end(), 9)!=task.end()){
      cout<<"Task 9: dump some pdbs so to check if all makes sense when using inverse transform. In particular positions_aligned.pdb should overlap with reference_centered.pdb "<<endl;
	rmsd->clear();
        rmsd->set(align, displace, ref,type,remove_com,normalize_weights  );	
	// dump the reference
	ofstream myfile;
	myfile.open ("reference.pdb");		
	std::vector<AtomNumber> at=pdb.getAtomNumbers();
	std::vector<Vector>   pos=pdb.getPositions();
	unsigned k=0;
	for(std::vector<AtomNumber>::iterator i=at.begin(); i!=at.end(); i++){
		myfile<<"ATOM";
                myfile.width(7);myfile<<std::right<<(*i).serial()<<" "; 
                myfile.width(4);myfile<<std::left<<pdb.getAtomName(*i); 
                myfile.width(4);myfile<<std::right<<pdb.getResidueName(*i)<<" A"; 
                myfile.width(4);myfile<<std::right<<pdb.getResidueNumber(*i)<<"    "; 
		myfile.setf( std::ios::fixed, std:: ios::floatfield );
                myfile.width(8);myfile.precision(3); myfile<<std::right<<pos[k][0]*10; 
                myfile.width(8);myfile.precision(3); myfile<<std::right<<pos[k][1]*10; 
                myfile.width(8);myfile.precision(3); myfile<<std::right<<pos[k][2]*10<<"  1.00  1.00\n"; 
		k++;	
	}	
	myfile.close();			
	// dump the position
	myfile.open ("positions.pdb");		
	at=pdbrun.getAtomNumbers();
	std::vector<Vector>   runpos=pdbrun.getPositions();
	k=0;
	for(std::vector<AtomNumber>::iterator i=at.begin(); i!=at.end(); i++){
		myfile<<"ATOM";
                myfile.width(7);myfile<<std::right<<(*i).serial()<<" "; 
                myfile.width(4);myfile<<std::left<<pdbrun.getAtomName(*i); 
                myfile.width(4);myfile<<std::right<<pdbrun.getResidueName(*i)<<" A"; 
                myfile.width(4);myfile<<std::right<<pdbrun.getResidueNumber(*i)<<"    "; 
		myfile.setf( std::ios::fixed, std:: ios::floatfield );
                myfile.width(8);myfile.precision(3); myfile<<std::right<<runpos[k][0]*10; 
                myfile.width(8);myfile.precision(3); myfile<<std::right<<runpos[k][1]*10; 
                myfile.width(8);myfile.precision(3); myfile<<std::right<<runpos[k][2]*10<<"  1.00  1.00\n"; 
		k++;	
	}	
	myfile.close();			
	// now do the alignment
	Tensor Rotation;
	Matrix<std::vector<Vector> > DRotDPos(3,3);
        std::vector<Vector> DDistDRef;
	std::vector<Vector> alignedpos;
	std::vector<Vector> centeredpos;
开发者ID:BingqingCheng,项目名称:plumed2,代码行数:67,代码来源:test.cpp


注:本文中的PDB::getResidueName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。