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

TypeError: unhashable type: 'OBAtom' #58

Closed
navanchauhan opened this issue May 5, 2020 · 3 comments
Closed

TypeError: unhashable type: 'OBAtom' #58

navanchauhan opened this issue May 5, 2020 · 3 comments

Comments

@navanchauhan
Copy link

platform: macOS Catalina
python: 3.7.7

With reference to #46 I have commented out the three lines from supplemental.py

Error:

$ python3 plip/plipcmd.py -I 6lu7

/usr/local/lib/python3.7/site-packages/openbabel/__init__.py:14: UserWarning: "import openbabel" is deprecated, instead use "from openbabel import openbabel"
  warnings.warn('"import openbabel" is deprecated, instead use "from openbabel import openbabel"')
Traceback (most recent call last):
  File "plip/plipcmd.py", line 311, in <module>
    main_init()
  File "plip/plipcmd.py", line 307, in main_init
    main(expanded_path, arguments.pdbid)  # Start main script
  File "plip/plipcmd.py", line 171, in main
    process_pdb(pdbpath, config.OUTPATH, outputprefix=outputprefix)
  File "plip/plipcmd.py", line 63, in process_pdb
    mol.load_pdb(pdbfile, as_string=as_string)
  File "/Users/navanchauhan/Desktop/nCOV-19/scripts/plip/plip/modules/preparation.py", line 1354, in load_pdb
    ligandfinder = LigandFinder(self.protcomplex, self.altconf, self.modres, self.covalent, self.Mapper)
  File "/Users/navanchauhan/Desktop/nCOV-19/scripts/plip/plip/modules/preparation.py", line 229, in __init__
    self.ligands = self.getligs()
  File "/Users/navanchauhan/Desktop/nCOV-19/scripts/plip/plip/modules/preparation.py", line 274, in getligs
    ligands.append(self.extract_ligand(kmer))
  File "/Users/navanchauhan/Desktop/nCOV-19/scripts/plip/plip/modules/preparation.py", line 311, in extract_ligand
    hetatoms_res = set([(obatom.GetIdx(), obatom) for obatom in pybel.ob.OBResidueAtomIter(obresidue)
TypeError: unhashable type: 'OBAtom'
@vjhaupt
Copy link
Contributor

vjhaupt commented May 6, 2020

which PLIP and openbabel version do you use and how did you install PLIP?

@navanchauhan
Copy link
Author

I am using the stable branch, I tried using plip without installing from the root directory

I then tried installing via setup.py which has now narrowed the problem to missing header files. After copying the header files from the brew Cellar folder, there is still a missing header file openbabel/atomclass.h

I installed open-babel using home-brew ( version 3.0.0 ) and have also installed pybel using pip

python3 setup.py install error:

running install
running bdist_egg
running egg_info
writing plip.egg-info/PKG-INFO
writing dependency_links to plip.egg-info/dependency_links.txt
writing requirements to plip.egg-info/requires.txt
writing top-level names to plip.egg-info/top_level.txt
reading manifest file 'plip.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'plip.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.15-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.15-x86_64/egg
creating build/bdist.macosx-10.15-x86_64/egg/plip
copying build/lib/plip/__init__.py -> build/bdist.macosx-10.15-x86_64/egg/plip
copying build/lib/plip/plipcmd.py -> build/bdist.macosx-10.15-x86_64/egg/plip
creating build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/webservices.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/pymolplip.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/detection.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/config.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/chimeraplip.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/__init__.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/visualize.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/mp.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/plipxml.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/plipremote.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/report.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/preparation.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
copying build/lib/plip/modules/supplemental.py -> build/bdist.macosx-10.15-x86_64/egg/plip/modules
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/plipcmd.py to plipcmd.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/webservices.py to webservices.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/pymolplip.py to pymolplip.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/detection.py to detection.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/config.py to config.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/chimeraplip.py to chimeraplip.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/visualize.py to visualize.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/mp.py to mp.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/plipxml.py to plipxml.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/plipremote.py to plipremote.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/report.py to report.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/preparation.py to preparation.cpython-37.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/plip/modules/supplemental.py to supplemental.cpython-37.pyc
creating build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
installing scripts to build/bdist.macosx-10.15-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.macosx-10.15-x86_64/egg/EGG-INFO/scripts
copying build/scripts-3.7/plipcmd.py -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.macosx-10.15-x86_64/egg/EGG-INFO/scripts/plipcmd.py to 755
copying plip.egg-info/PKG-INFO -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying plip.egg-info/SOURCES.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying plip.egg-info/dependency_links.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying plip.egg-info/not-zip-safe -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying plip.egg-info/requires.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying plip.egg-info/top_level.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
creating 'dist/plip-1.4.5-py3.7.egg' and adding 'build/bdist.macosx-10.15-x86_64/egg' to it
removing 'build/bdist.macosx-10.15-x86_64/egg' (and everything under it)
Processing plip-1.4.5-py3.7.egg
removing '/usr/local/lib/python3.7/site-packages/plip-1.4.5-py3.7.egg' (and everything under it)
creating /usr/local/lib/python3.7/site-packages/plip-1.4.5-py3.7.egg
Extracting plip-1.4.5-py3.7.egg to /usr/local/lib/python3.7/site-packages
plip 1.4.5 is already the active version in easy-install.pth
Installing plipcmd.py script to /usr/local/bin

Installed /usr/local/lib/python3.7/site-packages/plip-1.4.5-py3.7.egg
Processing dependencies for plip==1.4.5
Searching for openbabel
Reading https://pypi.org/simple/openbabel/
Downloading https://files.pythonhosted.org/packages/9c/30/eb9c3d3d3b86981f6c6a7b8eceb6f4a13b9a12673efbc842b7cebe0ce39a/openbabel-2.4.1.tar.gz#sha256=bc536b292fece9763a65b04fe637af9d393ae17f656321305fe2569a0d8de43f
Best match: openbabel 2.4.1
Processing openbabel-2.4.1.tar.gz
Writing /var/folders/p7/nz2vlh1n4zd5q7pwrp81_l_00000gn/T/easy_install-s2o_qbya/openbabel-2.4.1/setup.cfg
Running openbabel-2.4.1/setup.py -q bdist_egg --dist-dir /var/folders/p7/nz2vlh1n4zd5q7pwrp81_l_00000gn/T/easy_install-s2o_qbya/openbabel-2.4.1/egg-dist-tmp-id5s9bb4
file openbabel.py (for module openbabel) not found
Warning: package openbabel-2.0 could not be found by pkg-config.
Guessing Open Babel location:
- include_dirs: ['/usr/local/include', '/usr/local/opt/openssl@1.1/include', '/usr/local/opt/sqlite/include', '/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m', '/usr/local/include/openbabel-2.0']
- library_dirs: ['/usr/local/lib', '/usr/local/opt/openssl@1.1/lib', '/usr/local/opt/sqlite/lib', '/usr/local/lib']
file openbabel.py (for module openbabel) not found
file openbabel.py (for module openbabel) not found
openbabel-python.i:292: Error: Unable to find 'openbabel/atomclass.h'

Error: SWIG failed. Is Open Babel installed?
You may need to manually specify the location of Open Babel include and library directories. For example:
  python setup.py build_ext -I/usr/local/include/openbabel-2.0 -L/usr/local/lib
  python setup.py install
error: Setup script exited with 1

@vjhaupt
Copy link
Contributor

vjhaupt commented May 6, 2020

The issue is apparently the failed openbabel installation. First make sure that openbabel is functional and then try with PLIP again. You should use the feature/docker for now if you want to use openbabel 3 with python 3 (this will soon be merged in the stable branch).

BTW: We will publish a docker container with a complete setup soon. You could consider waiting for that.

I am closing the issue since it is related to the broken openbabel installation.

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