-
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
Bio.PDB - deepcopy() causes RecursionError on Disordered Entity #787
Comments
Suggested workaround: Pass the filename and chain identifier to each child process instead, and re-parse the PDB file. Can you cut down your code to make a short self contained example script to help reproduce the problem? |
Hi Peter, That's a good suggestion, I will reconstruct the PDB object for each child process. This code should minimally reproduce the problem:
(Apologies, the file was 1zro, not 1zrl...) |
This has been referenced before in #302 . It seems to be a case only when disordered residues are present.. At the time this Python bug report was also linked to the thread. As Peter suggested, a simple workaround is to just re-parse the file in each subprocess. I'll have a look in the coming days, see if we can close this for good without a major code overhaul.. |
Just coming back to this issue with fresh eyes. The issue with This has been seen in another project as well - cloudtools/troposphere#648 The solution proposed there is a bit hacky, but it works. They are just raising an |
Squashed commit of pull request biopython#1075, closes biopython#787. Raise AttributeError when `__getattr__('__setstate__')` is called to fix `copy.deepcopy` recursing under Python 3.6
I'm currently using the Python
subprocess
module to perform parallel computations using a Bio.PDB chain object. When running this with some structures, a RecursionError is raised during this process, which is due to thesubprocess
module performing adeepcopy
operation on the Bio.PDB chain object.When simply trying to deepcopy, I get the following (with the first two lines repeated many times):
The particular pdb file I was working with at the time was
1zro.pdb
, although this isn't the only file that has this issue.Any suggestions as to a suitable workaround/fix?
Cheers,
Andrew
The text was updated successfully, but these errors were encountered: