Clean up line breaks in output.py
See https://github.com/jensengroup/propka-3.1/issues/43
This commit is contained in:
152
propka/output.py
152
propka/output.py
@@ -82,8 +82,8 @@ def write_pka(protein, parameters, filename=None, conformation='1A',
|
|||||||
str_ += get_summary_section(protein, conformation, parameters)
|
str_ += get_summary_section(protein, conformation, parameters)
|
||||||
str_ += "%s\n" % get_the_line()
|
str_ += "%s\n" % get_the_line()
|
||||||
# printing Folding Profile
|
# printing Folding Profile
|
||||||
str_ += get_folding_profile_section(protein, conformation=conformation,
|
str_ += get_folding_profile_section(
|
||||||
reference=reference,
|
protein, conformation=conformation, reference=reference,
|
||||||
window=[0., 14., 1.0])
|
window=[0., 14., 1.0])
|
||||||
# printing Protein Charge Profile
|
# printing Protein Charge Profile
|
||||||
str_ += get_charge_profile_section(protein, conformation=conformation)
|
str_ += get_charge_profile_section(protein, conformation=conformation)
|
||||||
@@ -116,8 +116,9 @@ def print_tm_profile(protein, reference="neutral", window=[0., 14., 1.],
|
|||||||
else:
|
else:
|
||||||
str_ = " suggested Tm-profile for %s\n" % (protein.name)
|
str_ = " suggested Tm-profile for %s\n" % (protein.name)
|
||||||
for (ph, tm_) in profile:
|
for (ph, tm_) in profile:
|
||||||
if ph >= window[0] and ph <= window[1] and (ph%window[2] < 0.01 \
|
if (ph >= window[0] and ph <= window[1]
|
||||||
or ph%window[2] > 0.99*window[2]):
|
and (ph%window[2] < 0.01
|
||||||
|
or ph%window[2] > 0.99*window[2])):
|
||||||
str_ += "%6.2lf%10.2lf\n" % (ph, tm_)
|
str_ += "%6.2lf%10.2lf\n" % (ph, tm_)
|
||||||
info(str_)
|
info(str_)
|
||||||
|
|
||||||
@@ -163,15 +164,16 @@ def get_determinant_section(protein, conformation, parameters):
|
|||||||
# printing determinants
|
# printing determinants
|
||||||
for chain in protein.conformations[conformation].chains:
|
for chain in protein.conformations[conformation].chains:
|
||||||
for residue_type in parameters.write_out_order:
|
for residue_type in parameters.write_out_order:
|
||||||
groups = [g for g in protein.conformations[conformation].groups \
|
groups = [
|
||||||
|
g for g in protein.conformations[conformation].groups
|
||||||
if g.atom.chain_id == chain]
|
if g.atom.chain_id == chain]
|
||||||
for group in groups:
|
for group in groups:
|
||||||
if group.residue_type == residue_type:
|
if group.residue_type == residue_type:
|
||||||
str_ += "%s" \
|
str_ += "%s" % group.get_determinant_string(
|
||||||
% group.get_determinant_string(parameters.remove_penalised_group)
|
parameters.remove_penalised_group)
|
||||||
# Add a warning in case of coupled residues
|
# Add a warning in case of coupled residues
|
||||||
if protein.conformations[conformation].non_covalently_coupled_groups \
|
if (protein.conformations[conformation].non_covalently_coupled_groups
|
||||||
and not protein.options.display_coupled_residues:
|
and not protein.options.display_coupled_residues):
|
||||||
str_ += 'Coupled residues (marked *) were detected.'
|
str_ += 'Coupled residues (marked *) were detected.'
|
||||||
str_ += 'Please rerun PropKa with the --display-coupled-residues \n'
|
str_ += 'Please rerun PropKa with the --display-coupled-residues \n'
|
||||||
str_ += 'or -d option for detailed information.\n'
|
str_ += 'or -d option for detailed information.\n'
|
||||||
@@ -193,8 +195,8 @@ def get_summary_section(protein, conformation, parameters):
|
|||||||
for residue_type in parameters.write_out_order:
|
for residue_type in parameters.write_out_order:
|
||||||
for group in protein.conformations[conformation].groups:
|
for group in protein.conformations[conformation].groups:
|
||||||
if group.residue_type == residue_type:
|
if group.residue_type == residue_type:
|
||||||
str_ += "%s" \
|
str_ += "%s" % group.get_summary_string(
|
||||||
% group.get_summary_string(parameters.remove_penalised_group)
|
parameters.remove_penalised_group)
|
||||||
return str_
|
return str_
|
||||||
|
|
||||||
|
|
||||||
@@ -219,9 +221,10 @@ def get_folding_profile_section(protein, conformation='AVR',
|
|||||||
str_ += "\n"
|
str_ += "\n"
|
||||||
str_ += "Free energy of %9s (kcal/mol) as a function" % direction
|
str_ += "Free energy of %9s (kcal/mol) as a function" % direction
|
||||||
str_ += " of pH (using %s reference)\n" % reference
|
str_ += " of pH (using %s reference)\n" % reference
|
||||||
profile, [ph_opt, dg_opt], [dg_min, dg_max], [ph_min, ph_max] \
|
profile, [ph_opt, dg_opt], [dg_min, dg_max], [ph_min, ph_max] = (
|
||||||
= protein.get_folding_profile(conformation=conformation,
|
protein.get_folding_profile(
|
||||||
reference=reference, grid=[0., 14., 0.1])
|
conformation=conformation, reference=reference,
|
||||||
|
grid=[0., 14., 0.1]))
|
||||||
if profile is None:
|
if profile is None:
|
||||||
str_ += "Could not determine folding profile\n"
|
str_ += "Could not determine folding profile\n"
|
||||||
else:
|
else:
|
||||||
@@ -234,7 +237,8 @@ def get_folding_profile_section(protein, conformation='AVR',
|
|||||||
str_ += "Could not determine pH optimum\n"
|
str_ += "Could not determine pH optimum\n"
|
||||||
else:
|
else:
|
||||||
str_ += "The pH of optimum stability is %4.1lf" % ph_opt
|
str_ += "The pH of optimum stability is %4.1lf" % ph_opt
|
||||||
str_ += " for which the free energy is %6.1lf kcal/mol at 298K\n" % dg_opt
|
str_ += (" for which the free energy is %6.1lf kcal/mol at 298K\n"
|
||||||
|
% 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 %s of minimum\n" % ("%")
|
str_ += " is within 80 %s of minimum\n" % ("%")
|
||||||
@@ -273,8 +277,7 @@ def get_charge_profile_section(protein, conformation='AVR', _=None):
|
|||||||
if pi_pro is None or pi_mod is None:
|
if pi_pro is None or pi_mod is None:
|
||||||
str_ += "Could not determine the pI\n\n"
|
str_ += "Could not determine the pI\n\n"
|
||||||
else:
|
else:
|
||||||
str_ += "The pI is %5.2lf (folded) and %5.2lf (unfolded)\n" % (pi_pro,
|
str_ += ("The pI is %5.2lf (folded) and %5.2lf (unfolded)\n")
|
||||||
pi_mod)
|
|
||||||
return str_
|
return str_
|
||||||
|
|
||||||
|
|
||||||
@@ -311,23 +314,39 @@ def get_propka_header():
|
|||||||
"""
|
"""
|
||||||
today = date.today()
|
today = date.today()
|
||||||
str_ = "propka3.1 %93s\n" % (today)
|
str_ = "propka3.1 %93s\n" % (today)
|
||||||
str_ += "-------------------------------------------------------------------------------------------------------\n"
|
str_ += ("---------------------------------------------------------------"
|
||||||
str_ += "-- --\n"
|
"----------------------------------------\n")
|
||||||
str_ += "-- PROPKA: A PROTEIN PKA PREDICTOR --\n"
|
str_ += ("-- "
|
||||||
str_ += "-- --\n"
|
" --\n")
|
||||||
str_ += "-- VERSION 1.0, 04/25/2004, IOWA CITY --\n"
|
str_ += ("-- PROPKA: A PROTEIN PKA "
|
||||||
str_ += "-- BY HUI LI --\n"
|
"PREDICTOR --\n")
|
||||||
str_ += "-- --\n"
|
str_ += ("-- "
|
||||||
str_ += "-- VERSION 2.0, 11/05/2007, IOWA CITY/COPENHAGEN --\n"
|
" --\n")
|
||||||
str_ += "-- BY DELPHINE C. BAS AND DAVID M. ROGERS --\n"
|
str_ += ("-- VERSION 1.0, 04/25/2004, "
|
||||||
str_ += "-- --\n"
|
"IOWA CITY --\n")
|
||||||
str_ += "-- VERSION 3.0, 01/06/2011, COPENHAGEN --\n"
|
str_ += ("-- BY HUI LI "
|
||||||
str_ += "-- BY MATS H.M. OLSSON AND CHRESTEN R. SONDERGARD --\n"
|
" --\n")
|
||||||
str_ += "-- --\n"
|
str_ += ("-- "
|
||||||
str_ += "-- VERSION 3.1, 07/01/2011, COPENHAGEN --\n"
|
" --\n")
|
||||||
str_ += "-- BY CHRESTEN R. SONDERGARD AND MATS H.M. OLSSON --\n"
|
str_ += ("-- VERSION 2.0, 11/05/2007, IOWA "
|
||||||
str_ += "-------------------------------------------------------------------------------------------------------\n"
|
"CITY/COPENHAGEN --\n")
|
||||||
str_ += "\n"
|
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_
|
||||||
|
|
||||||
|
|
||||||
@@ -338,27 +357,38 @@ def get_references_header():
|
|||||||
string
|
string
|
||||||
"""
|
"""
|
||||||
str_ = ""
|
str_ = ""
|
||||||
str_ += "-------------------------------------------------------------------------------------------------------\n"
|
str_ += ("---------------------------------------------------------------"
|
||||||
str_ += " References:\n"
|
"----------------------------------------\n")
|
||||||
str_ += "\n"
|
str_ += (" References:\n")
|
||||||
str_ += " Very Fast Empirical Prediction and Rationalization of Protein pKa Values\n"
|
str_ += ("\n")
|
||||||
str_ += " Hui Li, Andrew D. Robertson and Jan H. Jensen\n"
|
str_ += (" Very Fast Empirical Prediction and Rationalization of "
|
||||||
str_ += " PROTEINS: Structure, Function, and Bioinformatics 61:704-721 (2005)\n"
|
"Protein pKa Values\n")
|
||||||
str_ += " \n"
|
str_ += (" Hui Li, Andrew D. Robertson and Jan H. Jensen\n")
|
||||||
str_ += " Very Fast Prediction and Rationalization of pKa Values for Protein-Ligand Complexes\n"
|
str_ += (" PROTEINS: Structure, Function, and Bioinformatics 61:704-721"
|
||||||
str_ += " Delphine C. Bas, David M. Rogers and Jan H. Jensen\n"
|
" (2005)\n")
|
||||||
str_ += " PROTEINS: Structure, Function, and Bioinformatics 73:765-783 (2008)\n"
|
str_ += (" \n")
|
||||||
str_ += " \n"
|
str_ += (" Very Fast Prediction and Rationalization of pKa Values for "
|
||||||
str_ += " PROPKA3: Consistent Treatment of Internal and Surface Residues in Empirical pKa predictions\n"
|
"Protein-Ligand Complexes\n")
|
||||||
str_ += " Mats H.M. Olsson, Chresten R. Sondergard, Michal Rostkowski, and Jan H. Jensen\n"
|
str_ += (" Delphine C. Bas, David M. Rogers and Jan H. Jensen\n")
|
||||||
str_ += " Journal of Chemical Theory and Computation, 7(2):525-537 (2011)\n"
|
str_ += (" PROTEINS: Structure, Function, and Bioinformatics 73:765-"
|
||||||
str_ += " \n"
|
"783 (2008)\n")
|
||||||
str_ += " Improved Treatment of Ligands and Coupling Effects in Empirical Calculation\n"
|
str_ += (" \n")
|
||||||
str_ += " and Rationalization of pKa Values\n"
|
str_ += (" PROPKA3: Consistent Treatment of Internal and Surface "
|
||||||
str_ += " Chresten R. Sondergaard, Mats H.M. Olsson, Michal Rostkowski, and Jan H. Jensen\n"
|
"Residues in Empirical pKa predictions\n")
|
||||||
str_ += " Journal of Chemical Theory and Computation, (2011)\n"
|
str_ += (" Mats H.M. Olsson, Chresten R. Sondergard, Michal Rostkowski, "
|
||||||
str_ += " \n"
|
"and Jan H. Jensen\n")
|
||||||
str_ += "-------------------------------------------------------------------------------------------------------\n"
|
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_
|
||||||
|
|
||||||
|
|
||||||
@@ -381,10 +411,14 @@ def get_determinants_header():
|
|||||||
string
|
string
|
||||||
"""
|
"""
|
||||||
str_ = ""
|
str_ = ""
|
||||||
str_ += "--------- ----- ------ --------------------- -------------- -------------- --------------\n"
|
str_ += ("--------- ----- ------ --------------------- "
|
||||||
str_ += " DESOLVATION EFFECTS SIDECHAIN BACKBONE COULOMBIC \n"
|
"-------------- -------------- --------------\n")
|
||||||
str_ += " RESIDUE pKa BURIED REGULAR RE HYDROGEN BOND HYDROGEN BOND INTERACTION \n"
|
str_ += (" DESOLVATION EFFECTS "
|
||||||
str_ += "--------- ----- ------ --------- --------- -------------- -------------- --------------\n"
|
"SIDECHAIN BACKBONE COULOMBIC \n")
|
||||||
|
str_ += (" RESIDUE pKa BURIED REGULAR RE "
|
||||||
|
"HYDROGEN BOND HYDROGEN BOND INTERACTION \n")
|
||||||
|
str_ += ("--------- ----- ------ --------- --------- "
|
||||||
|
"-------------- -------------- --------------\n")
|
||||||
return str_
|
return str_
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user