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

float division by zero exception raised if using prody_align with mmCIF files #1905

Open
nbruciaferri opened this issue Jun 26, 2024 · 1 comment

Comments

@nbruciaferri
Copy link

Hi,

I'm trying to use the prody_align function to align two selections and if I use mmCIF files as input the calcRMSD function would return a float divison by zero exception while if I use the pdb files everything works perfectly.

Code snippet to replicate the bug:

import prody
from prody.apps.prody_apps.prody_align import prody_align

# mmCIF files
prody.fetchPDB("2reg", format="cif", compressed=False)
prody.fetchPDB("2rin", format="cif", compressed=False)

# PDB files
prody.fetchPDB("2reg", compressed=False)
prody.fetchPDB("2rin", compressed=False)

selection_string = 'ca sequence "W.*D.*W.*M.*Y.*I.*ND.*E.*W.*H"'
# Works fine
prody_align("2reg.pdb", "2rin.pdb", select=selection_string, model=1, sequid=90, overlap=90, prefix='aligned_')

# float division by zero
prody_align("2reg.cif", "2rin.cif", select=selection_string, model=1, sequid=90, overlap=90, prefix='aligned_')

Please let me know if I'm doing something wrong or if this is effectively a bug and in such case if you plan to fix it.

Thank you for your effort in providing such a broad package!

@jamesmkrieger
Copy link
Contributor

I’d imagine that the problem is that the chains are different in the cif file with the default way of parsing it.

We have an option unite_chains in parsePDB and parseMMCIF that can change the default behaviour if you set it to true. You can then use alignChains on the resulting AtomGroup objects instead of prody_align and everything should hopefully work.

We should also modify prody_align to accept the unite_chains option to pass on to parsePDB and parseMMCIF.

Thanks for letting us know

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

No branches or pull requests

2 participants