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


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

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


在下文中一共展示了PDB::setLigandsToFind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: processSinglePDBFile

bool processSinglePDBFile(const char* filename,
                          Options& opts,
                          ofstream& output_file,
                          ofstream& pairlistfile,
                          const char* chains)
{
  int numRes1 = opts.residue1.size();
  int numRes2 = opts.residue2.size();

  // Read in the PDB file
  // This function actually reads and stores more information than
  // we really need, but the files are relatively small so it isn't
  // taking up much RAM (from what I saw, < 5MB each PDB file)
  // with a few exceptions
  PDB PDBfile_whole(filename, opts.resolution);

  if( PDBfile_whole.fail() )
    {
      //cerr << red << "Error" << reset << ": Parsing PDB file failed!" << endl;
      PDBfile_whole.printFailure();
      return false;
    }

  for(unsigned int model=0; model < PDBfile_whole.models.size(); model++)
    {
      PDB PDBfile = PDBfile_whole.models[model];
      PDBfile.filename = PDBfile_whole.filename;
      PDBfile.resolution = PDBfile_whole.resolution;

      PDBfile.setResiduesToFind(&opts.residue1, &opts.residue2);
      if(opts.numLigands)
        {
          PDBfile.setLigandsToFind(&opts.ligands);
        }
      PDBfile.populateChains(false);

      if( opts.numLigands )
        {
          PDBfile.findLigands( opts.ligands );
        }

      //If we're searching for triplets, then do that here
      if(opts.triplets == true){
      //this triple for loop is set up so that it searches through each
      //unique combination of chains. e.g. if there are 3 chains labeled 1, 2, and 3
      //it will search through the combinations: 111 112 113 122 123 133 222 223 233 333
        for(unsigned int i = 0; i < PDBfile.chains.size(); i++)
        {

	if(opts.sameChain){
          searchTripletInformation(PDBfile,opts,i,i,i,output_file,pairlistfile);
          return true;
	}

	// in the future we may have the below double for loop go through each chain combination.
          for(unsigned int j = i; j < PDBfile.chains.size(); j++)
          {
            for(unsigned int k = j; k < PDBfile.chains.size(); k++)
            {
		searchTripletInformation(PDBfile,opts,i,j,k,output_file,pairlistfile);
            }
          }
        }
        return true;  //end here if we're processing triplets
      }



      // Searching for interations within each chain
      for(unsigned int i = 0; i < PDBfile.chains.size(); i++)
        {
          // Check if we are supposed to look at certain chains
          if( chains )
            {
              if( !strchr(chains,PDBfile.chains[i].id) )
                {
                  continue;
                }
            }
          // if we want to look for interactions between the ith chain
          // and each of the other chains, we set the indices to loop
          // through all the chains
          unsigned int start = 0;
          unsigned int end   = PDBfile.chains.size();

          // otherwise we just set the indices to go through the ith chain
          if(opts.sameChain)
            {
              start = i;
              end   = i+1;
            }

          for(unsigned int j = start; j < end; j++)
            {


              for(int ii = 0; ii < numRes1; ii++)
                {
                  for(int jj = 0; jj < numRes2; jj++)
                    {
//.........这里部分代码省略.........
开发者ID:bbitmaster,项目名称:STAAR,代码行数:101,代码来源:staar.cpp


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