jensengroup / propka

PROPKA predicts the pKa values of ionizable groups in proteins and protein-ligand complexes based in the 3D structure.
http://propka.org
GNU Lesser General Public License v2.1
256 stars 58 forks source link

IndexError: list index out of range #166

Open Loci-Tran opened 11 months ago

Loci-Tran commented 11 months ago

Hi everyone,

I am using propka version 3.1. I got the issue of "setup_atoms" with simply scripts below.

import propka.lib, propka.molecular_container

command_line_args = [
    '/Users/loctran/Desktop/getFeature/5KZW_A_E521Q.pdb'
]

# Load options using the list of command-line arguments
options, pdbfiles = propka.lib.loadOptions(command_line_args)
my_molecule = propka.molecular_container.Molecular_container(pdbfiles[0][0], options)

The results turns out "IndexError: list index out of range":

Traceback (most recent call last):
  File "/Users/loctran/Desktop/getFeature/test.py", line 17, in <module>
    my_molecule = propka.molecular_container.Molecular_container(pdbfiles[0][0], options)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/loctran/Desktop/getFeature/propka/molecular_container.py", line 55, in __init__
    self.extract_groups()
  File "/Users/loctran/Desktop/getFeature/propka/molecular_container.py", line 110, in extract_groups
    self.conformations[name].extract_groups()
  File "/Users/loctran/Desktop/getFeature/propka/conformation_container.py", line 41, in extract_groups
    self.setup_and_add_group(group)
  File "/Users/loctran/Desktop/getFeature/propka/conformation_container.py", line 146, in setup_and_add_group
    self.init_group(group)
  File "/Users/loctran/Desktop/getFeature/propka/conformation_container.py", line 155, in init_group
    group.setup()
  File "/Users/loctran/Desktop/getFeature/propka/group.py", line 356, in setup
    self.setup_atoms()
  File "/Users/loctran/Desktop/getFeature/propka/group.py", line 739, in setup_atoms
    my_protonator.protonate_atom(the_nitrogen[0])
                                 ~~~~~~~~~~~~^^^
IndexError: list index out of range

Does anyone encountered this problem? Here is my pdb file:
5KZW_A_E521Q.pdb.zip

speleo3 commented 11 months ago

Sounds similar to https://github.com/jensengroup/propka/issues/17 which was fixed in propka 3.4

speleo3 commented 8 months ago

https://github.com/jensengroup/propka/pull/114 turns the error into a warning. However, the underlying issue here is that some coordinates in 5KZW_A_E521Q.pdb are very distorted and I assume propka's distance-based bonding fails. After doing a forcefield minimization of the structure, propka runs without any errors or warnings.

Doing dictionary-based bonding instead of distance-based bonding might improve the situation.

Example picture of distorted W402 in red, and the energy minimized structure in green:

distorted-W402