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


C++ PDBFile::Molecules方法代码示例

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


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

示例1: main

int main () {
  //PDBFile pdb ("quartz_100_short.pdb");
  PDBFile pdb ("beta-cristobalite.pdb");

  // create the quartz unitcell
  Molecule * uc = pdb.Molecules(0);

  //make copies of the quartz unitcell and shift them around
  //VecR x_shift (4.91, 0.0, 0.0);
  VecR x_shift (10.0, 0.0, 0.0);
  VecR y_shift (0.0, 10.0, 0.0);
  VecR z_shift (0.0, 0.0, 0.0);

  // Create the slab by creating and shifting copies of the unit cell
  Mol_ptr_vec mols = UnitCellToSlab(uc, x_shift, y_shift, z_shift);

  Molecule * mol = MakeSingleMolecule (mols);

  //AddDanglingHydrogens (mol);

  // Take care of renaming the atoms and the residue before printing it out
  FixSingleMoleculeNaming (mol);

  PrintMoleculePDB (mol);

  return 0;
}
开发者ID:eshamay,项目名称:interfacemd,代码行数:27,代码来源:make-quartz-slab.cpp

示例2: main

int main () {

  PDBFile pdb ("temp.pdb");

  Molecule * mol = pdb.Molecules(0);
  mol->Name("qtz");
  std::vector<Atom *> atoms = mol->Atoms();

  /* cycle through each atom in order of the pdb file */
  RUN (atoms)
  {
	Atom * atom = atoms[i];
	atom->Residue("qtz");
	VecR pos = atom->Position();

	/* find the surface Oxygens */
	if (atom->Name().find("O") != string::npos && pos[z] > -7.9)
	{
	  /* add H's to the surface */
	  Atom * h = new Atom ("H", pos + VecR (0.0, 0.0, 1.1));
	  mol->AddAtom(h);
	}
  }
  std::vector<Molecule *> mols;
  mols.push_back(mol);
  PDBFile::WritePDB(mols);
}
开发者ID:eshamay,项目名称:interfacemd,代码行数:27,代码来源:find-oh.cpp

示例3: main

int main () {
  // The unitcell's PDB file - must have a "TER" after the residue
  PDBFile pdb ("octadecane.pdb");
  string name = "odn";
  double spacing = 5.528;	// inter-chain spacing

  GridParams params (pdb.Molecules(0), name, spacing, 7, 1, 6);

  // Create the slab by creating and shifting copies of the unit cell
  Mol_ptr_vec mols = UnitCellToSlab(params);

  //Molecule * mol = MakeSingleMolecule (params);

  //AddDanglingHydrogens (params);

  // Take care of renaming the atoms and the residue before printing it out
  //FixSingleMoleculeNaming (params);

  PrintMoleculesPDB (mols);

  return 0;
}
开发者ID:eshamay,项目名称:interfacemd,代码行数:22,代码来源:molgrid.cpp


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