Difference between topology_format vs format arguments in Universe constructor? #4949
Replies: 1 comment 1 reply
-
|
In [1]: import MDAnalysis as mda; import MDAnalysisTests.datafiles as data
In [6]: u = mda.Universe(data.TPR, data.TRR)
In [7]: u.trajectory.n_frames
Out[7]: 10
In [8]: u = mda.Universe(data.TPR, [data.TRR, data.TRR, data.XTC])
In [9]: u.trajectory.n_frames
Out[9]: np.int64(30)
In [10]: u = mda.Universe(data.TPR, data.TRR, data.TRR, data.XTC, data.TRR)
In [11]: u.trajectory.n_frames
Out[11]: np.int64(40)
In [12]: u.trajectory
Out[12]: <ChainReader containing adk_oplsaa.trr and 3 more with 40 frames of 47681 atoms>Note that
In order to be able to clearly set the format for either topology or trajectory files with such a flexible way to specify topologies and trajectories we need the two different keywords. Finally, there's the special case of creating a universe from a single file. The most common case are formats such as PDB or GRO or XYZ, which contain topology information (particle types etc) and coordinates. However, you can create a minimalist universe from a trajectory file, too ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
What's the fundamental difference between topology_format vs format in the Universe constructor. I've been experimenting with both here in this PR #4943
And it seems like you can just construct a universe by either passing
Universe(topology_format='PDB')(from me messing around in the code) orUniverse(format='pdb')(as linked here)Is there any real fundamental difference in initalizing a universe between the two arguments?
Beta Was this translation helpful? Give feedback.
All reactions