Comments (9)
Thanks again ! Note that the exact module name is rdk ( oddt.toolkit = oddt.toolkits.rdk
)
from oddt.
Hi Fabrice,
You're using Open Babel as a backend, right?
The idx
attribute corresponds to the index used in OB, not to the residue number. However, the original residue numbering isn't lost and you can access it using res.OBResidue.GetNum()
(where res
is a residue object).
@mwojcikowski Is that intended? I think we should change it (RDKit uses residue number as idx
)
from oddt.
Hi Marta,
I was using OB backend but in fact I don't know why ! When we use oddt.toolkit.readfile, OB is the default backend ?
Now I have switched the readfile to oddt.toolkits.rdk.readfile and RDKit seem to be the new backend with residue number as idx. This is exactetly what I want, perfect !
Thanks
from oddt.
If you have both RDKit and Open Babel installed, the latter is used by default.
You can change this behavior by setting ODDT_TOOLKIT
env variable to rdkit
, or by putting oddt.toolkit = oddt.toolkits.rdkit
inside your script.
from oddt.
Sure, I think we should change the indexing in OB, although the idx
property is taken from OpenBabel's GetIdx
vs GetNum
. Maybe we should make a distinction between them and create Residue.number
property and fix Residue.idx
as an 0-based index for RDKit.
from oddt.
Sounds reasonable
from oddt.
Hi,
In version 0.5 of oddt I was using
oddt.toolkit = oddt.toolkits.rdk # force rdkit backend
By default oddt was not renumbering residue id in protein input file.
Since version oddt 0.6 with same rdkit backend the default behavior is now to renumbering.
How can I force oddt 0.6 (rdkit) to keep again the original numbering (including gap) ?
Could you provide some code example
Tanks
from oddt.
ODDT 0.6 introduced residue number
property which maps to PDB numbering. idx
which was previously that number is used as an consecutive index to match that of OpenBabel. So if I understand correctly all you need to do is to use Residue.number
instead of Residue.idx
(see the docs). If you have further problems please open new issue with a bit of code showing the changed behavior.
from oddt.
Here is a bit of code that prints PDB numbering with
import oddt
oddt.toolkit = oddt.toolkits.rdk # force rdkit backend
mol = next(oddt.toolkit.readfile('pdb', 'tests/data/dude/xiap/receptor_rdkit.pdb'))
for res in mol.residues:
print(res.number)
If you want to use atom_dict
you need to mark a molecule as a protein:
import oddt
oddt.toolkit = oddt.toolkits.rdk # force rdkit backend
mol = next(oddt.toolkit.readfile('pdb', 'tests/data/dude/xiap/receptor_rdkit.pdb'))
mol.protein = True
print(mol.atom_dict['resnum'])
from oddt.
Related Issues (20)
- oddt start HOT 3
- Pass arguments to SDF reader in RDKit
- 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
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.