-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_spa_files.py
More file actions
executable file
·41 lines (30 loc) · 1.01 KB
/
Copy pathmake_spa_files.py
File metadata and controls
executable file
·41 lines (30 loc) · 1.01 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
#!/usr/bin/python
import sys,os
import fpdb
infile = sys.argv[1]
a1_file = 'a1.pdb'
lig_file = 'a1_lig.pdb'
rec_file = 'rec.pdb'
para_source = '/home/fuqiuyu/work/nmr_druggability/md/finished/1dhm/spa/SPA.para'
para_file = 'SPA.para'
print ">>>>> preparing SPA input files"
for model in fpdb.next_frame(infile):
pdb = fpdb.fPDB(model)
pdb.write_pdb(a1_file)
print "----- sys pdb done."
ofp_rec = open(rec_file,'w')
for residue in pdb.topology.residues:
if residue.name in fpdb.standard_protein_residues:
residue.write_pdb(ofp_rec)
print "----- rec pdb done."
ofp_lig = open(lig_file,'w')
for line in open(rec_file):
if len(line)>=6 and line[:6] in ('ATOM ','HETATM'):
if line[12:16].strip() not in ('C','O','N','CA'):
if line[13] != 'H':
ofp_lig.write(line)
print "----- lig pdb done."
break ## important !!
os.system("cp %s %s"%(para_source,para_file))
print "----- SPA.para done."
print "----- All done."