Skip to content

Commit

Permalink
fix: template try-except bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoYinYing committed Aug 19, 2024
1 parent dce79f8 commit 6968f69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def make_ccd_conf_features(all_chain_info, ccd_preprocessed_dict,
converted_atom_id_name=convert_atom_id_name(atom_id.upper())
if max(converted_atom_id_name)>= 64:
raise ValueError(f'>>> Problematic atom in ligand ({residue_id=}, {ccd_id=}, {chain_id=}) {atom_id=}, {converted_atom_id_name=}')
logging.debug(f'({residue_id=}, {ccd_id=}, {chain_id=}) {atom_id=}, {converted_atom_id_name=}')
# logging.debug(f'({residue_id=}, {ccd_id=}, {chain_id=}) {atom_id=}, {converted_atom_id_name=}')

features['ref_atom_name_chars'].append(
np.array([convert_atom_id_name(atom_id.upper()) for atom_id in _ccd_feats['atom_ids']]
Expand Down
12 changes: 4 additions & 8 deletions apps/protein_folding/helixfold3/helixfold/data/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,19 +817,15 @@ def _process_single_hit(
TemplateAtomMaskAllZerosError) as e:
# These 3 errors indicate missing mmCIF experimental data rather than a
# problem with the template search, so turn them into warnings.
warning = ('%s_%s (sum_probs: %.2f, rank: %d): feature extracting errors: '
'%s, mmCIF parsing errors: %s'
% (hit_pdb_code, hit_chain_id, hit.sum_probs, hit.index,
str(e), parsing_result.errors))
warning = (f'{hit_pdb_code}_{hit_chain_id} (sum_probs: {hit.sum_probs}, rank: {hit.index}): feature extracting errors: '
f'{str(e)}, mmCIF parsing errors: {parsing_result.errors}')
if strict_error_check:
return SingleHitResult(features=None, error=warning, warning=None)
else:
return SingleHitResult(features=None, error=None, warning=warning)
except Error as e:
error = ('%s_%s (sum_probs: %.2f, rank: %d): feature extracting errors: '
'%s, mmCIF parsing errors: %s'
% (hit_pdb_code, hit_chain_id, hit.sum_probs, hit.index,
str(e), parsing_result.errors))
error = (f'{hit_pdb_code}_{hit_chain_id} (sum_probs: {hit.sum_probs}, rank: {hit.index}): feature extracting errors: '
f'{str(e)}, mmCIF parsing errors: {parsing_result.errors}')
return SingleHitResult(features=None, error=error, warning=None)


Expand Down

0 comments on commit 6968f69

Please sign in to comment.