Skip to content

Commit

Permalink
Reconciled fix for 5xv8, D_1300043061, and 2kxc
Browse files Browse the repository at this point in the history
  • Loading branch information
yokochi47 committed Jul 9, 2024
1 parent 6df0fe6 commit f60070e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions wwpdb/utils/nmr/NEFTranslator/NEFTranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1984,14 +1984,17 @@ def fill_ligand(idx, np):
ps = next(ps for ps in cif_ps if ps['auth_chain_id'] == ref_chain_id)
for ref_seq_id, mid_code, test_seq_id in zip(sa['ref_seq_id'], sa['mid_code'], sa['test_seq_id']):
if mid_code == '|' and test_seq_id is not None:
rev_seq_key = (test_chain_id, test_seq_id)
if rev_seq_key in rev_seq:
continue
try:
rev_seq[(test_chain_id, test_seq_id)] =\
rev_seq[rev_seq_key] =\
(ps['auth_chain_id'],
next(auth_seq_id for auth_seq_id, _seq_id
in zip(ps['auth_seq_id'], ps['seq_id'])
if _seq_id == ref_seq_id and isinstance(auth_seq_id, int)))
except StopIteration:
rev_seq[(test_chain_id, test_seq_id)] = (ps['auth_chain_id'], ref_seq_id)
rev_seq[rev_seq_key] = (ps['auth_chain_id'], ref_seq_id)
break
if test_chain_id is not None:
chain_id_col = loop.tags.index('Entity_assembly_ID')
Expand Down Expand Up @@ -2048,14 +2051,17 @@ def fill_ligand(idx, np):
ps = next(ps for ps in cif_ps if ps['auth_chain_id'] == ref_chain_id)
for ref_seq_id, mid_code, test_seq_id in zip(sa['ref_seq_id'], sa['mid_code'], sa['test_seq_id']):
if mid_code == '|' and test_seq_id is not None:
rev_seq_key = (test_chain_id, test_seq_id)
if rev_seq_key in rev_seq:
continue
try:
rev_seq[(test_chain_id, test_seq_id)] =\
rev_seq[rev_seq_key] =\
(ps['auth_chain_id'],
next(auth_seq_id for auth_seq_id, _seq_id
in zip(ps['auth_seq_id'], ps['seq_id'])
if _seq_id == ref_seq_id and isinstance(auth_seq_id, int)))
except StopIteration:
rev_seq[(test_chain_id, test_seq_id)] = (ps['auth_chain_id'], ref_seq_id)
rev_seq[rev_seq_key] = (ps['auth_chain_id'], ref_seq_id)
break
if test_chain_id is not None:
chain_id_col = loop.tags.index('Entity_assembly_ID')
Expand Down

0 comments on commit f60070e

Please sign in to comment.