为了方便修改,整个力场进行了模块化的转换,所有氨基酸/离子/水的原子类型名称和原来的一样,核酸的原子类型均添加"_n"后缀,脂质中的原子类型均添加"_l"后缀以示区分
由于目前Amber系列力场中(D. E. Shaw Res.开发的DES-Amber除外)不涉及特定原子类型之间的LJ势定义,因此不会引发其它问题
感谢楼主分享!我有两个问题1.使用该力场该如何引用2.记录一个问题:在运行gmxmmpbsa时候由于该力场中的水分子力场如tip3p.itp中的func.缺失,Parmed转换时候发生了报错‘IndexError: list index out of range’,解决方法1.修改parmed文件‘/envs/gmxMMPBSA/lib/python3.11/site-packages/parmed/gromacs/gromacstop.py’中line600,angle也会报错以此类推2.为每个itp添加func
#line304
复制代码
from .. import load_file
super(GromacsTopologyFile, self).__init__()
self.filename = fname
self.parameterset = None
self.defaults = _Defaults(gen_pairs='yes') # make ParmEd's default yes
if fname is not None:
self.read(fname, defines, parametrize)
# Fill in coordinates and unit cell information if appropriate
if xyz is not None:
if isinstance(xyz, str):
f = load_file(xyz, skip_bonds=True)
if not hasattr(f, 'coordinates') or f.coordinates is None:
raise TypeError(f'File {xyz} does not have coordinates')
self.coordinates = f.coordinates
if box is None and hasattr(f, 'box'):
self.box = f.box
else:
self.coordinates = xyz
if box is not None:
self.box = box
self.unchange()
elif xyz is not None or box is not None:
raise ValueError('Cannot provide coordinates/box and NOT a top')
#line600
def _parse_bonds(self, line, bond_types, atoms):
""" Parses a bond line. Returns a Bond, BondType/None """
words = line.split()
try:
i, j = int(words[0])-1, int(words[1])-1
funct = int(words[2])
except:
print('Error parsing bond line:', words, self.filename)
i, j = int(words[0])-1, int(words[1])-1
funct = 1