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

Potential issue with conda package. #2005

Open
vincrichard opened this issue Nov 28, 2024 · 4 comments
Open

Potential issue with conda package. #2005

vincrichard opened this issue Nov 28, 2024 · 4 comments

Comments

@vincrichard
Copy link

Hello, and thank you for all the work you have been doing on proDy. ❤️

I would like to report a potential bug during installation of proDy with conda.

Here is my conda environment file:

channels:
  - zeroae
  - mordred-descriptor
  - pyg
  - pytorch
  - nvidia/label/cuda-11.7.0
  - conda-forge
  - nodefaults
dependencies:
  - ambertools=22.0
  - biopandas=0.4.1
  - cairosvg=2.5.2
  - captum=0.5.0
  - cuda=11.7.0
  - cudatoolkit=11.7.0
  - cython=0.29.33
  - dask=2023.4.0=pyhd8ed1ab_0
  - distributed=2023.4.0=pyhd8ed1ab_0
  - dm-tree=0.1.6
  - fpocket=4.0.3
  - grpcio-tools=1.54.2
  - grpcio=1.54.2
  - libprotobuf=3.21.12
  - mdanalysis
  - mkl=2024.0.0
  - mordred=1.2.0
  - networkx=2.5.1
  - numpy=1.24.4
  - openbabel=3.1.1
  - openpyxl=3.1.1
  - optuna=2.4.0
  - pandas=1.5.2
  - pyg=2.3.0
  - pyhumps=1.6.1
  - python=3.9.17
  - python_abi=3.9
  - pytorch-cluster=1.6.0
  - pytorch-cuda=11.7
  - pytorch-mutex=1.0
  - pytorch-scatter=2.1.1
  - pytorch-sparse=0.6.16
  - pytorch-spline-conv=1.2.2
  - pytorch=1.13.1
  - pytest=8.3.3
  - ProDy=2.4.1
  - rdkit=2022.9.4
  - requests=2.26.0
  - rich=12.6.0
  - scikit-learn=1.2.1
  - torchaudio=0.13.1
  - torchvision=0.14.1
  - typing-extensions=4.3.0
  - lightning=2.1.4 
  - tensorboard=2.18.0

I think biopython is intalled by proDy since it iis in the dependency. There seem to be no limitation with python3 as we can below.

ProDy/setup.py

Lines 16 to 19 in af00703

if sys.version_info[:2] == (2, 7) or sys.version_info[:2] <= (3, 5):
INSTALL_REQUIRES=['numpy>=1.10', 'biopython<=1.76', 'pyparsing', 'scipy']
else:
INSTALL_REQUIRES=['numpy>=1.10,<2', 'biopython', 'pyparsing<=3.1.1', 'scipy', 'setuptools']

However, running the code below after installation lead to an error.

import prody
protein = prody.parsePDB("4rpn_protein.pdb")
pocket = prody.parsePDB("pocket1_atm.pdb")
[r for r in protein.iterResidues() if r.select("protein within 1 of pocket", pocket=pocket) is not None]

Gives:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <listcomp>
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/atomic.py", line 232, in select
    return SELECT.select(self, selstr, **kwargs)
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 895, in select
    indices = self.getIndices(atoms, selstr, **kwargs)
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 953, in getIndices
    torf = self.getBoolArray(atoms, selstr, **kwargs)
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 1005, in getBoolArray
    tokens = parser(selstr, parseAll=True)
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 1110, in _noParser
    return [self._default(selstr, 0, selstr.split())]
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 1128, in _default
    torf, err = self._and2(sel, loc, tokens)
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 1491, in _and2
    arr, err = self._unary(sel, loc, unary.pop(0))
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 1567, in _unary
    return self._within(sel, loc, tokens)
  File ".env-conda/lib/python3.9/site-packages/prody/atomic/select.py", line 1645, in _within
    search(within, coords[index])
  File ".env-conda/lib/python3.9/site-packages/prody/kdtree/kdtree.py", line 205, in search
    self._kdtree.search_center_radius(center, radius)
AttributeError: 'C KDTree' object has no attribute 'search_center_radius'

I try fixing biopython to version 1.76, default was 1.81 during the install. But I could not make it work. In my case, I them fixed proDy to an earlier version 2.0 to make it work.

I might be doing something wrong. But wanted to raise this up, in case it is a trickier issue.

@jamesmkrieger
Copy link
Contributor

This is prody’s kdtree, not biopython’s one. It looks like conda isn’t building the prody c extensions properly. Can you give us the installation logs for the current prody and the one that works please?

@jamesmkrieger
Copy link
Contributor

Thanks again for reporting this. I have now updated my installation recipe in my release candidates (e.g. jamesmkrieger/prody-feedstock@2ee6172) and will testing building them

@vincrichard
Copy link
Author

@jamesmkrieger Sorry, I have been a bit busy and could not run your request. Anyway, thank you for the amazing work !
Let me know if you want me to test anything else.

@jamesmkrieger
Copy link
Contributor

No worries. I am hopefully figuring out the conda things anyway

If you want to use prody in the meantime, I suggest you install it from GitHub:

git clone https://github.com/prody/ProDy.git
cd ProDy
python setup.py build_ext --inplace --force
pip install -Ue .

Building the C extensions should fix kdtree and using inplace and -e should make sure python can find them

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