dauparas / LigandMPNN

MIT License
236 stars 47 forks source link

TypeError: can't multiply sequence by non-int of type 'Forward' #11

Closed al979 closed 7 months ago

al979 commented 8 months ago

Thank you for developing this incredibly useful tool!

I run into issues when I install and run the code following the "Running the code" section of the README file. I get the following error message:

Traceback (most recent call last):
  File "/cache/home/al979/Khare/LigandMPNN/run.py", line 801, in <module>
    main(args)
  File "/cache/home/al979/Khare/LigandMPNN/run.py", line 159, in main
    protein_dict, backbone, other_atoms, icodes, _ = parse_PDB(
                                                     ^^^^^^^^^^
  File "/cache/home/al979/Khare/LigandMPNN/data_utils.py", line 780, in parse_PDB
    atoms = atoms.select("occupancy > 0")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/prody/atomic/atomic.py", line 232, in select
    return SELECT.select(self, selstr, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/prody/atomic/select.py", line 895, in select
    indices = self.getIndices(atoms, selstr, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/prody/atomic/select.py", line 953, in getIndices
    torf = self.getBoolArray(atoms, selstr, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/prody/atomic/select.py", line 1004, in getBoolArray
    parser = self._getParser(selstr)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/prody/atomic/select.py", line 1103, in _getParser
    parser.enablePackrat()
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/pyparsing/util.py", line 265, in _inner
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/pyparsing/core.py", line 1132, in enable_packrat
    ParserElement.packrat_cache = _FifoCache(cache_size_limit)  # type: ignore[assignment]
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/al979/.conda/envs/ligand_test/lib/python3.11/site-packages/pyparsing/util.py", line 105, in __init__
    keyring = [object()] * size
              ~~~~~~~~~~~^~~~~~
TypeError: can't multiply sequence by non-int of type 'Forward'

It seems to be that ProDy is not reading in the input PDB file correctly. Does anyone know how to resolve this issue?

al979 commented 8 months ago

I was able to resolve this issue by downgrading to pyparsing 3.1.1 (pip install pyparsing==3.1.1) during the conda environment setup.

zhangjun19thu commented 8 months ago

I solve it! Thank you!

TheLostLambda commented 8 months ago

Thanks @al979 for the fix! It helped me get things working, and I've opened a PR that should freeze the dependency versions in a requirements.txt file so this sort of thing doesn't happen again!