<jupyter_start><jupyter_text>Standards<jupyter_code># r: reagent-only standard; glucose assay reagent + H2O (in lieu of sample)
# H2O: sample-only standard; H2O (in lieu of reagent) + sample
# A: the actual glucose assay reagent + samples; A340 nm signal
r_standard_0704 = 0.007
h2o_standard_0704 = [-0.005, -0.001, -0.001, -0.003, -0.002]
A_standard_0704 = [0.303, 0.161, 0.085, 0.047, 0.026]
r_standard_0705 = 0.004
h2o_standard_0705 = [-0.003, -0.006, -0.005, -0.007, -0.004]
A_standard_0705 = [0.288, 0.162, 0.084, 0.045, 0.024]
r_standard_0706 = 0.005
h2o_standard_0706 = [-0.001, -0.004, -0.003, -0.004, -0.005]
A_standard_0706 = [0.259, 0.161, 0.085, 0.047, 0.024]
r_standard_0709 = 0.008
h2o_standard_0709 = [-0.003, -0.007, 0.004, -0.003, 0.000]
A_standard_0709 = [0.343, 0.174, 0.086, 0.043, 0.026]
# calculate signals minus noise from reagent and noise from sample

deltaA_standard_0704 = [A_standard_0704[x] - h2o_standard_0704[x] - r_standard_0704 for 
                        x in range(len(A_standard_0704))]

deltaA_standard_0705 = [A_standard_0705[x] - h2o_standard_0705[x] - r_standard_0705 for 
                        x in range(len(A_standard_0705))]

deltaA_standard_0706 = [A_standard_0706[x] - h2o_standard_0706[x] - r_standard_0706 for 
                        x in range(len(A_standard_0706))]

deltaA_standard_0709 = [A_standard_0709[x] - h2o_standard_0709[x] - r_standard_0709 for 
                        x in range(len(A_standard_0709))]
# actual glucose concentrations of standards, in mg/ml
standards_real = [1.0, 1.0/2, 1.0/4, 1.0/8, 1.0/16]
# calculating inferred glucose concentrations, in mg/ml, from A340 nm signal
# calculation: A340 * total volume * F (dilution factor) * 0.029 / sample volume * 10 (for nanodrop setting)

standards_calc_0704 = [(x * 0.550 * 1 * 0.029 * 10 / 0.050) for x in deltaA_standard_0704]
standards_calc_0705 = [(x * 0.225 * 1 * 0.029 * 10 / 0.025) for x in deltaA_standard_0705]
standards_calc_0706 = [(x * 0.225 * 1 * 0.029 * 10 / 0.025) for x in deltaA_standard_0706]
standards_calc_0709 = [(x * 0.225 * 1 * 0.029 * 10 / 0.025) for x in deltaA_standard_0709]
sns.set_style('ticks')
sns.set_context('notebook')

f, ax = plt.subplots()
plt.scatter(standards_real, standards_calc_0704, marker = '.', color = blues[8], s = 100)
plt.scatter(standards_real, standards_calc_0705, marker = '.', color = blues[5], s = 100)
plt.scatter(standards_real, standards_calc_0706, marker = '.', color = blues[3], s = 100)
plt.scatter(standards_real, standards_calc_0709, marker = '.', color = blues[1], s = 100)


xplot = np.linspace(0, 1.5, 100)
plt.plot(xplot, xplot, color = 'black', linestyle = '--')

ax.set_xlim(0, 1.2)
ax.set_ylim(0, 1.2)

ax.set_xlabel('Concentration glucose (mg/ml)')
ax.set_ylabel ('Observed concentration (mg/ml)')

sns.despine()
standards_all = standards_calc_0704 + standards_calc_0705 + standards_calc_0706 + standards_calc_0709
standards_real_all = standards_real * 4
# linear fit to data from glucose standards

[m_standard, b_standard, r_standard, p_standard, stderr_standard] = scipy.stats.linregress(standards_all,
                                                                                           standards_real_all)
sns.set_style('ticks')
sns.set_context('notebook')

f, ax = plt.subplots()
plt.scatter(standards_calc_0704, standards_real, marker = '.', color = blues[8], s = 100)
plt.scatter(standards_calc_0705, standards_real, marker = '.', color = blues[5], s = 100)
plt.scatter(standards_calc_0706, standards_real, marker = '.', color = blues[3], s = 100)
plt.scatter(standards_calc_0709, standards_real, marker = '.', color = blues[3], s = 100)

xplot = np.linspace(0, 1.5, 100)
plt.plot(xplot, (xplot*m_standard) + b_standard, color = 'black', linestyle = '--')

ax.set_xlim(0, 1.2)
ax.set_ylim(0, 1.2)

ax.set_xlabel('Observed concentration glucose (mg/ml)')
ax.set_ylabel ('Actual concentration (mg/ml)')

sns.despine()
m_standard<jupyter_output><empty_output><jupyter_text>Data import<jupyter_code>df_qs = pd.read_csv('glucose_uptake_rates.csv', sep = '\t')
# q: glucose depletion rate from media/uptake rate from cells, mg/cell/hr
# q_norm: glucose uptake normalized to doubling time, mg/cell/gen
# q_ng: glucose uptake in ng, ng/cell/hr
# q_norm_ng: glucose uptake in ng, normalized to doubling time, ng/cell/gen
df_qs
strain_palette = {'yLB1': 'black', 'yLB73': blues[5], 'yLB167': blues[5],
                 'yLB145': reds[5], 'yLB181': reds[5], 'yLB194': reds[5],
                 'yLB232' : reds[5]}



