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: can't multiply sequence by non-int of type 'Forward' #11

Closed
al979 opened this issue Mar 14, 2024 · 3 comments · Fixed by #14
Closed

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

al979 opened this issue Mar 14, 2024 · 3 comments · Fixed by #14

Comments

@al979
Copy link

al979 commented Mar 14, 2024

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
Copy link
Author

al979 commented Mar 14, 2024

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
Copy link

I solve it! Thank you!

TheLostLambda added a commit to TheLostLambda/LigandMPNN that referenced this issue Mar 21, 2024
Freezes dependency versions so that future releases of those dependencies
don't leave LigandMPNN in a broken state. Fixes dauparas#11 and dauparas#13
@TheLostLambda
Copy link
Contributor

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!

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

Successfully merging a pull request may close this issue.

3 participants