Code Monkey home page Code Monkey logo

oddt's Introduction

Open Drug Discovery Toolkit

Open Drug Discovery Toolkit (ODDT) is modular and comprehensive toolkit for use in cheminformatics, molecular modeling etc. ODDT is written in Python, and make extensive use of Numpy/Scipy

Documentation Status Build Status Coverage Status Code Health Conda packages Latest Version

Documentation, Discussion and Contribution:

Requirements

  • Python 3.6+
  • OpenBabel (3.0+) or/and RDKit (2018.03+)
  • Numpy (1.12+)
  • Scipy (0.19+)
  • Sklearn (0.18+)
  • joblib (0.10+)
  • pandas (0.19.2+)
  • Skimage (0.12.3+) (optional, only for surface generation)

Install

Using PyPi (pip)

When all requirements are met, then installation process is simple

python setup.py install

You can also use pip. All requirements besides toolkits (OpenBabel, RDKit) are installed if necessary. Installing inside virtualenv is encouraged, but not necessary.

pip install oddt

To upgrade oddt using pip (without upgrading dependencies):

pip install -U --no-deps oddt

Using conda

Install a clean Miniconda environment, if you already don't have one.

Install ODDT:

conda install -c oddt oddt

You can add a toolkit of your choice or install them along with oddt:

conda install -c conda-forge oddt rdkit openbabel

(Optionally) Install OpenBabel (using official channel):

conda install -c conda-forge openbabel

(Optionally) Install RDKit (using official channel):

conda install -c conda-forge rdkit

Upgrading procedure using conda is straightforward:

conda update -c oddt oddt

Documentation

Automatic documentation for ODDT is available on Readthedocs.org. Additionally, it can be build locally:

cd docs

make html

make latexpdf

License

ODDT is released under permissive 3-clause BSD license

Reference

If you found Open Drug Discovery Toolkit useful for your research, please cite us!

  1. Wójcikowski, M., Zielenkiewicz, P., & Siedlecki, P. (2015). Open Drug Discovery Toolkit (ODDT): a new open-source player in the drug discovery field. Journal of Cheminformatics, 7(1), 26. doi:10.1186/s13321-015-0078-2

Analytics

oddt's People

Contributors

codeaditya avatar kinga322 avatar marta-sd avatar mkukielka avatar mwojcikowski avatar pknut avatar ravila4 avatar rlatawiec avatar yours-truly-rshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oddt's Issues

Index error in min_symmetry RMSD method

The min_symmetry method gives an index error for some molecules when subsetting the ref_atoms matrix using ref_atoms[match] after the hydrogen atoms have been removed.

A suggested fix is to change:
ref_atoms = ref.coords[ref.atom_dict['atomicnum'] != 1]
to:
ref_atoms = ref.coords

AttributeError: 'generator' object has no attribute 'next'

Here is the screenshot. Up to that loop, everything else was executed successfully.

I am using Python 3.

Build training and testing descriptors
def gen_descriptors(pdbid):
ligand = toolkit.readfile('sdf', 'v2007/%s/%s_ligand.sdf' %(pdbid, pdbid)).next()
protein = toolkit.readfile('pdb', 'v2007/%s/%s_pocket.pdb' %(pdbid, pdbid)).next()
return descriptor_generator.build([ligand], protein)

descriptors_train = np.vstack([gen_descriptors(pdbid) for pdbid in pdbbind_act_train.keys()])
descriptors_test = np.vstack([gen_descriptors(pdbid) for pdbid in pdbbind_act_test.keys()])

AttributeError Traceback (most recent call last)
in
4 return descriptor_generator.build([ligand], protein)
5
----> 6 descriptors_train = np.vstack([gen_descriptors(pdbid) for pdbid in pdbbind_act_train.keys()])
7 descriptors_test = np.vstack([gen_descriptors(pdbid) for pdbid in pdbbind_act_test.keys()])

in (.0)
4 return descriptor_generator.build([ligand], protein)
5
----> 6 descriptors_train = np.vstack([gen_descriptors(pdbid) for pdbid in pdbbind_act_train.keys()])
7 descriptors_test = np.vstack([gen_descriptors(pdbid) for pdbid in pdbbind_act_test.keys()])

