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

Foxed gathering entities

parent 45ffa009
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment