Merge branch 'nathan/strings' into nathan/delint

This commit is contained in:
Nathan Baker
2020-05-29 20:41:53 -07:00
3 changed files with 68 additions and 91 deletions

8
propka/__main__.py Normal file
View File

@@ -0,0 +1,8 @@
"""Allow the PROPKA package to be run as a program.
For example, `python -m propka`
"""
from .run import main
if __name__ == "__main__":
main()

View File

@@ -279,10 +279,10 @@ def build_parser(parser=None):
return parser return parser
def loadOptions(args): def loadOptions(args=None):
"""Load the arguments parser with options. """
Load the arguments parser with options. Note that verbosity is set as soon
NOTE - verbosity is set as soon as this function is invoked. as this function is invoked.
Arguments: Arguments:
args: list of arguments args: list of arguments
@@ -292,11 +292,8 @@ def loadOptions(args):
# loading the parser # loading the parser
parser = build_parser() parser = build_parser()
# parsing and returning options and arguments # parsing and returning options and arguments
if len(args) == 0: options = parser.parse_args(args)
# command line
options = parser.parse_args()
else:
options = parser.parse_args(args)
# adding specified filenames to arguments # adding specified filenames to arguments
options.filenames.append(options.input_pdb) options.filenames.append(options.input_pdb)
# Convert titrate_only string to a list of (chain, resnum) items: # Convert titrate_only string to a list of (chain, resnum) items:

View File

