-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathorder_parameters_calculate.sh
More file actions
executable file
·50 lines (41 loc) · 1.56 KB
/
order_parameters_calculate.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Gromacs 5.x version of ...
# bash wrapper for calculating Order Parameters of lipid bilayer
# python script/library calcOrderParameters.py
# meant for use with NMRlipids projects
#------------------------------------------------------------
# Made by J.Melcr, Last edit 2017/03/21
#------------------------------------------------------------
#
# Generation of non-water trajectory removed by O.H.S Ollila, 2018/08/23
#
scriptdir='../../../../../scripts/'
traj_file_name="traj.xtc"
tpr_file_name="topol.tpr"
conf_file_name="conf.gro"
op_def_file="defFILE.def"
op_out_file="OrdPars.dat"
top="topol.top"
traj_pbc_file_name="traj_pbc.xtc"
f_conc=55430 # in mM/L
if ! [ -s $tpr_file_name ]
then
echo "We really need " $tpr_file_name " , but we can't find it!"
exit 1
fi
# remove PBC:
! [ -s $traj_pbc_file_name ] && echo System | gmx trjconv -f $traj_file_name -s $tpr_file_name -o $traj_pbc_file_name -pbc mol
#CALCULATE ORDER PARAMETERS
python $scriptdir/calcOrderParameters.py -i $op_def_file -t $conf_file_name -x $traj_pbc_file_name -o $op_out_file
#getting concentration from topol.top file (if exists)
if [ -f $top ]
then
nwat=`grep -e "molecules" -A 10 $top | grep -e "^SOL" -e "^TIP" -e "^OPC3" | cut -d " " -f1 --complement `
nion=`grep -e "molecules" -A 10 $top | grep -e "^NA" -e "^CA" | cut -d " " -f1 --complement `
[ -z $nion ] && nion=0
conc=`echo $f_conc "*" $nion / $nwat | bc`
echo conc: $conc
sed "s/conc/$conc/" -i ${op_out_file}.line
else
echo "Topology probably not present, can't calculate concentration."
fi