from matplotlib.pyplot import * from numpy import average,mean from scipy import interpolate from scipy.stats import pearsonr, spearmanr, sem, ks_2samp,wilcoxon,mannwhitneyu import pandas as pd import numpy as np protein_data = pd.read_csv('martin2012_ostreo_diurnal_N15_proteomics.csv') timepoints = protein_data.columns[5:] nC = len(protein_data.columns) for idx in range(4): t0 = timepoints[idx] t1 = timepoints[idx+1] col_name = t1 + '/' + t0 protein_data[col_name] = (protein_data[t1]/protein_data[t0]) ratio_labels = protein_data.columns[nC:nC+4] protein_data['12-0']=protein_data['12'] for idx in range(4): t0 = timepoints[idx] t1 = timepoints[idx+1] col_name = t1 + '-' + t0 protein_data[col_name] = (protein_data[t1]-protein_data[t0])/protein_data[timepoints[-1]] diff_labels = protein_data.columns[nC+4:nC+9] #estimate L/D ratio of protein synthesis, using 36-24 (L) vs 24-12 (D) light_mean = mean(protein_data['36-24'].dropna()) dark_mean = mean(protein_data['24-12'].dropna()) light_sem = sem(protein_data['36-24'].dropna()) dark_sem = sem(protein_data['24-12'].dropna()) out_data = protein_data[['Ot gene Idb','36-24','24-12']] out_data.columns = ['Ot gene Idb','Incorporation in the light','Incorporation in the dark'] out_data.to_csv('Otauri_dark_and_light_protein_synthesis.csv',index=False)