@@ -203,10 +203,9 @@ def get_summary_section(protein, conformation, parameters):
return str_ return str_
def get_folding_profile_section(protein, conformation='AVR', def get_folding_profile_section(
direction="folding", reference="neutral", protein, conformation='AVR', direction="folding", reference="neutral",
window=[0., 14., 1.0], _=False, window=[0., 14., 1.0], _=False, __=None):
__=None):
"""Returns string with the folding profile section of the results. """Returns string with the folding profile section of the results.
Args: Args:
@@ -245,9 +244,9 @@ def get_folding_profile_section(protein, conformation='AVR',
dg_opt)) dg_opt))
if dg_min is None or dg_max is None: if dg_min is None or dg_max is None:
str_ += "Could not determine pH values where the free energy" str_ += "Could not determine pH values where the free energy"
str_ += " is within 80 %% of minimum\n" str_ += " is within 80 % of minimum\n"
else: else:
str_ += "The free energy is within 80 %% of maximum" str_ += "The free energy is within 80 % of maximum"
str_ += " at pH {0:>4.1f} to {1:>4.1f}\n".format(dg_min, dg_max) str_ += " at pH {0:>4.1f} to {1:>4.1f}\n".format(dg_min, dg_max)
if ph_min is None or ph_max is None: if ph_min is None or ph_max is None:
str_ += "Could not determine the pH-range where the free" str_ += "Could not determine the pH-range where the free"
@@ -319,40 +318,26 @@ def get_propka_header():
string string
""" """
today = date.today() today = date.today()
str_ = "propka3.1 {0:>93s}\n".format(today) str_ = "propka3.1 {0!s:>93s}\n".format(today)
str_ += ("---------------------------------------------------------------" str_ += """
"----------------------------------------\n") -------------------------------------------------------------------------------
str_ += ("-- " -- --
" --\n") -- PROPKA: A PROTEIN PKA PREDICTOR --
str_ += ("-- PROPKA: A PROTEIN PKA " -- --
"PREDICTOR --\n") -- VERSION 1.0, 04/25/2004, IOWA CITY --
str_ += ("-- " -- BY HUI LI --
" --\n") -- --
str_ += ("-- VERSION 1.0, 04/25/2004, " -- VERSION 2.0, 11/05/2007, IOWA CITY/COPENHAGEN --
"IOWA CITY --\n") -- BY DELPHINE C. BAS AND DAVID M. ROGERS --
str_ += ("-- BY HUI LI " -- --
" --\n") -- VERSION 3.0, 01/06/2011, COPENHAGEN --
str_ += ("-- " -- BY MATS H.M. OLSSON AND CHRESTEN R. SONDERGARD --
" --\n") -- --
str_ += ("-- VERSION 2.0, 11/05/2007, IOWA " -- VERSION 3.1, 07/01/2011, COPENHAGEN --
"CITY/COPENHAGEN --\n") -- BY CHRESTEN R. SONDERGARD AND MATS H.M. OLSSON --
str_ += ("-- BY DELPHINE C. BAS AND DAVID " -- --
"M. ROGERS --\n") -------------------------------------------------------------------------------
str_ += ("-- " """
" --\n")
str_ += ("-- VERSION 3.0, 01/06/2011, "
"COPENHAGEN --\n")
str_ += ("-- BY MATS H.M. OLSSON AND CHRESTEN "
"R. SONDERGARD --\n")
str_ += ("-- "
" --\n")
str_ += ("-- VERSION 3.1, 07/01/2011, "
"COPENHAGEN --\n")
str_ += ("-- BY CHRESTEN R. SONDERGARD AND "
"MATS H.M. OLSSON --\n")
str_ += ("---------------------------------------------------------------"
"----------------------------------------\n")
str_ += ("\n")
return str_ return str_
@@ -362,39 +347,29 @@ def get_references_header():
Returns: Returns:
string string
""" """
str_ = "" str_ = """
str_ += ("---------------------------------------------------------------" -------------------------------------------------------------------------------
"----------------------------------------\n") References:
str_ += (" References:\n")
str_ += ("\n") Very Fast Empirical Prediction and Rationalization of Protein pKa Values.
str_ += (" Very Fast Empirical Prediction and Rationalization of " Hui Li, Andrew D. Robertson and Jan H. Jensen. PROTEINS: Structure, Function,
"Protein pKa Values\n") and Bioinformatics. 61:704-721 (2005)
str_ += (" Hui Li, Andrew D. Robertson and Jan H. Jensen\n")
str_ += (" PROTEINS: Structure, Function, and Bioinformatics 61:704-721" Very Fast Prediction and Rationalization of pKa Values for Protein-Ligand
" (2005)\n") Complexes. Delphine C. Bas, David M. Rogers and Jan H. Jensen. PROTEINS:
str_ += (" \n") Structure, Function, and Bioinformatics 73:765-783 (2008)
str_ += (" Very Fast Prediction and Rationalization of pKa Values for "
"Protein-Ligand Complexes\n") PROPKA3: Consistent Treatment of Internal and Surface Residues in Empirical
str_ += (" Delphine C. Bas, David M. Rogers and Jan H. Jensen\n") pKa predictions. Mats H.M. Olsson, Chresten R. Sondergard, Michal Rostkowski,
str_ += (" PROTEINS: Structure, Function, and Bioinformatics 73:765-" and Jan H. Jensen. Journal of Chemical Theory and Computation, 7(2):525-537
"783 (2008)\n") (2011)
str_ += (" \n")
str_ += (" PROPKA3: Consistent Treatment of Internal and Surface " Improved Treatment of Ligands and Coupling Effects in Empirical Calculation
"Residues in Empirical pKa predictions\n") and Rationalization of pKa Values. Chresten R. Sondergaard, Mats H.M. Olsson,
str_ += (" Mats H.M. Olsson, Chresten R. Sondergard, Michal Rostkowski, " Michal Rostkowski, and Jan H. Jensen. Journal of Chemical Theory and
"and Jan H. Jensen\n") Computation, (2011)
str_ += (" Journal of Chemical Theory and Computation, 7(2):525-537 " -------------------------------------------------------------------------------
"(2011)\n") """
str_ += (" \n")
str_ += (" Improved Treatment of Ligands and Coupling Effects in "
"Empirical Calculation\n")
str_ += (" and Rationalization of pKa Values\n")
str_ += (" Chresten R. Sondergaard, Mats H.M. Olsson, Michal "
"Rostkowski, and Jan H. Jensen\n")
str_ += (" Journal of Chemical Theory and Computation, (2011)\n")
str_ += (" \n")
str_ += ("--------------------------------------------------------------"
"-----------------------------------------\n")
return str_ return str_
@@ -416,15 +391,12 @@ def get_determinants_header():
Returns: Returns:
string string
""" """
str_ = "" str_ = """
str_ += ("--------- ----- ------ --------------------- " --------- ----- ------ --------------------- -------------- -------------- --------------
"-------------- -------------- --------------\n") DESOLVATION EFFECTS SIDECHAIN BACKBONE COULOMBIC
str_ += (" DESOLVATION EFFECTS " RESIDUE pKa BURIED REGULAR RE HYDROGEN BOND HYDROGEN BOND INTERACTION
"SIDECHAIN BACKBONE COULOMBIC \n") --------- ----- ------ --------- --------- -------------- -------------- --------------
str_ += (" RESIDUE pKa BURIED REGULAR RE " """
"HYDROGEN BOND HYDROGEN BOND INTERACTION \n")
str_ += ("--------- ----- ------ --------- --------- "
"-------------- -------------- --------------\n")
return str_ return str_