Closest solventsΒΆ

try pytraj online:


../_images/tz2_closest_100.png closest_waters
In [7]:
# load pytraj
import pytraj as pt

# load trajectory
traj = pt.iterload('tz2.ortho.nc', 'tz2.ortho.parm7')
print(traj)

print([res.name for res in traj.top.residues if not res.is_solvent()])
pytraj.TrajectoryIterator, 10 frames: 
Size: 0.001183 (GB)
<Topology: 5293 atoms, 1704 residues, 1692 mols, PBC with box type = ortho>
           
['SER', 'TRP', 'THR', 'TRP', 'GLU', 'ASN', 'GLY', 'LYS', 'TRP', 'THR', 'TRP', 'LYS', 'NHE']
In [9]:
# supposed we want to keep 100 closest solvents around protein

# specify solute mask
# and number of solvents
new_traj = pt.closest(traj, mask=':1-13', n_solvents=100, dtype='trajectory')
print(new_traj)
pytraj.Trajectory, 10 frames: 
Size: 0.000116 (GB)
<Topology: 520 atoms, 113 residues, 101 mols, PBC with box type = ortho>