我有一个从 MDAnalysis.pca.transform() 生成的形状为 (150017, 5) 的数组 tpcs。我正在尝试将其加载为轨迹以将其可视化。我试过了:
u = mda.Universe(trjpath+'md.gro', tpcs)
返回错误:
ValueError Traceback (most recent call last)
<ipython-input-80-ea97f213be3c> in <module>()
----> 1 u = mda.Universe(trjpath+'md.gro', tpcs)
/nfs/homes/kreidy/Library/mdanalysis/package/MDAnalysis/core/universe.pyc in __init__(self, *args, **kwargs)
276 else:
277 coordinatefile = args[1:]
--> 278 self.load_new(coordinatefile, **kwargs)
279
280 # Check for guess_bonds
/nfs/homes/kreidy/Library/mdanalysis/package/MDAnalysis/core/universe.pyc in load_new(self, filename, format, in_memory, **kwargs)
424 kwargs['n_atoms'] = self.atoms.n_atoms
425
--> 426 self.trajectory = reader(filename, **kwargs)
427 if self.trajectory.n_atoms != len(self.atoms):
428 raise ValueError("The topology and {form} trajectory files don't"
/nfs/homes/kreidy/Library/mdanalysis/package/MDAnalysis/coordinates/memory.pyc in __init__(self, coordinate_array, order, dimensions, dt, filename, **kwargs)
275 "does not match the shape of the coordinate "
276 "array ({})"
--> 277 .format(provided_n_atoms, self.n_atoms))
278
279 self.ts = self._Timestep(self.n_atoms, **kwargs)
ValueError: The provided value for n_atoms (132506) does not match the shape of the coordinate array (5)
如何将此数组加载到轨迹中?