#!/bin/bash

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

REF="1XCK_chainA_sol.inpcrd"

PRMTOP="../../1XCK_apo_noWAT.prmtop"

TRAJIN[1]="../traj/50ns_5000frames_noWAT_noATP_noRhod.nc"

MASK[1]=":1-3668"
MASK[2]=":3669-7336"


rm ${ptraj_file}

for index in 1;
do
        echo 'trajin '${TRAJIN[1]} 1 5000 5 >> ${ptraj_file}
        #echo 'trajin '${TRAJIN[1]} 1 2500 1 >> ${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
