I want to make a sub trajectory for a discontinuous set of frames (based on my own clustering criteria) from the main trajectory. I realize that the gmx trjconv -sub command is not working.
I have an index file with target frames, but which command should I use along with gmx trjconv
Assuming for some reason you cannot use trjconv -sub (I am not following this forum much so I don’t know why), you can always trjconv -sep -o OUTPUT/frame.pdb, then use a shell script to paste the parts you want. Unfortunately, trjconv -sep doesn’t work with binary files and trjcat doesn’t work with non-binary files since a decade or so.
separate the frames: mkdir FRAMES; echo System | $GMX trjconv -f my.xtc -o FRAMES/frame.pdb -s my.tpr -sep
join the ones you want (e.g., 0, 1, 5, and 9): cat $(for fr in 0 1 5 9; do echo -n "FRAMES/frame${fr}.pdb "; done) > clust1.pdb