De-lint run.py.

This commit is contained in:
Nathan Baker
2020-05-25 13:10:55 -07:00
parent cd0e9e5c3d
commit 2321a4df8a

View File

@@ -1,24 +1,24 @@
# entry point for propka script """Entry point for PROPKA script."""
import logging import logging
import propka.lib, propka.molecular_container from propka.lib import loadOptions
from propka.molecular_container import Molecular_container
_LOGGER = logging.getLogger("PROPKA") _LOGGER = logging.getLogger("PROPKA")
def main(): def main(optargs=None):
""" """Read in structure files, calculate pKa values, and print pKa files."""
Reads in structure files, calculates pKa values, and prints pKa files # loading options, flags and arguments
""" optargs = optargs if optargs is not None else []
# loading options, flaggs and arguments options = loadOptions(*optargs)
options = propka.lib.loadOptions()
pdbfiles = options.filenames pdbfiles = options.filenames
for pdbfile in pdbfiles: for pdbfile in pdbfiles:
my_molecule = propka.molecular_container.Molecular_container(pdbfile, options) my_molecule = Molecular_container(pdbfile, options)
my_molecule.calculate_pka() my_molecule.calculate_pka()
my_molecule.write_pka() my_molecule.write_pka()
def single(pdbfile, optargs=None): def single(pdbfile, optargs=None):
"""Run a single PROPKA calculation using *pdbfile* as input. """Run a single PROPKA calculation using *pdbfile* as input.
@@ -30,12 +30,11 @@ def single(pdbfile, optargs=None):
single("protein.pdb", optargs=["--mutation=N25R/N181D", "-v", "--pH=7.2"]) single("protein.pdb", optargs=["--mutation=N25R/N181D", "-v", "--pH=7.2"])
""" """
optargs = optargs if optargs is not None else [] optargs = optargs if optargs is not None else []
options = propka.lib.loadOptions(*optargs) options = loadOptions(*optargs)
pdbfile = options.filenames.pop(0) pdbfile = options.filenames.pop(0)
if len(options.filenames) > 0: if len(options.filenames) > 0:
_LOGGER.warning("Ignoring filenames: %s", options.filenames) _LOGGER.warning("Ignoring filenames: %s", options.filenames)
my_molecule = Molecular_container(pdbfile, options)
my_molecule = propka.molecular_container.Molecular_container(pdbfile, options)
my_molecule.calculate_pka() my_molecule.calculate_pka()
my_molecule.write_pka() my_molecule.write_pka()
return my_molecule return my_molecule