-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.py
More file actions
28 lines (23 loc) · 845 Bytes
/
parse.py
File metadata and controls
28 lines (23 loc) · 845 Bytes
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
import sys
import inputParser
def run(inp):
for line in open(inp,'r'):
token = line.split(':')
if token:
if token[0] not in {'RES','DSSP'}:
continue
else:
inp = inputParser.processLine(token[1])
temp = list(inp)
if token[0] == 'RES':
if 'B' in inp or 'Z' in inp or 'X' in inp:
print "Skipping file: "+ inp
skip = True
continue
return processLine(token[1])
def processLine(line):
input = line.strip().replace(',','')
print "Input: " + input
inp = line.strip().split(',')
inp.remove('')
return inp