From 38aab010dcd96d1dc4c0916286d16455ee3d18d0 Mon Sep 17 00:00:00 2001 From: Danny Diaz Date: Wed, 17 Feb 2021 20:39:29 -0800 Subject: [PATCH] Addressed bug CLI parameters for the -g and -w options did not output to .pka file --- propka/output.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/propka/output.py b/propka/output.py index ff82f60..59cabe6 100644 --- a/propka/output.py +++ b/propka/output.py @@ -11,6 +11,7 @@ Output routines. """ import logging from datetime import date +from decimal import Decimal from . import __version__ @@ -143,7 +144,7 @@ def write_pka(protein, parameters, filename=None, conformation='1A', # printing Folding Profile str_ += get_folding_profile_section( protein, conformation=conformation, reference=reference, - window=[0., 14., 1.0]) + window=protein.options.window) # printing Protein Charge Profile str_ += get_charge_profile_section(protein, conformation=conformation) # now, writing the pka text to file @@ -285,13 +286,16 @@ def get_folding_profile_section( profile, [ph_opt, dg_opt], [dg_min, dg_max], [ph_min, ph_max] = ( protein.get_folding_profile( conformation=conformation, reference=reference, - grid=[0., 14., 0.1])) + grid=protein.options.grid)) + if profile is None: str_ += "Could not determine folding profile\n" else: + delta = Decimal(str(round(window[2],2))) for (ph, dg) in profile: + ph = Decimal(str(round(ph, 3))) if ph >= window[0] and ph <= window[1]: - if ph % window[2] < 0.05 or ph % window[2] > 0.95: + if ph % delta < 0.05 or ph % delta > 0.95: str_ += "{0:>6.2f}{1:>10.2f}\n".format(ph, dg) str_ += "\n" if ph_opt is None or dg_opt is None: @@ -329,7 +333,7 @@ def get_charge_profile_section(protein, conformation='AVR', _=None): """ str_ = "Protein charge of folded and unfolded state as a function of pH\n" profile = protein.get_charge_profile(conformation=conformation, - grid=[0., 14., 1.]) + grid=protein.options.grid) if profile is None: str_ += "Could not determine charge profile\n" else: