<jupyter_start><jupyter_text>Model 1a: irreversible Michaelis Menten<jupyter_code>#bias = md.get_initial_bias(data)
vmax = md.get_initial_vmax(time, data)
E = E_conc[0]
kcat = vmax/E
km = md.get_initial_Km(time, data)

w = init_conc # shape(27,1)
print(w.shape)

params = Parameters()
params.add('E', value=E, vary=False)
params.add('kcat', value=kcat, min=0.0001, max=1000)
params.add('Km', value=km, min=0.0001, max=np.max(data)*100)
params.add('Sb', value=0, vary=False)
result_menten = minimize(residual , params, args=(time, data, w, irreversible_Michaelis_Menten), method='leastsq')
report_fit(result_menten)
plt.figure()
ax = plt.subplot()
ax.clear()
for i in range(data.shape[0]):
    data_fitted1a = md.solveODE(irreversible_Michaelis_Menten, time, w[i], result_menten.params)
    ax.plot(time, data[i, :], 'o', ms=3, label='repl '+str(i+1), color=colors[i%num_data])
    if i<num_data:
        ax.plot(time, data_fitted1a[:], '-', linewidth=1, color='#e31a1c', label='fitted data')
plt.title('irreversible Michaelis Menten')
ax.set_xlabel('time')
ax.set_ylabel('concentration')
plt.show()<jupyter_output><empty_output><jupyter_text>Model 1b: irreversible Michaelis Menten with bias<jupyter_code>bias = md.get_initial_bias(data)
vmax = md.get_initial_vmax(time, data)
E = E_conc[0]
kcat = vmax/E
km = md.get_initial_Km(time, data)

w = init_conc # shape(27,1)
print(w.shape)

params = Parameters()
params.add('E', value=E, vary=False)
params.add('kcat', value=kcat, min=0.0001, max=1000)
params.add('Km', value=km, min=0.0001, max=np.max(data)*100)
params.add('Sb', value=0, min=0.0001, max=np.max(data)*0.5)
result_menten_w_bias = minimize(residual , params, args=(time, data, w, irreversible_Michaelis_Menten), method='leastsq')
report_fit(result_menten_w_bias)
plt.figure()
ax = plt.subplot()
for i in range(data.shape[0]):
    data_fitted1b = md.solveODE(irreversible_Michaelis_Menten, time, w[i], result_menten_w_bias.params)
    ax.plot(time, data[i, :], 'o', ms=3, label='repl '+str(i+1), color=colors[i%num_data])
    if i<num_data:
        ax.plot(time, data_fitted1b[:], '-', linewidth=1, color='#e31a1c', label='fitted data')
plt.title('irreversible Michaelis Menten with bias')
ax.set_xlabel('time')
ax.set_ylabel('concentration')
plt.show()<jupyter_output><empty_output><jupyter_text>Model 2a) Menten with enzyme inactivation<jupyter_code>#bias = md.get_initial_bias(data)
vmax = md.get_initial_vmax(time, data)
E = E_conc[0]
kcat = vmax/E
km = md.get_initial_Km(time, data)

w = np.append(init_conc, E_conc).reshape((2,init_conc.shape[0]))
w = np.transpose(w)

params = Parameters()
params.add('k_E', value=0.5, min=0.00000001, max=np.max(data))
params.add('kcat', value=kcat, min=0.0001, max=100)
params.add('Km', value=km, min=0.0001, max=np.max(data)*100)
params.add('Sb', value=0, vary=False)
result_inactivation = minimize(residual , params, args=(time, data, w, meten_with_enzymeinaktivation), method='leastsq')
report_fit(result_inactivation)
plt.figure()
ax = plt.subplot()
for i in range(data.shape[0]):
    data_fitted2a = md.solveODE(meten_with_enzymeinaktivation, time, w[i], result_inactivation.params)
    ax.plot(time, data[i, :], 'o', ms=3, label='repl '+str(i+1), color=colors[i%num_data])
    if i<num_data:
        ax.plot(time, data_fitted2a[:,0], '-', linewidth=1, color='#e31a1c', label='fitted data')
plt.title('<NAME> with enzyme inactivation')
ax.set_xlabel('time')
ax.set_ylabel('concentration')
plt.show()<jupyter_output><empty_output><jupyter_text>Model 2b) Menten with enzymeinactivation and bias<jupyter_code>bias = md.get_initial_bias(data)
vmax = md.get_initial_vmax(time, data)
E = E_conc[0]
kcat = vmax/E
km = md.get_initial_Km(time, data)

w = np.append(init_conc, E_conc).reshape((2,init_conc.shape[0]))
w = np.transpose(w)

params = Parameters()
params.add('k_E', value=0.5, min=0.00000001, max=np.max(data))
params.add('kcat', value=kcat, min=0.0001, max=100)
params.add('Km', value=km, min=0.0001, max=np.max(data)*100)
params.add('Sb', value=0, min=-0.00001, max=np.max(data)*0.5)
result_inactivation_w_bias = minimize(residual , params, args=(time, data, w, meten_with_enzymeinaktivation), method='leastsq')
report_fit(result_inactivation_w_bias)
bias = np.array([result_inactivation_w_bias.params['Sb'].value,0])
w = np.add(w, bias)
plt.figure()
ax = plt.subplot()
for i in range(data.shape[0]):
    data_fitted2b = md.solveODE(meten_with_enzymeinaktivation, time, w[i], result_inactivation_w_bias.params)
    ax.plot(time, data[i, :], 'o', ms=3, label='repl '+str(i+1), color=colors[i%num_data])
    if i<num_data:
        ax.plot(time, data_fitted2b[:,0], '-', linewidth=1, color='#e31a1c', label='fitted data')
plt.title('Michaelis Menten with enzyme inactivation and bias')
ax.set_xlabel('time')
ax.set_ylabel('concentration')
plt.show()<jupyter_output><empty_output><jupyter_text>Model 3a) Menten with substarte dependent enzyme inactivation<jupyter_code>#bias = md.get_initial_bias(data)
vmax = md.get_initial_vmax(time, data)
E = E_conc[0]
kcat = vmax/E
km = md.get_initial_Km(time, data)

w = np.append(init_conc, E_conc).reshape((2,init_conc.shape[0]))
w = np.transpose(w)

params = Parameters()
params.add('k_E', value=0.5, min=0.00000001, max=np.max(data))
params.add('kcat', value=kcat, min=0.0001, max=100)
params.add('Km', value=km, min=0.0001, max=np.max(data)*100)
params.add('Sb', value=0, vary=False)
result_substratdep_inactivation = minimize(residual , params, args=(time, data, w, meten_with_substrat_dependent_enzymeinaktivation), method='leastsq')
report_fit(result_substratdep_inactivation)
plt.figure()
ax = plt.subplot()
for i in range(data.shape[0]):
    data_fitted3a = md.solveODE(meten_with_substrat_dependent_enzymeinaktivation, time, w[i], result_substratdep_inactivation.params)
    ax.plot(time, data[i, :], 'o', ms=3, label='repl '+str(i+1), color=colors[i%num_data])
    if i<num_data:
        ax.plot(time, data_fitted3a[:,0], '-', linewidth=1, color='#e31a1c', label='fitted data')
plt.title('<NAME> with substrat dependent enzyme inactivation')
ax.set_xlabel('time')
ax.set_ylabel('concentration')
plt.show()<jupyter_output><empty_output><jupyter_text>Model 3b: Menten with substarte dependent enzyme inactivation and bias<jupyter_code>bias = md.get_initial_bias(data)
vmax = md.get_initial_vmax(time, data)
E = E_conc[0]
kcat = vmax/E
km = md.get_initial_Km(time, data)

w = np.append(init_conc, E_conc).reshape((2,init_conc.shape[0]))
w = np.transpose(w)

params = Parameters()
params.add('k_E', value=result_substratdep_inactivation.params['k_E'], min=0.00000001, max=np.max(data))
params.add('kcat', value=result_substratdep_inactivation.params['kcat'], min=0.0001, max=100)
params.add('Km', value=result_substratdep_inactivation.params['Km'], min=0.0001, max=np.max(data)*100)
params.add('Sb', value=result_inactivation_w_bias.params['Sb'], min=0.00001, max=np.max(data)*0.5)
result_substratdep_inactivation_w_bias = minimize(residual , params, args=(time, data, w, meten_with_substrat_dependent_enzymeinaktivation), method='leastsq')
report_fit(result_substratdep_inactivation_w_bias)
bias = np.array([result_substratdep_inactivation_w_bias.params['Sb'].value,0])
w = np.add(w, bias)
plt.figure()
ax = plt.subplot()
for i in range(data.shape[0]):
    data_fitted3b = md.solveODE(meten_with_substrat_dependent_enzymeinaktivation, time, w[i], result_substratdep_inactivation_w_bias.params)
    ax.plot(time, data[i, :], 'o', ms=3, label='repl '+str(i+1), color=colors[i%num_data])
    if i<num_data:
        ax.plot(time, data_fitted3b[:,0], '-', linewidth=1, color='#e31a1c', label='fitted data')
plt.title('<NAME> with substrat dependent enzyme inactivation and bias')
ax.set_xlabel('time')
ax.set_ylabel('concentration')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17035512094698918, 'fraction_numerical': 0.03268142048378796, 'mean_word_length': 7.421451787648971, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '267581', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 3344, 'n_tokens_neox': 3090, 'n_words': 513, 'path': 'Sandile_PyEnzyme.ipynb', 'repo_name': 'HannahDi/EnzymeML_KineticModeling', 'size': '7802'}