diff --git a/translate2modelcif.py b/translate2modelcif.py index 3d87f9034a09bdab8fd0581cbc3652fe91183526..4deb91eb24aefa5390f73bb7a2fc192e308eb5d8 100644 --- a/translate2modelcif.py +++ b/translate2modelcif.py @@ -66,7 +66,6 @@ def _parse_args(): help="Compress ModelCIF file with gzip " "(note that QA file is zipped either way).", ) - opts = parser.parse_args() # check that model dir exists @@ -209,7 +208,6 @@ class _OST2ModelCIF(modelcif.model.AbInitioModel): + "associated data.", details="Predicted aligned error", ) - return modelcif.associated.Repository( "", [modelcif.associated.ZipFile(f"{mdl_name}.zip", files=[qa_file])], @@ -235,7 +233,6 @@ def _check_interaction_extra_files_present(model_dir): """Make sure some general files are present for an interaction.""" cnfg = os.path.join(model_dir, "config.json") _check_file(cnfg) - return cnfg @@ -243,10 +240,8 @@ def _check_model_extra_files_present(model_dir, pdb_file): """Check that all files needed to process this model are present.""" uid = os.path.splitext(pdb_file)[0] prfx = os.path.join(model_dir, uid) - scrs = f"{prfx}_scores.json" _check_file(scrs) - return prfx, uid @@ -379,7 +374,6 @@ def _parse_colabfold_config(cnfg_file): + "the model with best congruence with crosslinks reported in the " + "related study." ) - return { "config": cf_config, "seq_dbs": seq_dbs, @@ -395,7 +389,6 @@ def _parse_colabfold_config(cnfg_file): def _get_protocol_steps_and_software(config_data): """Create the list of protocol steps with software and parameters used.""" protocol = [] - # modelling step step = { "method_type": "modeling", @@ -509,7 +502,6 @@ def _get_protocol_steps_and_software(config_data): step["software"] = [] step["software_parameters"] = {} protocol.append(step) - return protocol @@ -530,7 +522,6 @@ def _get_model_details(gene_names): def _get_model_group_name(): """Get a name for a model group.""" - return "Crosslinked Heterodimer AlphaFold-Multimer v2 Models" @@ -550,7 +541,6 @@ def _get_sequence(chn): sqe += "-" lst_rn += 1 sqe += res.one_letter_code - return sqe @@ -648,7 +638,6 @@ def _fetch_upkb_entry(up_ac): _abort_msg(f"No NCBI taxonomy ID found for UniProtKB entry '{up_ac}'.") if len(data["up_organism"]) == 0: _abort_msg(f"No organism species found for UniProtKB entry '{up_ac}'.") - return data @@ -660,7 +649,6 @@ def _get_upkb_for_sequence(sqe, up_ac): f"Sequences not equal from file: {sqe}, from UniProtKB: " + f"{up_data['up_sequence']}" ) - return up_data @@ -680,7 +668,6 @@ def _get_entities(pdb_file, up_acs): ) cif_ent.update(upkb) entities.append(cif_ent) - return entities, ost_ent @@ -776,7 +763,6 @@ def _get_modelcif_protocol_software(js_step): elements=(sftwre,), parameters=params ) return sftwre - return None @@ -789,7 +775,6 @@ def _get_modelcif_protocol_input(js_step, target_entities, ref_dbs, model): input_data = model else: raise RuntimeError(f"Unknown protocol input: '{js_step['input']}'") - return input_data @@ -799,7 +784,6 @@ def _get_modelcif_protocol_output(js_step, model): output_data = model else: raise RuntimeError(f"Unknown protocol output: '{js_step['output']}'") - return output_data @@ -823,7 +807,6 @@ def _get_modelcif_protocol(protocol_steps, target_entities, model, ref_dbs): ) ) protocol.steps[-1].method_type = js_step["method_type"] - return protocol @@ -929,17 +912,14 @@ def _create_interaction_json(config_data): """Create a dictionary (mimicking JSON) that contains data which is the same for all models.""" data = {} - data["audit_authors"] = _get_audit_authors() data["protocol"] = _get_protocol_steps_and_software(config_data) data["config_data"] = config_data - return data def _create_model_json(data, pdb_file, up_acs, block_id): """Create a dictionary (mimicking JSON) that contains all the data.""" - data["target_entities"], ost_ent = _get_entities(pdb_file, up_acs) gns = [] for i in data["target_entities"]: @@ -948,7 +928,6 @@ def _create_model_json(data, pdb_file, up_acs, block_id): data["data_block_id"] = block_id data["model_details"] = _get_model_details(gns) data["model_group_name"] = _get_model_group_name() - return ost_ent @@ -1010,15 +989,3 @@ def _main(): if __name__ == "__main__": _main() - -# LocalWords: Xabi argparse args ArgumentParser formatter dir str metavar os -# LocalWords: RawDescriptionHelpFormatter ACs sys msg nAborting stderr acs -# LocalWords: fle cnfg config json pdb prfx scrs endswith modelcif uid pdbx -# LocalWords: struct cif utf mmcif fh datetime ost io ToDo chn lst rn idx aa -# LocalWords: sqe olc ACDEFGHIKLMNPQRSTVWY RuntimeError upkb txt pylint iter -# LocalWords: rspns unicode startswith sline len elif NCBI TaxID ncbi taxid -# LocalWords: seqlen crc ISOFORM DT dt flds isoforms isoform ent LoadPDB ihm -# LocalWords: mdlcf mdlcif asym AsymUnit init kwargs atm pos het hetatom pTM -# LocalWords: biso ujson GlobalPTM pLDDT ptm jfh numpy np GlobalPLDDT lDDT -# LocalWords: plddt LocalPLDDT timeit PAE MetricType LocalPairwisePAE lpae -# LocalWords: nd pae qa pstart ColabFold