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

run.single pdbfile argument ignored #82

Closed IAlibay closed 4 years ago

IAlibay commented 4 years ago

Expected

Passing a file and some arguments to run.single should work:

i.e.

import propka.run as pk

mol = pk.single('4LYI.pdb', optargs=['--quiet'])

Actual behaviour

The above worked in 3.1, however moving to 3.2 this leads to a SystemExit caused by agparse.

Causes

From what I can tell, the following are causing this behaviour:

1) single calls loadOptions whose argparse call expects an input_pdb entry.

2) pdbfile is overwritten by the return value of options.filenames.pop(0)

https://github.com/jensengroup/propka/blob/01debbf63dd51a7edac38e18d96b406abd532351/propka/run.py#L59

Possible fix

One quick fix here would be to switch single to have a behaviour similar to what is done in: https://github.com/jensengroup/propka/blob/01debbf63dd51a7edac38e18d96b406abd532351/tests/test_basic_regression.py#L60-L84