From 9827ae0e5b171212d7c143550a2d09482a974c1b Mon Sep 17 00:00:00 2001 From: Stefan Bienert <stefan.bienert@unibas.ch> Date: Wed, 4 Oct 2023 14:31:53 +0200 Subject: [PATCH] Get software from file --- convert_to_modelcif.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/convert_to_modelcif.py b/convert_to_modelcif.py index 97a3f0e..3a01fc9 100755 --- a/convert_to_modelcif.py +++ b/convert_to_modelcif.py @@ -318,10 +318,9 @@ def _get_modelcif_ref_dbs(meta_json): db_name = db_name.lower() # if DB already exists, check URL and version if db_name in sdb_dct: - print("ALREADY THERE", sdb_dct[db_name]) # ToDo: switch URL to the actual URL read from JSON if ( - sdb_dct[db_name].version == vdct["version"] + sdb_dct[db_name].version != vdct["version"] or sdb_dct[db_name].url != db_info[db_name]["url"] ): raise RuntimeError( @@ -376,6 +375,7 @@ def _store_as_modelcif( ) # create software list from feature metadata + # ToDo: store_as_modelcif should not use __meta__ sw_dct = _get_software_data(data_json["__meta__"]) # process scores @@ -730,25 +730,20 @@ def _get_protocol_steps(modelcif_json): """Create the list of protocol steps with software and parameters used.""" protocol = [] # MSA/ monomer feature generation step - # ToDo: get software from modelcif_json step = { "method_type": "coevolution MSA", "step_name": "MSA generation", "details": "Create sequence features for corresponding monomers.", "input_data_group": "target_sequences", "output_data_group": "monomer_pickle_files", - "software_group": [ - "AlphaPulldown", - "AlphaFold", - "jackhmmer", - "hhblits", - "hhsearch", - "hmmsearch", - "hmmbuild", - "kalign", - ] + "software_group": [] # _ma_protocol_step.protocol_id } + for sftwr in modelcif_json["__meta__"].values(): + sftwr = sftwr["software"] + for tool in sftwr: + if tool not in step["software_group"]: + step["software_group"].append(tool) protocol.append(step) # modelling step -- GitLab