#!/bin/bash

MAL="MAL.ptraj"
ptraj_file="tmp.ptraj"


OUT[1]="distance116"
OUT[2]="distance129"

MASK=":460@CD :975@CZ"

DIR_PREFIX[1]="/net/gulrotkake/slars/groel_md/1XCK/116_1XCK_apo"
DIR_PREFIX[2]="/net/gulrotkake/slars/groel_md/1XCK/129_1XCK_MGATP"


PRMTOP[1]="1XCK_chainALM_noWAT.prmtop"
PRMTOP[2]="1XCK_chainALM_ATP_noWAT.prmtop"


TRAJIN[1]="30-50ns_noWAT_2000frames_chain_"
TRAJIN[2]="30-50ns_noWAT_2000frames_wATP_chain_"


for dir in 1 2;
do
	rm ${ptraj_file}
	for index in 1 2 3 4 5 7; 
	do
	
		TRJDIR=${DIR_PREFIX[dir]}"/results/traj_trimer/"
		echo 'trajin '${TRJDIR}${TRAJIN[dir]}${index}.nc 1 2000 2 >> ${ptraj_file}

		done	

	echo 'distance dist '${MASK}' out '${OUT[dir]}'.dat' >> ${ptraj_file}
	ptraj ${PRMTOP[dir]} ${ptraj_file}

done
