#################
# JOB VARIABLES #
#################
start_expt = 23
end_expt = 27
substitution = 'C'
par_dir = '/mindstore/home33ext/kscopino/5JUP_PROTOCOL/PIGGYBACKING/COD1_' + substitution + '2_1S_50PS/'
data_dir = 'COD1_' + substitution + '2_'
###############
# WRITE FILES #
###############
# file to submit to scheduler
outfile = open('run_cpptraj_1a_strip.sh','w')
outfile.write('#!/bin/bash\n' +\
'#BSUB -e err_strip\n' +\
'#BSUB -o out_strip\n' +\
'#BSUB -q exx96\n' +\
'#BSUB -J "strip_CPU"\n' +\
'#BSUB -n 1\n\n' +\
'# env\n' +\
'export PATH=/home/apps/CENTOS7/amber/amber18/bin:$PATH\n' +\
'export LD_LIBRARY_PATH=/home/apps/CENTOS7/amber/amber18/lib:/home/apps/CENTOS7/amber/amber18/lib64:$LD_LIBRARY_PATH\n' +\
'export PATH=/share/apps/openmpi/1.4.4+intel-12/bin:$PATH\n' +\
'export LD_LIBRARY_PATH=/share/apps/openmpi/1.4.4+intel-12/lib:$LD_LIBRARY_PATH\n\n' +\
'# call cpptraj in Amber18\n' +\
'for i in {' + str(start_expt) + '..' + str(end_expt) + '}; do\n' +\
' cd ' + par_dir + data_dir + '$i/DATA/\n' +\
' cpptraj -i cpptraj_1a_strip.in\n' +\
'done\n\n')
outfile.close()
# experimental files
for i in range(start_expt,end_expt + 1):
outfile = open(par_dir + data_dir + str(i) + '/DATA/cpptraj_1a_strip.in', 'w')
outfile.write('# This script is to strip the trajectories.\n' +\
'# prmtop file\n' +\
'parm ' + par_dir + '5JUP_GC_179' + substitution + '_wat.prmtop [modi3]\n\n' +\
'# experimental neutral dynamics trajectory\n' +\
'trajin ' + par_dir + data_dir + str(i) + '/mdcrd_nd_' + str(i) + ' parm [modi3]\n\n' +\
'autoimage\n' +\
'strip :WAT\n' +\
'strip :Na+\n' +\
'strip :Cl-\n\n' +\
'trajout ../mdcrd_nd_' + str(i) + '_strip nobox\n')
outfile.close()