Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for folder in `ls $1`; do
- echo "Peeking into ${folder}"
- if [ ! -e ${1}/${folder}/md.log ]; then
- echo "!! No md.log in here"
- continue
- fi
- if [ -e ${1}/last_frames/${folder}.pdb ]; then
- echo "Already dumped and saved!"
- continue
- fi
- # Extract relevant index ( 0 for system )
- # toto.txt is just a txt file with keep 0\nq
- make_ndx -o ${1}/${folder}/traj.ndx -f ${1}/${folder}/conf.gro < toto.txt &> /dev/null
- # Extract last step (This works for l-BFGS integrators! The grep will fail otherwise)
- fstep=`grep "Low-Memory BFGS Minimizer converged" ${1}/${folder}/md.log | awk '{ print $(NF-1) }'`
- # Dump PDB & Copy to special directory
- trjconv -f ${1}/${folder}/traj.trr -s ${1}/${folder}/topol.tpr -n ${1}/${folder}/traj.ndx -o ${1}/${folder}/${folder}.pdb -dump $fstep &> ${1}/${folder}/d$
- cp ${1}/${folder}/${folder}.pdb ${1}/last_frames/${folder}.pdb
- echo "PDB File dumped and saved"
- done
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement