#!/bin/bash
#
# Code by  venkentom@gmail.com
#
# Licenced by the GPL General Public License
# Have a look at:
# http://www.gnu.org/copyleft/gpl.html
# For more information about the GPL License
#
# I am not responsible for what this code does to your hw/sw/mind
# Use at your own risk
# 

#Put gromacs commands after this line

DIR=`pwd`

#Config
NPROCS=2

# Things to consider: -f is the CG input structure, -p is the AA topology!
# separate topology for protein made using pdb2gmx:
#	pdb2gmx -f TM31C_sed.pdb -ignh (select CHARMM36!!)
# lipids treated by CHARMM36
# water treated by CHARMM TIP3P model
# use posre.itp and posre_popc.itp for position restrained during backwarding step
# map_chol.sed: script needed to correct mapping files of cholesterol in Mapping/ (apparently due to different naming): chol.charmm36.map (make sure to delete old file!)
# change ASP0 to ASPP, both when making topol (above) and in dynamic.gro!!

sh initram.sh -f dynamic.gro -o system_aa.gro -to charmm36 -p topol_aa.top

grompp -f emst.mdp -c system_aa.gro -p backmapped.top -o emst.tpr 
mdrun -deffnm emst -v -nt 4

editconf -f emst.gro -o emst.pdb

#make_ndx -f emst.gro -o index.ndx <<EOL
#13 | 14
#name 18 Membrane
#q
#EOL

#grompp -f eq.mdp -c emst.gro -p backmapped.top -o eq.tpr -n index.ndx
#mdrun -deffnm eq -v

#grompp -f md.mdp -c eq.gro -p backmapped.top -o md.tpr -n index.ndx -t eq.trr
#mdrun -deffnm md -v



rm \#*
