run.single() to run a propka calculation without script
- can pass a single pdffile (or stream(!)) - added options lib.loadOptions() to pass opt string
This commit is contained in:
@@ -107,7 +107,7 @@ def make_combination(combis, interaction):
|
||||
|
||||
|
||||
|
||||
def loadOptions():
|
||||
def loadOptions(*args):
|
||||
"""
|
||||
load the arguments parser with options
|
||||
"""
|
||||
@@ -166,7 +166,11 @@ def loadOptions():
|
||||
|
||||
|
||||
# parsing and returning options and arguments
|
||||
options, args = parser.parse_args()
|
||||
if len(args) == 0:
|
||||
# command line
|
||||
options, args = parser.parse_args()
|
||||
else:
|
||||
options, args = parser.parse_args(list(args))
|
||||
|
||||
# adding specified filenames to arguments
|
||||
if options.filenames:
|
||||
|
||||
@@ -13,3 +13,21 @@ def main():
|
||||
my_molecule = propka.molecular_container.Molecular_container(pdbfile, options)
|
||||
my_molecule.calculate_pka()
|
||||
my_molecule.write_pka()
|
||||
|
||||
def single(pdbfile, optargs=None):
|
||||
"""Run a single PROPKA calculation using *pdbfile* as input.
|
||||
|
||||
Commandline options can be passed as a **list** in *optargs*.
|
||||
|
||||
.. rubric:: Example
|
||||
|
||||
::
|
||||
single("protein.pdb", optargs=["--mutation=N25R/N181D", "-v", "--pH=7.2"])
|
||||
"""
|
||||
optargs = optargs if optargs is not None else []
|
||||
options, ignored_pdbfiles = propka.lib.loadOptions(*optargs)
|
||||
|
||||
my_molecule = propka.molecular_container.Molecular_container(pdbfile, options)
|
||||
my_molecule.calculate_pka()
|
||||
my_molecule.write_pka()
|
||||
return my_molecule
|
||||
|
||||
Reference in New Issue
Block a user