#!/bin/bash

ptraj_file="tmp.ptraj"
OUT="50ns_noWAT_1000frames_wATP"


PRMTOP="../../1XCK_MGATP_noWAT.prmtop"
TRAJIN[1]="../traj/1-40ns_imposedOnStart.nc"


#MASK[1]=":1-3668,7337-7350"
MASK[1]=":1-3668"

MASK[2]=":3669-7336"




rm ${ptraj_file}

for index in 1 2;
do
        echo 'trajin '${DIR[index]}${TRAJIN[1]} 1 5000 5 >> ${ptraj_file}

        echo "strip '* & !"${MASK[index]}"'" >> ${ptraj_file}
        echo "strip @H*" >> ${ptraj_file}

	echo 'rms first mass @N,CA,C' >> $ptraj_file
        echo 'trajout '${OUT}"_hept_"${index}".nc nobox netcdf" >> ${ptraj_file}

        ptraj ${PRMTOP} ${ptraj_file}

        rm ${ptraj_file}
done
