-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_MM_input.sh
executable file
·67 lines (51 loc) · 1.65 KB
/
create_MM_input.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
aminoacid='GLY'
## GENERATE "tleap_f14.in" file
cat << END > tleap_f14.in
source leaprc.protein.ff14SB
${aminoacid} = loadpdb point.pdb
savepdb ${aminoacid} ${aminoacid}.pdb
set $aminoacid box {30.0 30.0 30.0}
saveamberparm ${aminoacid} ${aminoacid}_ff14.top ${aminoacid}_ff14.crd
saveamberparm ${aminoacid} ${aminoacid}_ff14.prmtop ${aminoacid}_ff14.rst7
quit
END
cat << END > vmd_create_reaxff_data.sh
package require topotools
topo readlammpsdata data.${aminoacid}_ff14
topo writelammpsdata data.${aminoacid}_reaxff charge
quit
END
cat << END > launch_min.sh
#!/bin/bash
for i in {1..25}; do
cp min.in POINT\$i
cd POINT\$i
sander -O -i min.in -o min.out -p ${aminoacid}_ff14.prmtop -c ${aminoacid}_ff14.rst7 &
cd ..
done
END
chmod +x launch_min.sh
rm -r POINT*
natoms=$(head -1 optimized_geom.xyz)
awk '{print substr($0,1,26)}' ${aminoacid}.pdb > LEFT_PDB
awk '{print substr($0,28,78)}' optimized_geometries.pdb > RIGHT_PDB
echo $natoms
for i in {1..25};
do
head -$((i*(natoms+1))) RIGHT_PDB | tail -$((natoms)) > point$i
paste -d " " LEFT_PDB point$i > point.pdb
rm point$i
mkdir POINT$i
cp point.pdb POINT$i/
cp tleap_f14.in POINT$i/
cp vmd_create_reaxff_data.sh POINT$i/
cd POINT$i
tleap -f tleap_f14.in
cp point.*pdb point$i.pdb
python /usr/local/lammps/tools/amber2lmp/amber2lammps.py ${aminoacid}_ff14
vmd -dispdev text -e vmd_create_reaxff_data.sh
cd ..
done
ntype=$(grep "atom types" POINT1/data."$aminoacid"_ff14 | awk '{print $1}')
grep -A $((ntype+1)) "Masses" POINT1/data."$aminoacid"_ff14 | awk '{print $2}' | tail -$ntype > atom_masses.txt