Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlphaFold uses the wrong resolution field during structure parsing #915

Closed
ljarosch opened this issue Mar 21, 2024 · 2 comments
Closed

AlphaFold uses the wrong resolution field during structure parsing #915

ljarosch opened this issue Mar 21, 2024 · 2 comments

Comments

@ljarosch
Copy link

AlphaFold uses these lines for parsing the resolution of structures:

for res_key in ('_refine.ls_d_res_high', '_em_3d_reconstruction.resolution',
                '_reflns.d_resolution_high'):
  if res_key in parsed_info:
    try:
      raw_resolution = parsed_info[res_key][0]
      header['resolution'] = float(raw_resolution)
    except ValueError:
      logging.debug('Invalid resolution format: %s', parsed_info[res_key])

return header

This means that effectively _reflns.d_resolution_high will be used to set resolution whenever it is available, however this reflects the resolution limit in the raw data and not the final PDB model (see https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_reflns.d_resolution_high.html), effectively overestimating the resolution for many structures. Instead, _refine.ls_d_res_high should be used (https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_refine.ls_d_res_high.html).

It's likely that this was the intended behavior but the loop is missing a break statement in the try-block.

ljarosch added a commit to ljarosch/alphafold that referenced this issue Mar 21, 2024
Without the break statement this will fall back to setting the resolution to _reflns.d_resolution_high for most structures, which reflects the resolution limit in the raw data and not the final structure (see https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_reflns.d_resolution_high.html and https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Items/_refine.ls_d_res_high.html). Fixes google-deepmind#915
@Augustin-Zidek
Copy link
Collaborator

Thanks for reporting, this is indeed a bug and I will send a fix.

Htomlinson14 pushed a commit that referenced this issue Apr 12, 2024
Thanks to @ljarosch for reporting and suggesting a fix in #915.

PiperOrigin-RevId: 617817805
Change-Id: I46738b248a054d06fe902626cff161fe521e99f1
@Augustin-Zidek
Copy link
Collaborator

Fixed in 6d95d19. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants