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

IndexError: list index out of range #166

Open
locitran opened this issue Sep 5, 2023 · 2 comments
Open

IndexError: list index out of range #166

locitran opened this issue Sep 5, 2023 · 2 comments

Comments

@locitran
Copy link

locitran commented Sep 5, 2023

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

speleo3 commented Sep 17, 2023

Sounds similar to #17 which was fixed in propka 3.4

@speleo3
Copy link
Collaborator

speleo3 commented Dec 19, 2023

#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

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

No branches or pull requests

2 participants