sns.set_style('ticks')
sns.set_context('paper', font_scale = 1.5)

f, ax = plt.subplots()

sns.boxplot(x = 'strain', y = 'q_norm_ng', data = df_qs, color = 'white',
            order = ['yLB73', 'yLB167', 'yLB1', 'yLB181', 'yLB145', 'yLB194', 'yLB232'])
sns.swarmplot(x = 'strain', y = 'q_norm_ng', data = df_qs, palette = strain_palette,
              order = ['yLB73', 'yLB167', 'yLB1', 'yLB181', 'yLB145', 'yLB194', 'yLB232'], s = 7)


ax.set_ylim(0, 2.2e-1)

plt.xticks(rotation = 45)
ax.set_xlabel(None)
ax.set_ylabel('Specific consumption \n(ng/cell/gen)') 
ax.set_xticklabels(['petite', 'snf1 $\mathregular{\Delta}$', 'wildtype',
                    'mig1$\mathregular{\Delta}$mig2$\mathregular{\Delta}$', 'hxk2$\mathregular{\Delta}$',
                    'reg1$\mathregular{\Delta}$', 'rgt2$\mathregular{\Delta}$snf3$\mathregular{\Delta}$']);

plt.title('Glucose uptake rate per generation')
sns.despine()

#plt.savefig('glucose_uptake_gen.eps', dpi = 300, transparent = True, bbox_inches = 'tight')
strain_palette = {'yLB1': 'black', 'yLB73': blues[5], 'yLB167': blues[5],
                 'yLB145': reds[5], 'yLB181': reds[5], 'yLB194': reds[5],
                 'yLB232' : reds[5]}



sns.set_style('ticks')
sns.set_context('paper', font_scale = 1.5)

f, ax = plt.subplots()

sns.boxplot(x = 'strain', y = 'q_ng', data = df_qs, color = 'white',
            order = ['yLB73', 'yLB167', 'yLB1', 'yLB181', 'yLB145', 'yLB194', 'yLB232'])
sns.swarmplot(x = 'strain', y = 'q_ng', data = df_qs, palette = strain_palette,
              order = ['yLB73', 'yLB167', 'yLB1', 'yLB181', 'yLB145', 'yLB194', 'yLB232'], s = 7)


ax.set_ylim(0, 1.3e-1)

plt.xticks(rotation = 45)
ax.set_xlabel(None)
ax.set_ylabel('Specific consumption \n(ng/cell/hr)') 
ax.set_xticklabels(['petite', 'snf1 $\mathregular{\Delta}$', 'wildtype',
                    'mig1$\mathregular{\Delta}$mig2$\mathregular{\Delta}$', 'hxk2$\mathregular{\Delta}$',
                    'reg1$\mathregular{\Delta}$', 'rgt2$\mathregular{\Delta}$snf3$\mathregular{\Delta}$']);

plt.title('Glucose uptake rate per hour')
sns.despine()

#plt.savefig('glucose_uptake_hr.eps', dpi = 300, transparent = True, bbox_inches = 'tight')<jupyter_output><empty_output><jupyter_text>t-tests<jupyter_code>strainnos = ['yLB73', 'yLB167', 'yLB181', 'yLB145', 'yLB194', 'yLB232']
strainnames = ['petite', 'snf1', 'mig1mig2', 'hxk2', 'reg1', 'rgt2snf3']

print('P-values, rates normalized by doubling time:')
for s in range(len(strainnos)):
    pp = stats.ttest_ind(df_qs[df_qs['strain'] == 'yLB1']['q_norm_ng'],
               df_qs[df_qs['strain'] == strainnos[s]]['q_norm_ng'])
    print('Wt vs. ' + strainnames[s] + ': p=' + str(round(pp[1], 3)))
strainnos = ['yLB73', 'yLB167', 'yLB181', 'yLB145', 'yLB194', 'yLB232']
strainnames = ['petite', 'snf1', 'mig1mig2', 'hxk2', 'reg1', 'rgt2snf3']

print('P-values, rates per unit time:')
for s in range(len(strainnos)):
    pp = stats.ttest_ind(df_qs[df_qs['strain'] == 'yLB1']['q_ng'],
               df_qs[df_qs['strain'] == strainnos[s]]['q_ng'])
    print('Wt vs. ' + strainnames[s] + ': p=' + str(round(pp[1], 3)))<jupyter_output>P-values, rates per unit time:
Wt vs. petite: p=0.19
Wt vs. snf1: p=0.687
Wt vs. mig1mig2: p=0.013
Wt vs. hxk2: p=0.011
Wt vs. reg1: p=0.007
Wt vs. rgt2snf3: p=0.008
{'fraction_non_alphanumeric': 0.17465402357765247, 'fraction_numerical': 0.10046130189646335, 'mean_word_length': 4.012845215157354, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '320598', 'license': 'MIT', 'n_tokens_mistral': 3744, 'n_tokens_neox': 3124, 'n_words': 648, 'path': 'jupyter-notebook-files/glucose_uptake_rates_all.ipynb', 'repo_name': 'bagitmery/yeast_mitochondria_and_metabolism', 'size': '7804'}