import numpy as np
import mdtraj as md
import matplotlib.pyplot as plt
import nglview as ngl
traj0 = md.iterload('xtc_file', chunk=1000, top='pdb_file')
def xyz_gen(traj):
for chunk in traj:
yield chunk.xyz
dihedrals = md.compute_dihedrals(traj0, indices)
一切正常,但当我尝试执行最后一步时,我得到:
AttributeError: 'generator' object has no attribute 'xyz'.
这是什么原因造成的
目前没有回答
相关问题 更多 >
编程相关推荐