#!/bin/bash

ptraj_file="tmp.ptraj"
OUT="corr_50ns_CA"

PRMTOP="trimer_ADP.prmtop"
REF="trimer_ADP.inpcrd"


TRAJIN="../traj_trimer/50ns_noWAT_1000frames_wADP_chain"

rm ${ptraj_file}

for index in 2 3 4 5 6 7; 
do
        echo "trajin "${TRAJIN}"_"${index}".nc 1 1000 1" >> ${ptraj_file}
	echo "reference "${REF} >> ${ptraj_file}
	echo "rms reference mass @CA" >> ${ptraj_file}
	echo "matrix correl @CA,C2,C4,C5,C6,C8,C1*,C2*,C3*,C4*,C5*,PA,PB,PG name mwcvmat out" ${OUT}"_chain_"${index} "mass" >> ${ptraj_file}

        ptraj ${PRMTOP} ${ptraj_file}

        rm ${ptraj_file}
done
