-
Notifications
You must be signed in to change notification settings - Fork 667
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
Erratic .convert_to("RDKIT") behaviour #3235
Comments
Update: Splitting the code in the following way seems to have resolved the problem:
I remain unsure about the origin of the bug. Bests, Harold |
Hi Harold, I believe the bug you're experiencing is related to #2958 and is likely due to how the RDKitConverter caching system currently works. Basically, to avoid rebuilding the whole RDKit molecule from scratch while you iterate over timesteps in a trajectory, the converter has a caching system that will check if the The whole caching system has been reworked in #2942 (it will take into account the id of the Universe instead of the atomgroup, as well as the indices of selected atoms) so hopefully you won't see this error once this PR is merged.
Your solution (saving the atomgroup in a variable before converting it) also works as it will prevent the atomgroup (created from a selection) to be deleted/garbage-collected and so its Hope that answers your interrogations! |
Hi Cedric, Many thanks for your response! I'll try that right away. Also, what would be the impact of your solution on the speed of the code? Bests, Harold |
In the context of iterating over timesteps in a trajectory and doing the 3 conversions inside the loop, the impact will be pretty large (and increase with the size and complexity of the system) as you're rebuilding the whole RDKit molecule (and inferring bond orders/charges) every frame. |
Ok - great. Thanks for the help! |
Hello,
I have to experience a rather odd behaviour from .convert_to("RDKIT") and I can't really make sense of it. Hopefully, someone will be able to help me here. I am trying to convert groups to rdkit objects which is done successfully most of the time. On some occasions, the following error appears:
Annoyingly, the error appears not to be reproducible as different atom groups induce the error on different runs and/or iteration. For example, the code worked on the attached PDB (example.pdb) in the two first iterations but not on the third. When I repeat the code different atom groups can lead to failure while the one that precedently bugged is correctly processed.
PDB: example.pdb.txt
Any help resolving this issue would be greatly appreciated. Maybe @cbouy would be able to help?
Many thanks in advance for your help.
Expected behavior
Actual behavior
Code to reproduce the behavior
As explained above, the error seems unreproducible.
Current version of MDAnalysis
python -c "import MDAnalysis as mda; print(mda.__version__)"
): 2.0.0-dev0python -V
)? Python 3.7.9The text was updated successfully, but these errors were encountered: