Closed autodataming closed 5 years ago
hi, sorry for the late reply. (I thought your account is a spammer). What's your aim of removing the box information?
I hvae solved the problem by CPPTRAJ command. If pytraj can do this, it will be very cool.
hi @autodataming, can you try with below code and let me know if that works for you.
n [26]: traj = pt.datafiles.load_tz2_ortho()[:]
In [27]: traj
Out[27]:
pytraj.Trajectory, 10 frames:
Size: 0.001183 (GB)
<Topology: 5293 atoms, 1704 residues, 1692 mols, PBC with box type = ortho>
In [28]: traj.strip(':WAT')
Out[28]:
pytraj.Trajectory, 10 frames:
Size: 0.000049 (GB)
<Topology: 220 atoms, 13 residues, 1 mols, PBC with box type = ortho>
In [29]: traj.unitcells = None
In [30]: traj.top.box = pt.core.box.Box()
In [31]: traj.top.save('new.prmtop')
In [32]: pt.write_traj('new.nc', traj, overwrite=True)
In [33]: traj2 = pt.load('new.nc', 'new.prmtop')
In [34]: traj2
Out[34]:
pytraj.Trajectory, 10 frames:
Size: 0.000049 (GB)
<Topology: 220 atoms, 13 residues, 1 mols, non-PBC>
how to remove box information in the trajectory by pytraj?