-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhisfix.py
48 lines (32 loc) · 1.23 KB
/
hisfix.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
38
39
40
41
42
43
44
45
#parse through all of mike's data, split it into residue specific data
#/home/mpretiss/proteins/dist/data
import os
import commands
aas = ['HIS']
os.chdir('/home/mprentis/proteins/dist/data')
list = commands.getoutput('ls *.dat').split()
for aa in aas:
print aa
os.chdir('/home/marciovm/proteins/')
file = open(aa + '.dat', 'w')
os.chdir('/home/mprentis/proteins/dist/data')
for pdb in list:
readin = open(pdb, 'r')
count = 0
while count < 21:
line = readin.readline()
if len(line) < 2:
pass
else:
code = line[9]+line[10]+line[11]
if code == aa:
match = 0
line = readin.readline()
while len(line) > 2:
file.write(line)
line = readin.readline()
else:
while len(line) > 2:
line = readin.readline()
count += 1
file.close()