#!/bin/bash

ptraj_file="tmp.ptraj"
OUT="100ns_10000frames_RMSD"

REF="1XCK_chainA_noWAT.inpcrd"
REF="1XCK_chainA_MGATP_noWAT.inpcrd"

PRMTOP="1XCK_chainA_noWAT.prmtop"
PRMTOP="1XCK_chainA_MGATP_noWAT.prmtop"

TRAJIN_PREFIX[1]="50ns_noWAT_5000frames_wATP_chain"
TRAJIN_PREFIX[2]="50-100ns_noWAT_5000frames_wATP_chain"

DIR="../traj_monomer/"



rm ${ptraj_file}

#for index in 1 2 3 4 5 6 7 8 9 10 11 12 13 14;
for index in 1 2 3 4 5 6 7;
do
	
        echo 'trajin '${DIR}${TRAJIN_PREFIX[1]}_${index}.nc 1 5000 10 >> ${ptraj_file}
        echo 'trajin '${DIR}${TRAJIN_PREFIX[2]}_${index}.nc 1 5000 10 >> ${ptraj_file}

	echo 'reference' ${REF} >> $ptraj_file
        #echo "strip @H*" >> ${ptraj_file}
        echo 'rms reference mass @N,CA,C out '${OUT}_${index}.dat >> $ptraj_file

        ptraj ${PRMTOP} ${ptraj_file}

        rm ${ptraj_file}
done

