-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Bug identified at PDBIO.set_structure() and solution for it #2995
Labels
Comments
Hi @alexandrefassio thanks for catching this. Would you be willing to submit a pull request on this? |
Sure! I can do it. |
3 tasks
JoaoRodrigues
added a commit
to JoaoRodrigues/biopython
that referenced
this issue
Jun 26, 2020
JoaoRodrigues
added a commit
to JoaoRodrigues/biopython
that referenced
this issue
Jun 26, 2020
Merged
3 tasks
JoaoRodrigues
added a commit
that referenced
this issue
Aug 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
In the current BioPython version, there are two bugs (lines 86 and 95) in the function set_structure() from the class PDBIO (Bio/PDB/PDBIO.py):
As you can see, it always tries to access a chain object whose id is "A". However, if one tries to save a Residue/Atom whose chain id is not "A", it raises a KeyError exception because the recently created chain (line 79) had its id updated to pdb_object.parent.id at line 83 (when pdb_object is a residue) or 92 (when pdb_object is an atom).
Thus, to fix this problem, move the parent_id to outside the try/except block and substitute the previous lines by
bests
The text was updated successfully, but these errors were encountered: