Middle East Technical University
Question
Asked 20 December 2022
Swig/python BHtree memory leak in autodock 4: how can I solve it?
Hi, guys. I started doing some dockings a few days ago and there was an constantly error showing up on the autodocktools cmd:
"swig/python detected a memory leak of type 'BHtree *', no destructor found." (PFA a printscreen of the error).
The error kept showing up after every command i gave. For example, after every missing atom added it showed up again. I didn't mind at first, because everything was working just fine, even though I was wondering if my results would be realiable with such an error.
But now, there is another error showing up on the autodock (You can also find a printscreen attached), and i can't dock anything anymore. I have already tried reinstalling autodock and MGLtools.
Has anyone had this same errors? Would you know how can I solve it? Just making clear that I'm not familiar with programming.
Thank you so much!


Most recent answer
I agree, the memory leak warning does not make a difference. The docking works fine.
All Answers (14)

Autodock4 makes use of python programming language to run their commands and thus any error you encounter comes from the script. Sometimes during atom fixing, the python script pops up due to the size of your protein (especially when amino acids are greater than 200). This is one of the limitations of using autodock4 for fixing atoms.
In the second case, there's a memory leak in your version of python your computer system uses and this might not be compatible with Autodock4 python's script. To learn more about python memory leak and how to solve this, see the attached link
Fluminense Federal University
Hi,
Abdeen Tunde
. Thank you for you answer! I'm going to read the article you send and try to solve the problem. About the limitations of using autodock for fixing atoms, would you suggest any other software for this task?

