-
Notifications
You must be signed in to change notification settings - Fork 3
/
export_frags_rhiju.py
executable file
·134 lines (110 loc) · 3.31 KB
/
export_frags_rhiju.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/python
from sys import argv
from os import system
from os.path import abspath, dirname,basename,exists
from glob import glob
indir = argv[1]
outdir = argv[2]
#assert( dirname( abspath(outdir)) == '/work/casp7/fragout')
command = 'mkdir '+outdir
print(command)
system(command)
proteinname = basename( abspath(outdir))
fivelettercode = proteinname[-5:]
prefix = proteinname[:-5]
chain = fivelettercode[-1]
infile = glob(indir+'/*.fasta')[0]
outfile = outdir+'/'+prefix+fivelettercode+'.fasta'
command = 'cp '+infile+' '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
infile = glob(indir+'/*.psipred_ss2')[0]
outfile = outdir+'/'+prefix+fivelettercode+'.psipred_ss2'
command = 'cp '+infile+' '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
fourlettercode = fivelettercode[:4]
infiles = glob(indir+'/*.pdb')
if len( infiles ) > 0:
infile = infiles[0]
outfile = outdir+'/'+ prefix + fourlettercode+'.pdb'
command = 'renumber_pdb.py '+infile+' > '+outfile
print(command)
system(command)
command = '~rhiju/python/replace_chain_inplace.py '+outfile+' '+chain
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
infile = glob(indir+'/*aa*03_05.200_v1_3')[0]
outfile = outdir+'/'+prefix+'aa'+fivelettercode+'03_05.200_v1_3'
command = '/work/boinc/bin/reduce_fragment_library_size.pl '+infile+' > '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
infile = glob(indir+'/*aa*09_05.200_v1_3')[0]
outfile = outdir+'/'+prefix+'aa'+fivelettercode+'09_05.200_v1_3'
command = '/work/boinc/bin/reduce_fragment_library_size.pl '+infile+' > '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
infile = glob(indir+'/*aa*03_05.200_v1_3')[0]
outfile = outdir+'/boinc_'+prefix+'aa'+fivelettercode+'03_05.200_v1_3'
command = '/work/boinc/bin/reduce_fragment_library_size.pl '+infile+' > '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
infile = glob(indir+'/*aa*09_05.200_v1_3')[0]
outfile = outdir+'/boinc_'+prefix+'aa'+fivelettercode+'09_05.200_v1_3'
command = '/work/boinc/bin/reduce_fragment_library_size.pl '+infile+' 25 > '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
# Other secstruct files
infile = glob(indir+'/*.rdb')
if len(infile)>0:
infile = infile[0]
outfile = outdir+'/'+prefix+fivelettercode+'.rdb'
command = 'cp '+infile+' '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
# Other secstruct files
infile = glob(indir+'/*.prof_rdb')
if len(infile)>0:
infile = infile[0]
outfile = outdir+'/'+prefix+fivelettercode+'.prof_rdb'
command = 'cp '+infile+' '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)
# Other secstruct files
infile = glob(indir+'/*.jufo_ss')
if len(infile)>0:
infile = infile[0]
outfile = outdir+'/'+prefix+fivelettercode+'.jufo_ss'
command = 'cp '+infile+' '+outfile
print(command)
system(command)
command = 'gzip -f '+outfile
print(command)
system(command)