Skip to content

Commit

Permalink
DAOTHER-8905: V5.30 Release, Prevent infinite loop while parsing XEAS…
Browse files Browse the repository at this point in the history
…Y PROT file
  • Loading branch information
yokochi47 committed Feb 4, 2025
1 parent d25bc41 commit 132a490
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wwpdb/utils/nmr/mr/AmberPTParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@ def update_atom_num(seq_align, orphan):
if atomNum['atom_id'] not in chemCompAtomIds or atomNum['atom_id'] in leavingAtomIds:
delete_atom_nums.append(atom_num)

trial = 0

while True:

orphanPolySeqPrmTop = []
Expand Down Expand Up @@ -961,6 +963,11 @@ def update_atom_num(seq_align, orphan):
if not resolved:
break

trial += 1

if trial > 10:
break

for ps in self.__polySeqPrmTop:
test_chain_id = ps['chain_id']

Expand Down
7 changes: 7 additions & 0 deletions wwpdb/utils/nmr/mr/CharmmCRDParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ def update_atom_num(seq_align, orphan):
if atomNum['atom_id'] not in chemCompAtomIds or atomNum['atom_id'] in leavingAtomIds:
delete_atom_nums.append(atom_num)

trial = 0

while True:

orphanPolySeqPrmTop = []
Expand Down Expand Up @@ -681,6 +683,11 @@ def update_atom_num(seq_align, orphan):
if not resolved:
break

trial += 1

if trial > 10:
break

for ps in self.__polySeqPrmTop:
test_chain_id = ps['chain_id']

Expand Down
7 changes: 7 additions & 0 deletions wwpdb/utils/nmr/mr/GromacsPTParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@ def update_atom_num(seq_align, orphan):
if atomNum['atom_id'] not in chemCompAtomIds or atomNum['atom_id'] in leavingAtomIds:
delete_atom_nums.append(atom_num)

trial = 0

while True:

orphanPolySeqPrmTop = []
Expand Down Expand Up @@ -897,6 +899,11 @@ def update_atom_num(seq_align, orphan):
if not resolved:
break

trial += 1

if trial > 10:
break

for ps in self.__polySeqPrmTop:
test_chain_id = ps['chain_id']

Expand Down
7 changes: 7 additions & 0 deletions wwpdb/utils/nmr/pk/XeasyPROTParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,8 @@ def update_atom_num(seq_align, orphan):
if atomNum['atom_id'] not in chemCompAtomIds or atomNum['atom_id'] in leavingAtomIds:
delete_atom_nums.append(atom_num)

trial = 0

while True:

orphanPolySeqPrmTop = []
Expand Down Expand Up @@ -700,6 +702,11 @@ def update_atom_num(seq_align, orphan):
if not resolved:
break

trial += 1

if trial > 10:
break

for ps in self.__polySeqPrmTop:
test_chain_id = ps['chain_id']

Expand Down

0 comments on commit 132a490

Please sign in to comment.