Comments (10)
Hi, I tried the suggested method for calculating charges with xiap
, but it didn't work. The bonds were removed, but it still throws the same error as before. Could there be a difference across openbabel versions? I am using 2.4.1.
Also, I tried using the RDKit backend, but it fails with TypeError: category must be a Warning subclass, not 'str'
. I think #79 fixes that.
from oddt.
You're right, this example doesn't work with OB 2.4.1 and the default model, we'll take a look at that. Meanwhile you can use different model, e.g. MMFF94 works for this one: mol.calccharges('mmff94')
.
Disclaimer: charging molecules in OB is painful, it is often impossible to find a pipeline that works for all compounds in the database...
And with RDKit you're right again, there was an error in the warning, thank you for fixing it (and welcome to the ODDT team :)) Note, however, that it means that RDKit wasn't able to calculate the charges properly (there are some NaNs etc)
from oddt.
The remarks partially answer your question, those three columns are:
- vdW (van der Waals radii)
- Elec (electrostatic potential)
- q (partial charge)
You will get partial charge should you generate it beforehand.
Anyhow, Autodock Vina does not use any of those columns. Autodock 4 will use the partial charges, I don't think the vdW and Elec is necessary at all (unless you want to override the default values).
from oddt.
Thank you for your fast response. However, could you tell me how to generate these partial charges that you mention beforehand? I was under the impression that this code would generate them for me.
We are using a modified version of NNScore and we are testing different pdbqt files for it. We initially generated pdbqt files using MGLtools ("prepare_protein4.py"), but we noticed that it does not calculate charges for metallic ions in the files. To my knowledge NNScore uses partial charges for scoring.
Thanks in advance.
from oddt.
Yes, in fact NNscore uses partial charges in computing Coulombic interactions. You can generate partial charges with mol.calccharges()
ant they should appear in the PDBQT file. Note, that RDKit does not have this functionality yet. PR is coming soon.
from oddt.
Finally, you could use NNscore which is implemented in ODDT:
from oddt.scoring.functions import nnscore
According to our tests it performs better than the original one on either PDBbind and DUD-e database. Additionally it is much faster and does not require PDBQT files.
from oddt.
Hi! Thank you for your help and for updating oddt! Now it works for almost every molecule. I have successfully generated the partial charges with the proposed function (calccharges), however I have encountered a similar problem as the code from MGL Tools (prepare4_receptor.py), it displays an error whenever it has a metallic ion attached. I have tried with the DUD-E data set, and the proteins that came up with an error are those with metals attached (24 out of 102, containing either Zn, Mg, Fe). For instance, it won't work with ada17, xiap, mpp13, hdac8, hdac2, cp2c9, among others. The error I am getting is the following:
Traceback (most recent call last):
File "oddt_pdbqt_converter.py", line 20, in
receptor.calccharges()
File "/Users/Danniel/miniconda2/lib/python2.7/site-packages/oddt/toolkits/ob.py", line 285, in calccharges
super(Molecule, self).calccharges(model)
File "/Users/Danniel/miniconda2/lib/python2.7/site-packages/pybel.py", line 499, in calccharges
raise Exception(error)
Exception: Molecule failed to charge.
I am using openbabel for this.
Thanks in advance!
from oddt.
When you read molecule from PDB usually you get zero order bonds coordinating the metal atoms, to which OB is apparently not invariant. I've checked for xiap
and following code fixes charge generation
import oddt
mol = next(oddt.toolkit.readfile('pdb', 'xiap_receptor.pdb')
# remove zero order bonds from metals
for atom in mol:
if atom.atomicnum == 30: # Atomic num of treated metals
for bond in atom.bonds:
mol.OBMol.DeleteBond(bond.OBBond)
mol.calccharges()
For other atoms change the if to a list of atomic numbers of metals.
from oddt.
Before our PR #78 the default method for mol.calcchrges
was mmff94
, which works for xiap
. On the other hand gasteiger
partial charges are suggested for small molecules, thus we unified that for OB and RDKit by setting default method to gasteiger
(the most common use case is small molecule). Secondly, 'mmff94' should work better for proteins and, as pointed out by @marta-sd, they work for xiap
so i suggest using it. Gasteiger for proteins is problematic most times.
from oddt.
I think this discussion drifted apart from the original issue, so I'm going to close this. Open a new issue, should you have other problems.
from oddt.
Related Issues (20)
- simple scoring example HOT 3
- PLEC calculation is very slow HOT 2
- score discrepancies HOT 4
- Calculating PLEC by bypassing completely OpenBabel HOT 6
- Could there be a new release? HOT 2
- Ring normal vector is calculated incorrectly in pip package HOT 1
- Please do not install tests into the 'test' directory
- failure in completing HOT 4
- Protein structure used does not change when using autodock_vina_descriptor.build()
- PIP distribution does not correspond to github version HOT 1
- Installing oddt from poetry is not possible HOT 3
- TypeError: in method 'new_OBMol' HOT 2
- RDKIT molecule HOT 1
- Training scoring functions and updated version of PDBBind HOT 2
- oodt syntax error HOT 1
- pip installation failed -
- you have a mol2 parser in there? HOT 3
- Docking Issues Between MacOS and Windows HOT 1
- AttributeError: module 'openbabel.openbabel' has no attribute 'OBElementTable' HOT 1
- toolkit not being recognised
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oddt.