Yes, I have used schrodinger software (maestro; protein preparationwizard module) to overcome this limitation. But it's unfortunate that the free license of maestro cannot do this for you. You'll have to pay for the software to have access to the full functionality.
But you can try this little trick using autodock4
1) load your cleaned protein (after removing all water molecules and heteroatoms)
2) go to edit 》 misc 》 check for missing atoms (this would tell you if the protein structure has missing atoms or not. If it does, proceed to number 3)
3) go to edit 》 hydrogen 》 add hydrogen 》 add pollar hydrogen only.
4) go to edit 》 misc 》 check for missing atoms.
If you follow the process duly, you shouldn't see any missing atoms in the panel again.
This process is right because all X-ray crystallography structures lack polar hydrogen atoms and this is one of the major reasons protein structures have missing atoms.
1 Recommendation
Fluminense Federal University
Abdeen Tunde
, I was checking for missing atoms before adding the polar hydrogens, i'm going to try do it after then. Hopefully it will work! Thank you!Fluminense Federal University
Hi, Ly Duyen
I've looked exhaustively over the internet about this problem, but never found anything that could solve it. Looks like memory leaks are commom in python. What I did was run the dockings I wanted in another computer that did not show that error and the results were the same. So, I presumed the error was not having an impact on the reliability of my results.
I'm also using windows, as well as everyone that messaged me about the same problem. I guess this is a windows-related problem.
Pham Ngoc Thach University of Medicine
Thank you very much professor! Julio Thurler
Hmm... I think I'll try working on a Macbook to see if there's a better result.
I've searched all over the web but no one has been able to answer this problem yet.
I'm doing this research for my graduation thesis, so I'm still worried about overcoming this problem to get the expected results.
Middle East Technical University
Hello Everyone,
I am having the same memory problem. Interestingly, I was able to use the program one and a half months ago without any errors, now the program throws me the very same memory problem. I installed an older version of Anaconda and Python (2019 release, Python 2.7) and I re-installed MGLTools and tried once more. Thrown me the same error. I upgraded Vina to the current version and re-installed the Python script I'm having problem with manually. It is prepare_ligand4.py. I have no idea why it is happening. I am running the programs on Windows 10. All the help is very much appreciated. Thank you so much beforehand.
Middle East Technical University
Hello Again,
After doing all of those above, interestingly, the program has provided good enough .pdbqt output for Vina. Vina worked well with the new .pdbqt. Just wanted to note that. By the way, I use MGLTools1.5.7. Hope everyone's problems were sorted out.
University of Environment & Sustainable Development
Hi guys, I am also having the same problem with the appearance of that error. I would like to know if it affects the final results. In my case, I am using Windows 11, and i have reinstalled all current versions of all the required tools, but it keeps giving me the same error: ''swig/python detected a memory leak of type 'BHtree *', no destructor found''.
As a result, the final command stage of Autodock vina always runs into errors, and i fail to obtain the needed docking structures of my protein-ligand interactions
Fluminense Federal University
Aboagye Kwarteng Dofuor This looks like a commom problem of people using Autodock on windows. I've tried running the same docking, with the same experimental conditions on other computer and it gave me the same results. So I assumed the error was not making a difference in the docking run.
Similar questions and discussions
How to add Cobalt atomic parameter in autodock 4.2
Kulandaisamy Arulsamy
Hi,
I have tried to cobalt(Co) mixed complex of ligand docked with my receptor by using autodock. i am getting following error:
" autogrid4.exe: ERROR: unknown ligand atom type Co"
add parameters for it to the parameter library first! "
Then, i find out the Co atomic parameter values from http://mgldev.scripps.edu/pipermail/autodock/2009-March/005439.html.
Now i trying to add the Co parameter values to "AD4_parameters.dat" file but unfortunately i can't add.
thank you
How to avoid this Autodock Error?
Sihui Ma
I was trying docking some ligands to receptor iNOS(inducible Nitric Oxide Synthase, PDB ID 2ORO). When running autogrid, my python shell erred.(Windows)
>>> ERROR *********************************************
Traceback (most recent call last):
File "C:\Program Files (x86)\MGLTools-1.5.6\lib\site-packages\ViewerFramework\VF.py", line 898, in tryto
result = command( *args, **kw )
File "C:\Program Files (x86)\MGLTools-1.5.6\lib\site-packages\AutoDockTools\autostartCommands.py", line 964, in doit
ps = subprocess.Popen(args)
File "C:\Program Files (x86)\MGLTools-1.5.6\lib\subprocess.py", line 594, in __init__
errread, errwrite)
File "C:\Program Files (x86)\MGLTools-1.5.6\lib\subprocess.py", line 816, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
I tried reinstalling autodock4.2&mgltools1.5.6, rebuilding PDBQT files, change another iNOS PDB, but non of them worked.
Can anybody help me with this? Thanks a lot.
MGLTools 1.5.7 (AutodockTools) on Windows 10 throwing a python stack trace. Why?
Anthony Nash
First, I've had MGLTools on Windows 10 working fine up until today. Unfortunately, it was about 4 months ago since I last opened it and I forgot the *hack* that was required.
Here is the problem. I've installed AutodockTools (MGLTools - or which order it comes in) and despite it working once before I can't get it to open. This is the error:
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> Traceback (most recent call last):
File "C:\Program Files (x86)\MGLTools-1.5.7\lib\site-packages\AutoDockTools\__init__.py", line 433, in runADT
title=title, withShell= not interactive, verbose=False, gui=gui)
File "C:\Program Files (x86)\MGLTools-1.5.7\lib\site-packages\Pmv\moleculeViewer.py", line 1026, in __init__
trapExceptions=trapExceptions)
File "C:\Program Files (x86)\MGLTools-1.5.7\lib\site-packages\ViewerFramework\VF.py", line 523, in __init__
self.userpref.loadSettings()
File "C:\Program Files (x86)\MGLTools-1.5.7\lib\site-packages\mglutil\preferences.py", line 138, in loadSettings
self.set(key, value)
File "C:\Program Files (x86)\MGLTools-1.5.7\lib\site-packages\mglutil\preferences.py", line 107, in set
cb(name,oldValue, value)
File "C:\Program Files (x86)\MGLTools-1.5.7\lib\site-packages\ViewerFramework\VF.py", line 760, in startupDirPref_cb
root = self.setUserPreference.form.root
AttributeError: SetUserPreference instance has no attribute 'form'
hit enter to continue
Any idea what on earth is going on? A few things to note.
This seems to be trying to launch Python 2.7. The software is also packaged with that version of Python itself (wow, that strikes me as very strange). I tried using Python 3.8, and predictably it did nothing.
Working solutions welcome.
Related Publications
En esta investigación, se presenta el modelamiento computacional de la interacción de ibuprofeno con las enzimas Ciclooxigenasa 1, Ciclooxigenasa 2 y Citocromo P450 2C9. El objetivo fue comprobar la aplicabilidad de métodos de acoplamiento molecular en la determinación de nuevos ligandos y la localización de sitios activos en las enzimas, así como...
Molecular docking methods are commonly used for predicting binding modes and energies of ligands to proteins. For accurate complex geometry and binding energy estimation, an appropriate method for calculating partial charges is essential. AutoDockTools software, the interface for preparing input files for one of the most widely used docking program...
Workflow Docking with Autodock 4: A Beginner's Guide