Skip to content

Commit 73d3e8d

Browse files
authored
Merge pull request #705 from haddocking/input_to_json
Input to json
2 parents b93fbe9 + 70967e8 commit 73d3e8d

File tree

18 files changed

+57
-29
lines changed

18 files changed

+57
-29
lines changed

src/haddock/modules/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,14 @@ def confirm_installation(self):
241241
"""
242242
return
243243

244-
def export_output_models(self, faulty_tolerance=0):
244+
def export_io_models(self, faulty_tolerance=0):
245245
"""
246-
Export output to the ModuleIO interface.
246+
Export input/output to the ModuleIO interface.
247247
248-
Modules that generate PDBs that other models should take as input,
249-
should export those PDBs registries through the ModuleIO interface.
248+
Modules that do not perform any operation on PDB files should have
249+
input = output.
250250
251-
This function implements a common interface for all modules requiring
252-
this feature.
251+
This function implements a common interface for all modules.
253252
254253
Parameters
255254
----------
@@ -260,6 +259,9 @@ def export_output_models(self, faulty_tolerance=0):
260259
"""
261260
assert self.output_models, "`self.output_models` cannot be empty."
262261
io = ModuleIO()
262+
# add the input models
263+
io.add(self.previous_io.output, "i")
264+
# add the output models
263265
io.add(self.output_models, "o")
264266
faulty = io.check_faulty()
265267
if faulty > faulty_tolerance:

src/haddock/modules/_template_cat/_template_mod/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def _run(self):
128128

129129
# final section
130130
self.output_models = list_of_created_models
131-
self.export_output_models()
131+
self.export_io_models()
132132
# in case your module considers possible tolerance for generated models,
133133
# you can use:
134-
# self.export_output_models(faulty_tolerance=self.params["tolerance"])
134+
# self.export_io_models(faulty_tolerance=self.params["tolerance"])
135135

136136

137137
# Finally, the haddock module's class inherit from BaseHaddockModule. It is

src/haddock/modules/analysis/caprieval/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ def _run(self):
9999
# Send models to the next step,
100100
# no operation is done on them
101101
self.output_models = models
102-
self.export_output_models()
102+
self.export_io_models()

src/haddock/modules/analysis/clustfcc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,4 @@ def _run(self):
247247
log.warning('No clusters were found')
248248
self.output_models = models_to_cluster
249249

250-
self.export_output_models()
250+
self.export_io_models()

src/haddock/modules/analysis/clustrmsd/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def _run(self):
211211
with open(output_fname, 'w') as out_fh:
212212
out_fh.write(output_str)
213213

214-
self.export_output_models()
214+
self.export_io_models()
215215
# sending matrix to next step of the workflow
216216
matrix_io = ModuleIO()
217217
matrix_io.add(self.matrix_json.input[0])

src/haddock/modules/analysis/rmsdmatrix/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _run(self):
160160

161161
# Sending models to the next step of the workflow
162162
self.output_models = models
163-
self.export_output_models()
163+
self.export_io_models()
164164
# Sending matrix path to the next step of the workflow
165165
matrix_io = ModuleIO()
166166
rmsd_matrix_file = RMSDFile(

src/haddock/modules/analysis/seletop/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ def _run(self):
5353

5454
# select the models based on the parameter
5555
self.output_models = models_to_select[:self.params['select']]
56-
self.export_output_models()
56+
self.export_io_models()

src/haddock/modules/analysis/seletopclusts/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ def _run(self):
9494
model.path = str(Path(self.path).resolve())
9595

9696
self.output_models = models_to_export
97-
self.export_output_models()
97+
self.export_io_models()

src/haddock/modules/refinement/emref/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ def _run(self):
125125
haddock_score = haddock_model.calc_haddock_score(**weights)
126126
pdb.score = haddock_score
127127

128-
self.export_output_models(faulty_tolerance=self.params["tolerance"])
128+
self.export_io_models(faulty_tolerance=self.params["tolerance"])

src/haddock/modules/refinement/flexref/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ def _run(self):
128128
pdb.score = haddock_score
129129

130130
# Save module information
131-
self.export_output_models(faulty_tolerance=self.params["tolerance"])
131+
self.export_io_models(faulty_tolerance=self.params["tolerance"])

0 commit comments

Comments
 (0)