ProDy icon indicating copy to clipboard operation
ProDy copied to clipboard

Potential issue with conda package.

Open vincrichard opened this issue 11 months ago • 5 comments
trafficstars

Hello, and thank you for all the work you have been doing on proDy. :heart:

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.

https://github.com/prody/ProDy/blob/af00703a9685c57d1df1410953575ca8cde1ea0b/setup.py#L16-L19

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.

vincrichard avatar Nov 28 '24 07:11 vincrichard

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 avatar Nov 28 '24 09:11 jamesmkrieger

Thanks again for reporting this. I have now updated my installation recipe in my release candidates (e.g. https://github.com/jamesmkrieger/prody-feedstock/commit/2ee61721d4a5b205e483f6e12ff837f2237c11ae) and will testing building them

jamesmkrieger avatar Dec 13 '24 12:12 jamesmkrieger

@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.

vincrichard avatar Dec 19 '24 01:12 vincrichard

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

jamesmkrieger avatar Dec 19 '24 07:12 jamesmkrieger

Hi @vincrichard, is this issue fixed in the updated conda release?

jamesmkrieger avatar May 01 '25 09:05 jamesmkrieger

This should hopefully now be fixed with v2.6.1. Please reopen if that is not the case.

AnthonyBogetti avatar Aug 19 '25 19:08 AnthonyBogetti