Skip to content
Snippets Groups Projects
Commit a28ca7de authored by Bienchen's avatar Bienchen
Browse files

Get first protocol step

parent 9827ae0e
No related branches found
No related tags found
No related merge requests found
......@@ -246,17 +246,36 @@ def _get_modelcif_protocol_input(
return input_data
def _get_modelcif_protocol_output(output_data_group, model):
"""Assemble output data for a ModelCIF protocol step."""
if output_data_group == "model":
output_data = model
elif output_data_group == "monomer_pickle_files":
output_data = modelcif.data.DataGroup(
[
modelcif.data.Data(
"Pickle files", details="Monomer feature/ MSA pickle files"
)
]
)
else:
raise RuntimeError(f"Unknown protocol output: '{output_data_group}'")
return output_data
def _get_modelcif_protocol(
protocol_steps, target_entities, model, sw_dict, ref_dbs
):
"""Create the protocol for the ModelCIF file."""
protocol = modelcif.protocol.Protocol()
for js_step in protocol_steps:
# assemble input data
# assemble input & output data
input_data = _get_modelcif_protocol_input(
js_step["input_data_group"], target_entities, ref_dbs, model
)
output_data = _get_modelcif_protocol_output(
js_step["output_data_group"], model
)
# loop over software group and assemble software group from that
sw_grp = modelcif.SoftwareGroup()
for pss in js_step["software_group"]: # protocol step software
......@@ -277,7 +296,7 @@ def _get_modelcif_protocol(
protocol.steps.append(
modelcif.protocol.Step(
input_data=input_data,
output_data=None, # output_data,
output_data=output_data,
name=js_step["step_name"],
details=js_step["details"],
software=sw_grp,
......@@ -285,7 +304,7 @@ def _get_modelcif_protocol(
)
print("modelcif.protocol.Step(")
print(f" input_data={input_data},")
# output_data=output_data,
print(f" output_data={output_data},")
print(f" name={js_step['step_name']},")
print(f" details=\"{js_step['details']}\",")
print(f" software={sw_grp},")
......@@ -697,7 +716,15 @@ def _get_software_data(meta_json: dict) -> list:
None,
cite_hhsuite,
),
"hmmbuild": None,
"hmmbuild": modelcif.Software(
"hmmbuild",
"data collection",
"Building HMM search profiles",
"http://hmmer.org/",
"program",
None,
None,
),
"hmmsearch": None,
"jackhmmer": None,
"kalign": None,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment