In [1]:
import pandas as pd
from scipy.stats import linregress
%pylab inline
!pip install xlwt
Populating the interactive namespace from numpy and matplotlib
Requirement already satisfied: xlwt in /usr/local/lib/python2.7/dist-packages
In [12]:
data = pd.read_excel('lhy1.xlsx', sheetname='series', header=None)
In [3]:
figure(figsize=(12,7))
errorbar(array(range(-24,24*2+12,2)),mean(data.iloc[0:6,:], axis=0), yerr=std(data.iloc[0:6,:], axis=0)/sqrt(2), fmt='s-', lw=2.5, label='LHY')
errorbar(array(range(-24,24*2+12,2)),mean(data.iloc[6:12,:], axis=0), yerr=std(data.iloc[6:12,:], axis=0)/sqrt(2), fmt='o-', lw=2.5, label='CCA1')
errorbar(array(range(-24,24*2+12,2)),mean(data.iloc[12:18,:], axis=0), yerr=std(data.iloc[12:18,:], axis=0)/sqrt(2), fmt='o-', lw=2.5, label='TOC1')
errorbar(array(range(-24,24*2+12,2)),mean(data.iloc[18:24,:], axis=0), yerr=std(data.iloc[18:24,:], axis=0)/sqrt(2), fmt='o-', lw=2.5, label='PRR7')
#errorbar(array(range(-24,24*2+12,2)),mean(data.iloc[24:30,:], axis=0), yerr=std(data.iloc[24:30,:], axis=0)/sqrt(2), fmt='o-', lw=2.5, label='LUX')



yticks(fontsize=16)
#errorbar(range(0,24*3,2),mean(data.iloc[3:6,:], axis=0), yerr=std(data.iloc[3:6,:], axis=0))
#ylim(1e4,5e6)
#yscale('log')
legend(loc='lower right', fontsize=16)
xlabel('Hours in constant light (h)', fontsize=22)
ylabel('cps', fontsize=22)
xticks(range(0,23*3+4,6),fontsize=22)
#savefig('ProteinTimeseries.pdf', format='pdf', dpi=300)
axvspan(-12,0,color='gray')
axvspan(12,24,color='gray', alpha=0.4)
axvspan(12+24,24*2,color='gray', alpha=0.4)
yscale('log')
In [7]:
calibration = pd.read_excel('calibration_long_time_series_.xlsx', header=None)
In [9]:
figure(figsize=(7,5))
xticks(fontsize=16)
yticks(fontsize=16)
errorbar(array([1e2,1e3,1e4,1e5,1e6]),log((mean(calibration)-mean(calibration)[0])[1:]),
         yerr = std(log((mean(calibration)-mean(calibration)[0])[1:]))/sqrt(24),
         fmt='s-', color="black", lw=2)

ylabel('ln(RLU)', fontsize=22)
xlabel('#molecules/cell', fontsize=22)
xscale("log")
#xlim(0,8)
#ylim(0,3)

reg = linregress(log10(array([1e2,1e3,1e4,1e5,1e6])),log((mean(calibration)-mean(calibration)[0])[1:]))
y=reg.slope*log10(array([1e2,1e3,1e4,1e5,1e6]))+reg.intercept
plot(array([1e2,1e3,1e4,1e5,1e6]),y, color="red", lw=2)

tight_layout()
savefig('Calibration_NL.png', format='png', dpi=600)
savefig('Calibration_NL.pdf', format='pdf', dpi=600)
savefig('Calibration_NL.svg', format='svg', dpi=600)
In [10]:
abs_unit = 10**((log(data)-reg.intercept)/reg.slope)
abs_unit.to_excel('protein_abs_units_timeseries.xls')
In [11]:
figure(figsize=(7,5),dpi=600)

genes = ['LHY','CCA1','PRR7','TOC1','LUX','Col-0','empty']
genes_colors = {'CCA1':'crimson','LHY':'gold','PRR7':'indigo','TOC1':'#87CEFA','LUX':'plum','empty':'black','Col-0':'red'}


errorbar(array(range(-24,24*2+12,2))[:6],mean(abs_unit.iloc[0:6,:], axis=0)[:6],color=genes_colors['LHY'],barsabove=True,
         yerr=std(abs_unit.iloc[0:6,:], axis=0)[:6]/sqrt(2), fmt='o--', lw=2, alpha=0.5)
errorbar(array(range(-24,24*2+12,2))[:6],mean(abs_unit.iloc[6:12,:], axis=0)[:6],color=genes_colors['CCA1'], 
         yerr=std(abs_unit.iloc[6:12,:], axis=0)[:6]/sqrt(2), fmt='o--', lw=2, alpha=0.5)
errorbar(array(range(-24,24*2+12,2))[:6],mean(abs_unit.iloc[12:18,:], axis=0)[:6], 
         yerr=std(abs_unit.iloc[12:18,:], axis=0)[:6]/sqrt(2), fmt='o--', lw=2, color=genes_colors['TOC1'], alpha=0.5)
errorbar(array(range(-24,24*2+12,2))[:6],mean(abs_unit.iloc[18:24,:], axis=0)[:6],
         yerr=std(abs_unit.iloc[18:24,:], axis=0)[:6]/sqrt(2), fmt='o--', lw=2, color=genes_colors['PRR7'], alpha=0.5)


errorbar(array(range(-24,24*2+12,2))[6:],mean(abs_unit.iloc[0:6,:], axis=0)[6:],color=genes_colors['LHY'],barsabove=False,
         yerr=std(abs_unit.iloc[0:6,:], axis=0)[6:]/sqrt(2), fmt='o-', lw=3, label='LHY')
errorbar(array(range(-24,24*2+12,2))[6:],mean(abs_unit.iloc[6:12,:], axis=0)[6:], color=genes_colors['CCA1'],
         yerr=std(abs_unit.iloc[6:12,:], axis=0)[6:]/sqrt(2), fmt='o-', lw=3, label='CCA1')
errorbar(array(range(-24,24*2+12,2))[6:],mean(abs_unit.iloc[12:18,:], axis=0)[6:],color=genes_colors['TOC1'], 
         yerr=std(abs_unit.iloc[12:18,:], axis=0)[6:]/sqrt(2), fmt='o-', lw=3, label='TOC1')
errorbar(array(range(-24,24*2+12,2))[6:],mean(abs_unit.iloc[18:24,:], axis=0)[6:],color=genes_colors['PRR7'],
         yerr=std(abs_unit.iloc[18:24,:], axis=0)[6:]/sqrt(2), fmt='o-', lw=3, label='PRR7')
#errorbar(array(range(-24,24*2+12,2)),mean(abs_unit.iloc[24:30,:], axis=0),
#         yerr=std(abs_unit.iloc[24:30,:], axis=0)/sqrt(2), fmt='s-', lw=2.5, label='LUX', color='cyan')


yticks(fontsize=16)
#errorbar(range(0,24*3,2),mean(data.iloc[3:6,:], axis=0), yerr=std(data.iloc[3:6,:], axis=0))
ylim(1e3,1e6)
yscale('log')
legend(loc='lower right', fontsize=12)
xlabel('Time in constant light (h)', fontsize=22)
ylabel('#molecules/cell', fontsize=22)
xticks(range(0,23*3,24),fontsize=22)
#savefig('ProteinTimeseries.pdf', format='pdf', dpi=300)
axvspan(-12,0,color='gray')
axvspan(12,24,color='gray', alpha=0.4)
axvspan(12+24,24*2,color='gray', alpha=0.4)
xlim(-24,24*3-12)
tight_layout()
savefig('lhycca1toc1prr7.svg',format='svg',dpi=600, transparent=True)
savefig('lhycca1toc1prr7.pdf',format='pdf',dpi=600, transparent=True)
savefig('lhycca1toc1prr7.png',format='png',dpi=600, transparent=True)