-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipes.py
157 lines (124 loc) · 7.97 KB
/
recipes.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
##########################################################################
# Homology #
##########################################################################
class Homology(object):
def __init__(self, **kwargs):
self.steps = ["clean_fasta", "set_stage_init", "alphafold", "set_stage_init2", "set_end"]
self.recipe = \
{"clean_fasta": {"command": "clean_fasta", # 1
"options": {"seq": ""}},
"set_stage_init": {"command": "set_stage_init", # 2
"options": {"src_dir": "",
"src_files": "",
"tgt_dir": "sequences"}},
"alphafold": {"alphafold": "alphafold", # 3
"options": {"seq": "",
"max_template_date": "2021-11-01"}},
"set_stage_init2": {"command": "set_stage_init", # 4
"options": {"src_dir": "",
"src_files": ["ranked_0.pdb"],
"tgt_dir": "."}},
"set_end": {"command": "set_stage_init", # 5
"options": {"src_dir": "",
"src_files": ["ranked_0.pdb"],
"tgt_dir": "finalOutput"}}}
self.breaks = \
{"clean_fasta": {"seq": "sequence"},
"set_stage_init": {"src_files": "sequence"},
"alphafold": {"seq": "sequence"},
"set_stage_init2": {"src_dir": "sequence_base"}}
##########################################################################
# ModPrep #
##########################################################################
class ModPrep(object):
def __init__(self, **kwargs):
self.steps = ["clean_fasta", "plot_conf", "make_pir", "run_modeller", "set_end"]
self.recipe = \
{"clean_fasta": {"command": "clean_fasta", # 1
"options": {"seq": ""}},
"plot_conf": {"command": "plot_conf", # 2
"options": {"pdb": "",
"tgt": "plot_confidence.txt"}},
"make_pir": {"command": "make_pir", # 3
"options": {"seq": "",
"pdb": "",
"tgt1": "alignment.pir",
"tgt2": "refinement.txt",
"tgt3": "alignment.txt"}},
"run_modeller": {"command": "run_modeller", # 4
"options": {"alnfile": "alignment.pir",
"knowns": "",
"mode": ""}},
"set_end": {"command": "set_stage_init", # 5
"options": {"src_dir": "",
"src_files": ["plot_confidence.txt",
"alignment.txt",
"refinement.txt",
"refined.B99990001.pdb"],
"tgt_dir": "finalOutput"}}}
self.breaks = \
{"clean_fasta": {"seq": "sequence"},
"plot_conf": {"pdb": "pdb_2"},
"make_pir": {"seq": "sequence",
"pdb": "pdb_2"},
"run_modeller": {"knowns": "pdb_2",
"mode": "mode"}}
##########################################################################
# Orientation #
##########################################################################
class Orientation(object):
def __init__(self, **kwargs):
self.steps = ["set_stage_init", "get_protein", "make_inp", "ppm", "clean_pdb",
"superimpose", "set_end1", "set_end2"]
self.recipe = \
{"set_stage_init": {"command": "set_stage_init", # 1
"options": {"repo_files": ["res.lib"],
"tgt_dir": "."}},
"get_protein": {"command": "get_protein", # 2
"options": {"pdb": "",
"pdb_backup": "",
"tgt": "protein_stripped.pdb"}},
"make_inp": {"command": "make_inp", # 3
"options": {"pdb": "protein_stripped.pdb",
"tgt": "2membranes.inp"}},
"ppm": {"ppm": "ppm", # 4
"options": {"inp": "2membranes.inp"}},
"clean_pdb": {"command": "clean_pdb", # 5
"options": {"src": "protein_strippedout.pdb",
"tgt": "protein_aligned.pdb"}},
"superimpose": {"command": "superimpose", # 6
"options": {"pdb": "",
"pdb_backup": "",
"src": "protein_aligned.pdb",
"tgt": "homology.pdb"}},
"set_end1": {"command": "set_stage_init", # 7
"options": {"src_dir": "",
"src_files": "",
"tgt_dir": "finalOutput"}},
"set_end2": {"command": "set_stage_init", # 8
"options": {"src_dir": "",
"src_files": ["protein_stripped.pdb",
"protein_aligned.pdb",
"homology.pdb"],
"tgt_dir": "finalOutput"}}}
self.breaks = \
{"get_protein": {"pdb": "pdb_3",
"pdb_backup": "pdb_2"},
"superimpose": {"pdb": "pdb_3",
"pdb_backup": "pdb_2"},
"set_end1": {"src_files": "pdb_3"}}
##########################################################################
# Collect All Results & Output #
##########################################################################
class CollectResults(object):
def __init__(self, **kwargs):
self.steps = ["set_end", "tar_out"]
self.recipe = \
{"set_end": {"command": "set_stage_init", # 1
"options": {"src_dir": "",
"src_files": ["pymodsim.log"],
"tgt_dir": "finalOutput"}},
"tar_out": {"command": "tar_out", # 2
"options": {"src_dir": "finalOutput",
"tgt": "Model_output.tgz"}}}
self.breaks = {}