diff --git a/convert_to_modelcif.py b/convert_to_modelcif.py index a20bea145d186b642f5099f60c1a2c6f4695e57c..3e7b9404c77b00abd16f41ef4e69933423a9ceca 100755 --- a/convert_to_modelcif.py +++ b/convert_to_modelcif.py @@ -289,8 +289,6 @@ def _store_as_modelcif( # the JSON data/ does the JSON data look different for each mode? # - are the scores only calculated by alpha-analysis.sif or do they # come out of run_multimer_jobs.py? Does this go into its own step? - # - could Jupyter notebooks be included as associated file or do they - # require the pickle files? # - what about including the tabular summary? # - model selection: only if just a certain model is translated to # ModelCIF, or mix it with scoring step? @@ -442,12 +440,8 @@ def _get_entities( structure = PDBParser().get_structure("_".join(cmplx_name), pdb_file) cif_json["target_entities"] = [] already_seen = [] - # ToDo: skip using chains to make it safe for models with ligands. Chains - # are only used for the chain ID. That can be obtained from the first - # residue in the sequence: seq[0].parent.id - for chn, seq in zip( - structure.get_chains(), PPBuilder().build_peptides(structure) - ): + for seq in PPBuilder().build_peptides(structure): + chn_id = seq[0].parent.id seq = seq.get_sequence() seq_md5 = hashlib.md5(seq.encode()).hexdigest() cif_ent = {} @@ -456,10 +450,10 @@ def _get_entities( except ValueError: pass else: - cif_json["target_entities"][e_idx]["pdb_chain_id"].append(chn.id) + cif_json["target_entities"][e_idx]["pdb_chain_id"].append(chn_id) continue cif_ent["pdb_sequence"] = seq - cif_ent["pdb_chain_id"] = [chn.id] + cif_ent["pdb_chain_id"] = [chn_id] cif_ent["description"] = sequences[seq_md5] cif_json["target_entities"].append(cif_ent) already_seen.append(sequences[seq_md5]) @@ -710,5 +704,9 @@ if __name__ == "__main__": # ToDo: where to store which model was chosen? Should be in Tara's models. # ToDo: make sure all functions come with types +# From former discussions: +# - including Jupyter notebooks would require adding the pickle files to the +# associated files (too much storage needed for that) + # LocalWords: ToDo AlphaPulldown PAEs dir struct coevolution MSA py modeling # LocalWords: multimer sif Jupyter aa MSAs