-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefine_strand_boundaries.py
executable file
·54 lines (38 loc) · 1.18 KB
/
define_strand_boundaries.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
46
47
48
49
50
51
#!/usr/bin/python
from os import popen
import sys
import string
secstructprobfiles = sys.argv[1:]
for secstructprobfile in secstructprobfiles:
lines = open(secstructprobfile,'r').readlines()
Cweight = []
Hweight = []
Eweight = []
for line in lines:
cols = string.split(line)
if len(cols) > 3:
resnum = int( cols[0] )
Cweight.append( float( cols[1] ) )
Hweight.append( float( cols[2] ) )
Eweight.append( float( cols[3] ) )
in_strand = 0
outfile = secstructprobfile + '.strandpred.txt'
out = open(outfile,'w');
E_BEGIN_CUTOFF = 0.25
E_END_CUTOFF = 0.5
MIN_STRAND_LENGTH = 4
E_BEGIN_CUTOFF = 0.1
E_END_CUTOFF = 0.5
MIN_STRAND_LENGTH = 3
E_BEGIN_CUTOFF = 0.1
E_END_CUTOFF = 0.1
MIN_STRAND_LENGTH = 3
for i in range(resnum):
if not in_strand and (Eweight[i] > E_BEGIN_CUTOFF):
in_strand = 1
startnum = i+1
if in_strand and (Eweight[i] < E_END_CUTOFF):
in_strand = 0
endnum = i+1
if endnum-startnum+1 > MIN_STRAND_LENGTH:
out.write('%3d %3d\n' % (startnum,endnum))