Getting error message while dealing with pdb_selchain.py

Hi,
So I was following doing the tutorial for docking the multi-chain complexes. I followed all the steps in the tutorial. However, when I use the pdb_selchain.py command I get the following error message:
traceback (most recent call last):
File “/home/archi/temp/pdb-tools/pdbtools/pdb_selchain.py”, line 157, in
main()
File “/home/archi/temp/pdb-tools/pdbtools/pdb_selchain.py”, line 136, in main
for lineno, line in enumerate(new_pdb):
File “/home/archi/temp/pdb-tools/pdbtools/pdb_selchain.py”, line 121, in select_chain
if line[21] not in chain_set:
IndexError: string index out of range

Could you please suggest how to deal with this problem?

Thank you

Could be a python version problem.

You could try instead to use our new PDB-tools web server:

https://wenmr.science.uu.nl/pdbtools

Or install locally our PDB-tools from:

http://www.bonvinlab.org/pdb-tools/

Hi,

Thank you for the response. I’ll try to use the PDB-tools web server for the protein preparation.

Also I’m not sure if it is due to a Python version problem as the other python files of pdb-tools are working properly.

1 Like

Hello,
@archi do you happen to know what version of python you are using? I’m getting the exact same error using python 3.6.13.

Hello Dr. Bonvin,
I encountered the same error as archi posted above. I then used pip install --upgrade pdb-tools to ensure that my pdb-tools were up to date. I also checked my python version (3.6.13) which I believe is appropriate for using the pdb tools. Do you have any ideas on how I could resolve this error?

Could you guys share the pdb files that you encounter the reported problem? This error is not due to the version of python or the version of the tool that you guys have, but due to the errors (some are not really errors, but incompatible with the format that pdb_selchain.py looks for) in pdb format. e.g. if you end one chain with TER but without filling the rest of the line you will get the above error.

Hi, could you use pdb_validate in your PDB files to see which errors are reported? as @HAKpdb said, this is almost surely an error with the PDB itself. Let us know, thanks.