source ww_nearest.tcl # initial trajectory set trajpsf small_pept.psf set trajdcd neat_every100.dcd #load the full trajectory set mol [mol new $trajpsf waitfor all] mol addfile $trajdcd waitfor all #define some variables set newtrajname trimmed_traj set macromol "(protein)" set what "(water)" set cutoff 5 set howmany 10 #generate a trimmed trajectory, i.e., protein or water within $cutoff of ww_nearest $macromol $what $cutoff $howmany $newtrajname $mol quit