Skip to content
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

Missing dependency openbabel #6

Closed
Dom1L opened this issue May 2, 2019 · 5 comments
Closed

Missing dependency openbabel #6

Dom1L opened this issue May 2, 2019 · 5 comments

Comments

@Dom1L
Copy link

Dom1L commented May 2, 2019

Hi,

I tried to read a ligand with SmallMol('ligands.sdf', force_reading=True), but openbabel seems to be missing in the dependency list. With force_reading=False it also fails and suggests to set it True.

I installed moleculekit through conda install -c acellera moleculekit

In [1]: from moleculekit.smallmol.smallmol import SmallMol                                                                                                                               

In [2]: ligs = SmallMol('ligands.sdf', force_reading=True)                                                                                                                               
Reading ligands.sdf with force_reading procedure
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-f3cfc0eeef37> in <module>
----> 1 ligs = SmallMol('ligands.sdf', force_reading=True)

/shared/dominik/repos/moleculekit/moleculekit/smallmol/smallmol.py in __init__(self, mol, ignore_errors, force_reading, fixHs, removeHs)
     98         self._frame = 0
     99 
--> 100         _mol = self._initializeMolObj(mol, force_reading, ignore_errors)
    101 
    102         if removeHs:

/shared/dominik/repos/moleculekit/moleculekit/smallmol/smallmol.py in _initializeMolObj(self, mol, force_reading, ignore_errors)
    145                 if _mol is None and force_reading:
    146                     logger.warning('Reading {} with force_reading procedure'.format(mol))
--> 147                     sdf = openbabelConvert(mol, name_suffix, 'sdf')
    148                     _mol = Chem.SDMolSupplier(sdf, removeHs=False)[0]
    149                     os.remove(sdf)

/shared/dominik/repos/moleculekit/moleculekit/smallmol/util.py in openbabelConvert(input_file, input_format, output_format)
    213     """
    214 
--> 215     import openbabel
    216     import tempfile
    217     input_format = input_format[1:] if input_format.startswith('.') else input_format

ModuleNotFoundError: No module named 'openbabel'
@Dom1L
Copy link
Author

Dom1L commented May 2, 2019

I have also just seen that I should use smallmollib to read .sdf , my fault on this one

@stefdoerr
Copy link
Contributor

stefdoerr commented May 2, 2019 via email

@Dom1L
Copy link
Author

Dom1L commented May 2, 2019

I'm aware, but shouldn't it be in the dependencies of the package?

@stefdoerr
Copy link
Contributor

Not until we decide on the hard dependencies. I left out on purpose openbabel and rdkit because they are both a bit tricky dependencies. I can add a "please install openbabel with ..." as I did with rdkit there though.

@Dom1L
Copy link
Author

Dom1L commented May 3, 2019

Oh okay I wasn't aware of that.
Just wanted to mention that just in case it slipped through or something. Thanks!

@Dom1L Dom1L closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants