forlilab / Meeko

Interfacing RDKit and AutoDock
GNU Lesser General Public License v2.1
169 stars 41 forks source link

Error when running mk_prepare_ligand.py: TypeError: can't multiply sequence by non-int of type 'Forward' #108

Closed yipy0005 closed 2 months ago

yipy0005 commented 2 months ago

Hi! I ran the bash script run.sh in example/covalent_docking and it gave me the following error:

@> 397 atoms and 1 coordinate set(s) were parsed in 0.00s.
CovalentBuilder> searching for residue: resname CYS and resnum 6 and (name CA or name CB)
Traceback (most recent call last):
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/bin/mk_prepare_ligand.py", line 310, in <module>
    covalent_builder = CovalentBuilder(rec_prody_mol, args.rec_residue)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/meeko/covalentbuilder.py", line 63, in __init__
    out = self._generate_prody_selection(selection_tuple)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/meeko/covalentbuilder.py", line 80, in _generate_prody_selection
    found = self.rec.select( sel_string )
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/prody/atomic/atomic.py", line 232, in select
    return SELECT.select(self, selstr, **kwargs)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/prody/atomic/select.py", line 895, in select
    indices = self.getIndices(atoms, selstr, **kwargs)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/prody/atomic/select.py", line 953, in getIndices
    torf = self.getBoolArray(atoms, selstr, **kwargs)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/prody/atomic/select.py", line 1004, in getBoolArray
    parser = self._getParser(selstr)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/prody/atomic/select.py", line 1103, in _getParser
    parser.enablePackrat()
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/pyparsing/util.py", line 265, in _inner
    return fn(*args, **kwargs)
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/pyparsing/core.py", line 1132, in enable_packrat
    ParserElement.packrat_cache = _FifoCache(cache_size_limit)  # type: ignore[assignment]
  File "/Users/yipy/miniforge3/envs/ad4_covalent_docking/lib/python3.8/site-packages/pyparsing/util.py", line 105, in __init__
    keyring = [object()] * size
TypeError: can't multiply sequence by non-int of type 'Forward'

How could I try to resolve the error? 😁

rwxayheee commented 2 months ago

Hi @yipy0005 I'm not able to reproduce this. Running the same script (the most recent version from here) didn't give any errors.

This might be a pyparsing problem according to this comment

Which pyparsing do you have? I got:

meeko=0.5.0=pypi_0
prody=2.4.1=pypi_0
pyparsing=3.0.9=py312hca03da5_0
rdkit=2023.09.4=py312hab2472d_0

Downgrading pyparsing may be a possible solution? I'm attaching my requirements.txt for further reference requirements.txt

You commented in #101 too. Let us know if this might be able to solve your problem and if you have any further questions :>

yipy0005 commented 2 months ago

@rwxayheee Downgrading pyparsing to 3.0.9 absolutely works, thank you so much for suggesting this solution!