in gen_descriptors(pdbid)
1 def gen_descriptors(pdbid):
----> 2 ligand = toolkit.readfile('sdf', 'v2007/%s/%s_ligand.sdf' %(pdbid, pdbid)).next()
3 protein = toolkit.readfile('pdb', 'v2007/%s/%s_pocket.pdb' %(pdbid, pdbid)).next()
4 return descriptor_generator.build([ligand], protein)
5

AttributeError: 'generator' object has no attribute 'next'

oddt.toolkit.readfile in 'sdf' format does not properly close sdf files

Other two formats 'pdb' and 'mol2' are working properly. Here is my code to reproduce the bug. You can commend/comment lines with different formats oddt.toolkit.readfile. It reads a total of 16126 files for each type. I downloaded refined + unrefined PDBbindDB and unzipped in the same dir "v2018":

import oddt.fingerprints
import numpy as np
import pandas as pd
from pandas import ExcelWriter
from pandas import ExcelFile
import os

baseDir = os.getcwd() + "/v2018/"
pdbCol = "PDB code"
PLEC = 'PLEC'
df = pd.read_excel(baseDir + 'pdbBind_alldata.xls', sheet_name='MyResult', index_col = 0)
df[PLEC] = "-"

PDBs = df[pdbCol].unique()

#list of pdb codes with existing structures
PDBs = [f for f in PDBs if os.path.isfile(baseDir + f + '/' + f + '_protein.pdb')]
prot_pattern = baseDir + '%s/%s_pocket.pdb'
ligand_pattern = baseDir + '%s/%s_ligand.mol2'
sdf_pattern = baseDir + '%s/%s_ligand.sdf'

#comment/uncomment each line below to see the following error:
#OSError: [Errno 24] Too many open files: 'v2018/3tl0/3tl0_ligand.sdf'
proteins = [next(oddt.toolkit.readfile('pdb', prot_pattern %(pdbid, pdbid))) for pdbid in PDBs]
ligands = [next(oddt.toolkit.readfile('mol2', ligand_pattern %(pdbid, pdbid))) for pdbid in PDBs]
sdfs = [next(oddt.toolkit.readfile('sdf', sdf_pattern %(pdbid, pdbid))) for pdbid in PDBs]

print(len(proteins))

Integration into the ChemicalToolBox

Integration of ODDT into the ChemicalToolBox would be awesome! CTB comes with a variety of tools and would nicely complement ODDT. Let me know if you are interested, I will work on this as time permits.

Thanks!
Bjoern

Charges in PDBQT files

Hi! I tried using the following code to convert a pdb file to pdbqt:

`# Script for converting receptors to pdbqt using ODDT

import sys
import oddt
from oddt.docking.AutodockVina import write_vina_pdbqt

if len(sys.argv) != 4:
print("Usage:", sys.argv[0], " <output_folder>")

else:
file_type = sys.argv[1]
receptor_file = sys.argv[2]
path = sys.argv[3]

# Read input molecule
receptor = next(oddt.toolkit.readfile(file_type, receptor_file))
									    
# Write output 
write_vina_pdbqt(receptor, path, flexible=False)

`

However, after running it, the new generated pdbqt file gives something like this:

REMARK Name = /home/dcastaneda5/refined-set/proteins/966c/966c_protein.pdb
REMARK x y z vdW Elec q Type
REMARK _______ _______ _______ _____ _____ ______ ____
ATOM 1 N ARG A 108 23.316 4.711 38.249 0.00 0.00 +0.000 N
ATOM 2 HN1 ARG A 108 23.239 3.947 38.950 0.00 0.00 +0.000 HD
ATOM 3 HN2 ARG A 108 23.093 4.340 37.304 0.00 0.00 +0.000 HD
ATOM 4 HN3 ARG A 108 24.284 5.091 38.254 0.00 0.00 +0.000 HD
ATOM 5 CA ARG A 108 22.352 5.803 38.595 0.00 0.00 +0.000 C
ATOM 6 HA ARG A 108 21.366 5.352 38.479 0.00 0.00 +0.000 HD
ATOM 7 C ARG A 108 22.351 7.000 37.650 0.00 0.00 +0.000 C
ATOM 8 O ARG A 108 23.334 7.246 36.900 0.00 0.00 +0.000 OA
ATOM 9 CB ARG A 108 22.566 6.266 40.036 0.00 0.00 +0.000 C
ATOM 10 HB1 ARG A 108 21.876 7.087 40.232 0.00 0.00 +0.000 HD
ATOM 11 HB2 ARG A 108 22.332 5.431 40.696 0.00 0.00 +0.000 HD
ATOM 12 CG ARG A 108 23.953 6.738 40.359 0.00 0.00 +0.000 C

