Contents
pytraj.iterload
instead of pytraj.load
pytraj
support much for in-memory calculation?traj[1:11:2]
and traj(1, 11, 2)
?pytraj
pytraj.iterload
instead of pytraj.load
¶Because we encourage user to use out-of-core calculation for memory saving. Most of the time we don’t need change trajecotry’s coordinate, so it’s OK to just use immutable trajectory.
pytraj
support much for in-memory calculation?¶Yes, pytraj
does support in-memory calculation very well. Just consider
pytraj.Trajectory
as a mutable Python’s list and pytraj.TrajectoryIterator
as
immutable Python’s tuple.
traj[1:11:2]
and traj(1, 11, 2)
?¶traj[1:11:2]
returns a new pytraj.Trajectory
while traj(1, 11, 2)
returns a
FrameIterator for lazy loading. You can use both for analysis.
In [1]: import pytraj as pt
In [2]: traj = pt.iterload('tz2.nc', 'tz2.parm7')
In [3]: traj[1:11:2]
Out[3]:
pytraj.Trajectory, 5 frames:
Size: 0.000025 (GB)
<Topology: 223 atoms, 13 residues, 1 mols, non-PBC>
In [4]: pt.radgyr(traj[1:11:2])