本文整理汇总了Python中simtk.openmm.app.PDBFile.forcefield方法的典型用法代码示例。如果您正苦于以下问题:Python PDBFile.forcefield方法的具体用法?Python PDBFile.forcefield怎么用?Python PDBFile.forcefield使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simtk.openmm.app.PDBFile
的用法示例。
在下文中一共展示了PDBFile.forcefield方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_pdb
# 需要导入模块: from simtk.openmm.app import PDBFile [as 别名]
# 或者: from simtk.openmm.app.PDBFile import forcefield [as 别名]
def from_pdb(cls, path, forcefield=None, **kwargs):
"""
Loads topology, positions and, potentially, velocities and vectors,
from a PDB file
Parameters
----------
path : str
Path to PDB file
forcefields : list of str
Paths to FFXML and/or FRCMOD forcefields. REQUIRED.
Returns
-------
pdb : SystemHandler
SystemHandler with topology, positions, and, potentially, velocities and
box vectors. Forcefields are embedded in the `master` attribute.
"""
pdb = PDBFile(path)
box = kwargs.pop('box', pdb.topology.getPeriodicBoxVectors())
positions = kwargs.pop('positions', pdb.positions)
velocities = kwargs.pop('velocities', getattr(pdb, 'velocities', None))
if not forcefield:
from .md import FORCEFIELDS as forcefield
print('INFO: Forcefields for PDB not specified. Using default:\n ',
', '.join(forcefield))
pdb.forcefield = ForceField(*list(process_forcefield(*forcefield)))
return cls(master=pdb, topology=pdb.topology, positions=positions,
velocities=velocities, box=box, path=path, **kwargs)