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
258 stars 58 forks source link

Passing a propka input to propka3 no longer works #99

Closed IAlibay closed 3 years ago

IAlibay commented 3 years ago

Issue details

As part of #98 I am testing the i/o for propka and I noticed that passing propka_input files generated by propka3 can no longer be read. Passing such an input will fail with the following trace:

Traceback (most recent call last):
  File "/home/bioc1523/software/anaconda/install/envs/propka/bin/propka3", line 33, in <module>
    sys.exit(load_entry_point('propka', 'console_scripts', 'propka3')())
  File "/home/bioc1523/github/propka/propka/run.py", line 32, in main
    my_molecule = read_molecule_file(pdbfile, my_molecule)
  File "/home/bioc1523/github/propka/propka/input.py", line 114, in read_molecule_file
    conformations, conformation_names = read_propka(
  File "/home/bioc1523/github/propka/propka/input.py", line 236, in read_propka
    for (name, atom) in lines:
  File "/home/bioc1523/github/propka/propka/input.py", line 269, in get_atom_lines_from_input
    initialize_atom_group(atom)
  File "/home/bioc1523/github/propka/propka/group.py", line 1436, in initialize_atom_group
    group_attr = globals()[atom.group_label]
KeyError: 'Nterm_group'

Reading these files works in 3.1, so this bug got introduced at some point in 3.2-3.3.

Code to reproduce this behaviour

propka3 3SGB-subset.pdb --generate-propka-input
propka3 3SGB-subset.propka_input # fails

Suspected cause

It seems like this bug might have been in part introduced in #40. However, simply changing:

https://github.com/jensengroup/propka/blob/9dfd87a0ebfd4e9e1a12149e9d8e7a621a446fc9/propka/atom.py#L325

to

        self.group_label = "{0:s}Group".format(self.occ)

won't work due to the large re-organisation of atom.py in #49 (one outcome of which is that group_label now defaults to None).

IAlibay commented 3 years ago

Also more of a general question for #98, it isn't clear to me why one would opt for a propka input over a PDB. Is it just a case that it allows you to specify groups without having to rely on propka's guessers?

sobolevnrm commented 3 years ago

I'm not sure why that functionality exists... I'd be in favor of removing that feature rather than fixing it. What do others think? @speleo3 @orbeckst

orbeckst commented 3 years ago

I don't know why the feature exists. I never used it (but I might be missing something here).

Reducing maintenance burden is a good thing so unless some incredibly good reasons for keeping this feature show up, I'd be in favor of removing it.

speleo3 commented 3 years ago

I've never used this feature. No objections for removing it.

IAlibay commented 3 years ago

I can probably deal with this whilst I'm gathering info for #98 (unless someone else is already working on this).

I've not seen any deprecation warnings in 3.1-3.3, is it ok to just go for a purge of the propka input reading/writing code paths without warning?