forked from haoyuanchen/RASPA-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmbai.py
38 lines (31 loc) · 1.1 KB
/
mbai.py
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
"""
about:
main script (wrapper) of MBAI
usage:
python mbai.py
Haoyuan Chen, 03.17.2020
"""
import os
# set up the calculation here
raspa_dir = '' # do 'echo $RASPA_DIR' to see
adsorbate = '' # xx.pdb, saved from Gaussview or Avogadro
mof = '' # xx.cif, the binding site(s) should be labeled as 'Z0' (and 'Z1' if bidentate)
nsites = 1 # 1 if monodentate, 2 if bidentate
site1 = 1 # index of binding atom 1 which will bind to Z0, 1-start
dist1 = 2.00 # length of 1st bond in A
ncifs = 1 # save the last x frames from MC
# if nsites==2
site2 = 2 # index of binding atom 2 which will bind to Z1, 1-start
dist2 = 2.00 # length of 2nd bond in A
# generates the script that does everything
f = open('mbai.sh','w')
if nsites == 1:
f.write('python pdb2def.py %s %d %.2f\n'%(adsorbate,site1,dist1))
elif nsites == 2:
f.write('python pdb2def.py %s %d %.2f %d %.2f\n'%(adsorbate,site1,dist1,site2,dist2))
f.write('python simgen.py %s %s\n'%(mof,adsorbate))
f.write('%s/bin/simulate simulation.input\n'%(raspa_dir))
f.write('python cifgen.py %s %d\n'%(mof,ncifs))
f.close()
# this will run MBAI
os.system('mbai.sh')