<commit_before>from graph import ProteinGraph
from uncertainty import resolve_uncertainty
from collections import defaultdict
import math

gas_constant = 8.3144621
#ln(10) * gas constant
kln10 = math.log(10) * gas_constant
# Degrees Kelvin
T = 300
RT = 2479.0;
RT_gas_T = RT * gas_constant * T
kln10_T = kln10 * T

modPkaHIP = 6.6
modPkaHIE = modPkaHIP
modPkaHID = modPkaHIP


def get_titration_curves(protein_complex):
    curves = defaultdict(list)

    pg = ProteinGraph(protein_complex)

    pH = 0.0
    step_size = 0.1
    end_ph = 20.0
    steps = int(end_ph / step_size) + 1

    for step in xrange(steps):
        pH = step * 0.1
        print "Processing pH:", pH
        protein_complex.normalize(pH)
        pg.update_edges()

        cv, s_nodes, t_nodes = pg.get_cut()
        labeling, uncertain = pg.get_labeling_from_cut(s_nodes, t_nodes)
        new_labeling = resolve_uncertainty(protein_complex, labeling, uncertain)

        curve_values = get_curve_values(protein_complex, new_labeling, pH)
        for key, value in curve_values.iteritems():<commit_msg>Add more console output for debugging<commit_after>from graph import ProteinGraph
from uncertainty import resolve_uncertainty
from collections import defaultdict
import math
from pprint import pprint

gas_constant = 8.3144621
#ln(10) * gas constant
kln10 = math.log(10) * gas_constant
# Degrees Kelvin
T = 300
RT = 2479.0;
RT_gas_T = RT * gas_constant * T
kln10_T = kln10 * T

modPkaHIP = 6.6
modPkaHIE = modPkaHIP
modPkaHID = modPkaHIP


def get_titration_curves(protein_complex):
    curves = defaultdict(list)

    pg = ProteinGraph(protein_complex)

    pH = 0.0
    step_size = 0.1
    end_ph = 20.0
    steps = int(end_ph / step_size) + 1

    for step in xrange(steps):
        pH = step * 0.1
        print "pH", pH
        #print "Processing pH:", pH
        protein_complex.normalize(pH)
        pg.update_graph()

        cv, s_nodes, t_nodes = pg.get_cut()
        labeling, uncertain = pg.get_labeling_from_cut(s_nodes, t_nodes)

        print "Uncertain"
        pprint(uncertain)
        new_labeling = resolve_uncertainty(protein_complex, labeling, uncertain, verbose=True)


        pprint(new_labeling)
        print "Min energy", protein_complex.evaluate_energy(new_labeling, True)

        curve_values = get_curve_values(protein_complex, new_labeling, pH)
        for key, value in curve_values.iteritems():
{'fraction_non_alphanumeric': 0.08361064891846921, 'fraction_numerical': 0.03161397670549085, 'mean_word_length': 3.364791288566243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2987487', 'n_tokens_mistral': 907, 'n_tokens_neox': 813, 'n_words': 203}