As you can see, I get a bunch of zeroes, and its repeated along every atom of my pdbqt file. The reason why I tried using this code in the first place, is because I initially converted pdb to pdbqt using "prepare_protein4.py" code (which is part of MGL tools), and I found out that I was getting zeroes as well with metallic ions, so I decided to give it a shot with oddt.

Thanks in advance!

Add the QuickVina docking engine

Hello

Adding the QuickVina docking engine will be nice. It is already working by simply setting the path for the executable.

from oddt.virtualscreening import virtualscreening as vs
pipeline=vs(n_cpu=8)
pipeline.dock('autodock_vina', receptor, ligands, executable="/home/user/bin/qvina/bin/qvina-w") 

oddt_cli gives "bad interpreter" error

I installed oddt using pip and i get the following error when I try to run oddt_cli:

oddt_cli -h
bash: /home/samo/anaconda3/bin/oddt_cli: /home/travis/miniconda/envs/test-environment/bin/python: bad interpreter: No such file or directory

I guess the interpreter path is not adjusted when installing with pip and it keeps the travis' value.
I'm using anaconda python (python 3.6) distribution.

Support for internal parallelization in Vina

Currently, the n_cpu parameter in the virtual screening pipeline allows for running several Vina processes concurrently. However, Vina also has support for internal parallelization when run through the commandline with the --cpu argument. Is it possible to implement both types of parallelization in the pipeline?

shape of RDKit 3D molecule

I am trying to calculate a shape FP for RDkit molecule, but getting an error message:

mol1 = Chem.MolFromSmiles('COc1ccc2c(c1)[nH]c(n2)S@@Cc1ncc(c(c1C)OC)C')
mol1 = Chem.AddHs(mol1)
mol1 = Chem.EmbedMolecule(mol1)

shape1 = oddt.shape.electroshape(mol1)

Is it possible to do this?

Thanks.

SimpleInteractionFingerprint error

Hello,
I'm using ODDT to generate SILIRID fingerprints and came across an error. It works most of the times, but for some poses of a docked molecule I get an error using this code:

from oddt.fingerprints import SimpleInteractionFingerprint

ligand = list(oddt.toolkit.readfile('mol2', '2c8z_clean/2vth_ligand.mol2'))
rec = next(oddt.toolkit.readfile('mol2','_proteins_/2c8z_clean.mol2'))
rec.protein=True

for m in ligand:

ifp = SimpleInteractionFingerprint(m,rec)

print(ifp)`

[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
Traceback (most recent call last):
File "", line 2, in
File "/home/marcos/anaconda3/lib/python3.6/site-packages/oddt-0.4.1-py3.6.egg/oddt/fingerprints.py", line 176, in SimpleInteractionFingerprint
amino_acids, acceptors[strict1]['resname']), 4], 1)
IndexError: index 21 is out of bounds for axis 0 with size 21

Any idea what's causing this problem? As you can see, it generates fingerprints for some poses of the ligand but fails on the last one.

Segmentation fault (core dumped)

Hello,
I ran into an issue while reading a pdb file with ODDT.
This is the part that caused the problem:

rec = next(oddt.toolkit.readfile('pdb','PDBBind2017_proteins/1px4_protein.pdb'))

Reading protein 1px4.pdb (from PDBBind2017 refined set) I always get an error.

These are my system specs:
Arquitetura: x86_64
Modo(s) operacional da CPU:32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per núcleo 2
Núcleo(s) por soquete:4
Soquete(s): 1
Nó(s) de NUMA: 1
ID de fornecedor: GenuineIntel
Família da CPU: 6
Modelo: 60
Model name: Intel(R) Core(TM) i7-4790S CPU @ 3.20GHz
Step: 3
CPU MHz: 3326.250
CPU max MHz: 4000,0000
CPU min MHz: 800,0000
BogoMIPS: 6385.79
Virtualização: VT-x
cache de L1d: 32K
cache de L1i: 32K
cache de L2: 256K
cache de L3: 8192K
NUMA node0 CPU(s): 0-7

Docking engine %s was not implemented in ODDT

tried to run the Snippet_1 tutorial and got stuck with this error
C:\Windows\System32\oddt\oddt\virtualscreening.py in dock(self, engine, protein, *args, **kwargs)
246 if engine.lower() == 'autodock_vina':
247 from oddt.docking import autodock_vina
--> 248 engine = autodock_vina(protein, *args, **kwargs)
249 else:
250 raise ValueError('Docking engine %s was not implemented in ODDT

Knime Nodes

Utilize Python Nodes released recently in Knime 3.4 to support ODDT operations.
Review 3D-e-Chem nodes on github for inspitarion. You may want to use NodeWizzard.

Node types:

  • docking
  • scoring
  • fingerprints
  • conformer generators
  • screening (USR, IFPs)

documentation may need updating

I don't know how much more work is going into the doc.
On the main landing page, there is an example with
mol.atom_dict[‘is_acceptor’]
However it should be isacceptor

Another typo is
protein_atoms, ligand_atoms, strict = hbond(protein, ligand)
where it should be hbonds

I think I got some other errors when I tried some codes, but I can't remember them.
One other think that could help is to explicitly show which module is used, for example, SimpleInteractionFingerprint in document could be oddt.fingerprints.SimpleInteractionFingerprint instead

atom_dict performance issues with RDKit

Creating an atom_dict takes much longer when using rdk rather than openbabel as the backend toolkit. I think most of that time is spent on checking atom types with _sybyl_atom_type and calling _atom_matches_smarts so many times inside of it.

Now, it's not that much of a problem for smaller molecules but with proteins some operations with rdk can become unworkably slow, especially compared to openbabel.

I feel like there are a few ways to go about it:

  • Somehow make it an option not to check the atom types because sometimes it's not needed
  • Rewrite the parts that don't need type checking to not use atom_dict
  • Display a warning when using features that require an atom_dict
  • Not let the user use those features with rdkit, but that's probably the worst option

Thanks for looking into it.

UnboundLocalError when using shape similarity from command line

I'm trying to calculate some shape similarity from the command line using oddt:

oddt_cli db.sdf -i sdf -O result.sdf -o sdf --similarity electroshape --query q.sdf --cutoff 0.8 --toolkit rdk

And I get the following error:

Traceback (most recent call last):
  File "/home/samo/anaconda3/bin/oddt_cli", line 257, in <module>
    main()
  File "/home/samo/anaconda3/bin/oddt_cli", line 191, in main
    pipeline.similarity(sim, query, protein=receptor, cutoff=args.cutoff)
UnboundLocalError: local variable 'receptor' referenced before assignment

When I remove " protein=receptor" to go around this issue, I get 'NameError', because you forgot to import usr_similarity in oddt.virtualrscreening (line 18). Fixing the import fixes this problem.

Package was installed using pip and I'm using anaconda python distribution (python 3.6).

Where get the data "input_ligands.sdf" ?

Hi
I am trying to run oddt_cli and I found you put input_ligands.sdf as argument .
It seems like data file But I can't find where it is
Could you point me where I get it If you don't mind thx

pip failed to install

Attempting pip install on Ubuntu 16.04.

pip version 18.1

sudo -H pip --no-cache-dir install oddt
Collecting oddt
Downloading https://files.pythonhosted.org/packages/82/2b/35c38c89e2746b0a465d0aafcba87dbd10dcf854df28694f8a24920e1941/oddt-0.6.tar.gz (2.0MB)
100% |████████████████████████████████| 2.0MB 26.1MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-hNoXFW/oddt/setup.py", line 3, in
from oddt import version as VERSION
File "/tmp/pip-install-hNoXFW/oddt/oddt/init.py", line 20, in
from oddt.toolkits import ob
File "/tmp/pip-install-hNoXFW/oddt/oddt/toolkits/ob.py", line 50, in
elementtable = ob.OBElementTable()
AttributeError: 'module' object has no attribute 'OBElementTable'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-hNoXFW/oddt/

Implement USRs

Implement USR, ElectroShape and USRCAT:

  • USR [1, 2]
  • USRCAT [3]
  • ElectroShape [4]

examples?

hi, nice project.

can you add some examples in github? having jupyter notebook is great too. thanks.

Error when calculating PLECs

For a large number of PDB codes in v2018 edition of PDB bind, an attempt to calculate PLEC fingerprint results in an error message. Here is how to reproduce it. A similar error happens when using sdf instead of a mol2 reader.

pdbid = "1a37"

baseDir = os.getcwd() + "/v2018/"
prot_pattern = baseDir + '%s/%s_pocket.pdb'
ligand_pattern = baseDir + '%s/%s_ligand.mol2'

protein = next(oddt.toolkit.readfile('pdb', prot_pattern %(pdbid, pdbid)))
ligand = next(oddt.toolkit.readfile('mol2', ligand_pattern %(pdbid, pdbid)))
PLEC = oddt.fingerprints.PLEC(ligand, protein, size=4092, depth_protein=5, depth_ligand=1, distance_cutoff=4.5,sparse=True)
print(PLEC)

Below is the error message:

AttributeError Traceback (most recent call last)
in
8 protein.protein = True
9 ligand = next(oddt.toolkit.readfile('mol2', ligand_pattern %(pdbid, pdbid)))
---> 10 PLEC = oddt.fingerprints.PLEC(ligand, protein, size=4092, depth_protein=5, depth_ligand=1, distance_cutoff=4.5,sparse=True)
11 print(PLEC)

~\AppData\Local\Continuum\anaconda3\envs\my-rdkit-env\lib\site-packages\oddt\fingerprints.py in PLEC(ligand, protein, depth_ligand, depth_protein, distance_cutoff, size, count_bits, sparse, ignore_hoh)
734 protein_mask = protein_mask & (protein.atom_dict['resname'] != 'HOH')
735 protein_dict = protein.atom_dict[protein_mask]
--> 736 ligand_dict = ligand.atom_dict[ligand.atom_dict['atomicnum'] != 1]
737
738 # atoms in contact

~\AppData\Local\Continuum\anaconda3\envs\my-rdkit-env\lib\site-packages\oddt\toolkits\rdk.py in atom_dict(self)
555 # check cache and generate dicts
556 if self._atom_dict is None:
--> 557 self._dicts()
558 return self._atom_dict
559

~\AppData\Local\Continuum\anaconda3\envs\my-rdkit-env\lib\site-packages\oddt\toolkits\rdk.py in _dicts(self)
664 ]
665
--> 666 atom_dict = np.empty(self.Mol.GetNumAtoms(), dtype=atom_dtype)
667 metals = [3, 4, 11, 12, 13, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
668 30, 31, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,

AttributeError: 'NoneType' object has no attribute 'GetNumAtoms'

vina error

Try to see if my installation works using script in your paper, but autodockvina gives error. Is the parameters passed to vina normal? Thanks!

from oddt.virtualscreening import virtualscreening as vs

Initiate virtual screening pipeline using 4 CPUs

pipeline = vs(n_cpu=4)

Load ligands from a mol2 file

pipeline.load_ligands('mol2', 'ampc/actives_final.mol2.gz')

Filter ligands by weight and solubility

pipeline.apply_filter('150 < mol.molwt < 350')
pipeline.apply_filter('0 < mol.logp < 5')

Dock entire library to receptor, autocenter docking box on ligand

pipeline.dock('autodock_vina', 'ampc/receptor.pdbqt', 'ampc/crystal_ligand.mol2')

Write docked ligands conformations to a file (including scores)

pipeline.write('mol2', 'ampc_docked.mol2', overwrite=True, opt={'c':None})

Rescore docking results using RFscore NNscore

pipeline.score(function='rfscore', protein='ampc/receptor.pdbqt')
pipeline.score(function='nnscore', protein='ampc/receptor.pdbqt')

Write computed scores to csv

pipeline.write_csv('ampc_docked.csv')

subprocess.CalledProcessError: Command '['/home/magnolia/protein/autovina/bin/vina', '--receptor', 'ampc/receptor.pdbqt', '--ligand', '/tmp/autodock_vina_RbPIq2/ligands_ybJzTA/0_308.pdbqt', '--out', '/tmp/autodock_vina_RbPIq2/ligands_ybJzTA/0_308_out.pdbqt', '--center_x', '0', '--center_y', '0', '--center_z', '0', '--size_x', 'a', '--size_y', 'm', '--size_z', 'p', '--cpu', '1', '--exhaustiveness', '8', '--num_modes', '9', '--energy_range', '3']' returned non-zero exit status 1

docking tool implementation in oddt

hi , a very basic question
just tried to run the first example of pipeline docking using oddt and here what popped up

code:

pipeline.dock('autodock_vina', 'ampc/receptor.pdbqt', 'ampc/crystal_ligand.mol2')
print("docking libray

out:
else:
250 raise ValueError('Docking engine %s was not implemented in ODDT'

FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable

even though i downloaded the complete file,
could you help me out

ValueError in

Dear,
I read the article. It's nice work.
But I couldn't run ipython notebook in supporting information.
When I run Snippet_1.ipynb, value error was occurred.
Error message is following.

raise ValueError('Docking engine %s was not implemented in ODDT' % engine)
ValueError: Docking engine vina was not implemented in ODDT
Vina was already installed. But same error was occured.
I wonder if you have any suggestion or advice, you could provide would be greatly appreciated.

pdbqt protein

Maciej , I tried to implement oddt to student teaching with ipython notebooks and faced with wired thing:
I loaded protein

for ps in oddt.toolkit.readfile('pdb','/tmp/1lmp.pdb'):
    if  ps.molwt > 5000:
        prot = ps
prot.calccharges()

made vina object

result= av.autodock_vina(protein=prot,auto_ligand=mol,size=(20,20,20),center=(42.0,48.0,30.0),executable='/usr/bin/vina',

and did the run

result.dock([mol],prot)

with following result

CalledProcessError: Command '['/usr/bin/vina', '--receptor', '/tmp/autodock_vina_mXvaAf/protein.pdbqt', '--ligand', '/tmp/autodock_vina_mXvaAf/ligands_i_spA1/0_.pdbqt', '--out', '/tmp/autodock_vina_mXvaAf/ligands_i_spA1/0__out.pdbqt', '--center_x', '0.00202614', '--center_y', '0.000736733', '--center_z', '1.17657e-05', '--size_x', '20', '--size_y', '20', '--size_z', '20', '--cpu', '1', '--exhaustiveness', '8', '--num_modes', '9', '--energy_range', '3']' returned non-zero exit status 1

turned out that pdbqt contain ROOT line and this leads to vina error

REMARK                         _______ _______ _______ _____ _____    ______ ____
ROOT
ATOM      1  N   LYS A  1       40.347  23.372  17.250  0.00  0.00    -0.118 NA

Actually it's problem of babel and this makes all workbench unusable since prepare_receptor4.py from MGL is dead with new numpy (oldnumeric issue). From this point you module looks very attractive as one possible way of making fast docking in ipython notebooks.
I may add some stupid code to remove this lines inside def set_protein(self, protein).
I just worried about better way

Andrey

Do not renumber residue id in protein input file

Hi Maciej very good tool, thanks,

I try to extract the list of residues that interact with a ligand using oddt

I separate protein and ligand from PDB in two respective files. Then I try to access the residues involved in hbond.
Unfortunately by default residues numbering in oddt do not respect the input file uniprot numbering and provide a new residues numbering starting at res1.
How can I force oddt to keep the original numbering (including gap) ?

Fabrice

PhD student Orleans University, France

datasets.py does not correctly locate pdbbind index files for version greater than 2016

Very minor issue - PDBbind releases post-2016 store index files in the /index subdirectory. Currently, the pdbbind class from oddt.datasets only looks in {home}/index if version==2016 and otherwise defaults to looking in {home}, causing it to be unable to locate index files for the 2017 and 2018.

Changing line 64 of datasets.py from
elif version == 2016
to
elif version >= 2016
resolves the issue.

I've tweaked this in my local install, but would be great to have support for the most recent PDBbind release in the release version.

use Residue.number instead of Residue.idx in all functions that detect interractions

Hi,
This new isue follow the #71
My problem is very simple: I wat that the following code return the original Residue.number value instead of Residue.idx. So for example I replace
hydrophobic_contacts(prot, lig)[0]['resid']
by
hydrophobic_contacts(prot, lig)[0]['resnum']
Result return an array because in
hydrophobic_contacts(prot, lig)[0].dtype
There is both
('resid', '<i2'), ('resnum', '<i2')
This is true for all functions that detect interactions except for pi_stacking.

# aromatic face to face (Column = 1), aromatic edge to face (Column = 2) rings, _, strict_parallel, strict_perpendicular = pi_stacking( protein, ligand) np.add.at(IFP, [np.searchsorted( resids, np.sort(rings[strict_parallel]['resnum'])[::-1]), 1], 1) np.add.at(IFP, [np.searchsorted( resids, np.sort(rings[strict_perpendicular]['resnum'])[::-1]), 2], 1)

Note that in oddt version 0.5 the returned value is correct only with rdkit backend.
Now in oddt version 0.6 I dont know how to access Residue.number for pi_stacking again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.