Skip to content

Commit 12bb6a9

Browse files
committed
Fixing the numeration of PDB's chains where all frames are contained in a PDB for a given protein.
1 parent 95ee744 commit 12bb6a9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

MHCXGraph/classes/graph.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,9 @@ def _find_residue_by_label(self, model, label: str):
355355
return res
356356
candidates.append(res)
357357

358-
# Fallback: bate só por número (se não achou com nome)
359358
for res in candidates:
360359
return res
361360

362-
# Último fallback: qualquer resíduo com mesmo número na cadeia
363361
for res in chain.get_residues():
364362
hetflag, seq, ic = res.id
365363
if seq == resnum:
@@ -408,12 +406,12 @@ def create_pdb_per_protein(self):
408406
parser = PDBParser(QUIET=True)
409407
orig_struct = parser.get_structure('orig', pdb_file)
410408

411-
chain_counter = 1
412409
new_struct = Structure.Structure('frames')
413410
model = Model.Model(0)
414411
new_struct.add(model)
415412

416413
for comp_id, comps in enumerate(self.associated_graphs):
414+
chain_counter = 1
417415
for frame_id, frame_graph in enumerate(comps[0]):
418416
nodes = set(node[i] for node in frame_graph.nodes)
419417

0 commit comments

Comments
 (0)