def plotPoolPage(Proteins, protPoolDict, medDict10, medDict1000, saveFile=None, figSize=(7,10), yMax=1.0, funcToFit=qMS.maxLabFunc, title=None, double=True, showPools=True): time = numpy.linspace(0, doublingTime_10*2, num=200) k10 = qMS.growthRate(doublingTime_10) k1000 = qMS.growthRate(doublingTime_1000) fig = pylab.figure(figsize=figSize) Large1Ax = [] a = 0 for prot in Proteins: p_10 = protPoolDict[prot]['10'] p_10String = qMS.calcPercent(p_10, sigfig=2).split('.')[0]+'%' if double: p_1000 = protPoolDict[prot]['1000'] p_1000String = qMS.calcPercent(p_1000, sigfig=2).split('.')[0]+'%' ax = fig.add_subplot(5,2,a+1) if showPools: textstr2 = '\n\n'+'10 $\mu$M : P=' + p_10String props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) ax.text(0.025, .95, textstr2, transform=ax.transAxes, fontsize=8, verticalalignment='top', horizontalalignment='left', bbox=props, color='r') if double: textstr1 = '1 mM : P=' + p_1000String ax.text(0.025, .925, textstr1, transform=ax.transAxes, fontsize=8, verticalalignment='top', horizontalalignment='left', color='b') ax.scatter([i[0] for i in medDict10[prot]], [i[1] for i in medDict10[prot]], c = 'r') ax.plot(time, qMS.maxLabFunc(k10, time), c='r') if double: ax.scatter([i[0] for i in medDict1000[prot]], [i[1] for i in medDict1000[prot]], c = 'b') ax.plot(time, qMS.maxLabFunc(k1000, time), c='b') ax.plot(time, funcToFit(k10, time, p_10), c='r', ls='--') if double: ax.plot(time, funcToFit(k1000, time, p_1000), c='b', ls='--') ax.set_xlim([0,doublingTime_10*2]) ax.set_ylim([0,yMax]) ax.set_yticks([0,yMax/4, yMax/2, 3*yMax/4, yMax]) ax.set_xticks([0,doublingTime_10*2/5, doublingTime_10*2*2/5, doublingTime_10*2*3/5, doublingTime_10*2*4/5, doublingTime_10*2]) ax.yaxis.tick_left() ax.xaxis.tick_bottom() ax.text(0.5, 0.95, prot[4:], transform=ax.transAxes, fontsize=12, verticalalignment='top', horizontalalignment='center') Large1Ax.append(ax) a = a+1 fig.text(0.005, 0.1165, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.317, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.505, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.7, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.9, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.25, 0.0025, "time (mins)", fontsize=12, horizontalalignment='center') fig.text(0.75, 0.0025, "time (mins)", fontsize=12, horizontalalignment='center') if not (title is None): fig.text(0.5, 1, title, fontsize=16, horizontalalignment='center', verticalalignment='top') fig.tight_layout() if not (saveFile is None): pylab.savefig(saveFile) return fig
def plotPoolPage(Proteins, protPoolDict, medDict10, medDict1000, fig, name): time = numpy.linspace(0, 140, 200) k10 = qMS.growthRate(92) k1000 = qMS.growthRate(47) Large1Ax = [] a = 0 for prot in Proteins: p_10 = protPoolDict[prot]['10'] p_10String = qMS.calcPercent(p_10, sigfig=2).split('.')[0]+'%' p_1000 = protPoolDict[prot]['1000'] p_1000String = qMS.calcPercent(p_1000, sigfig=2).split('.')[0]+'%' ax = fig.add_subplot(5,2,a+1) textstr1 = '1 mM : P=' + p_1000String textstr2 = '\n\n'+'10 $\mu$M : P=' + p_10String props = dict(boxstyle='round', facecolor='wheat', alpha=0.5) ax.text(0.025, .95, textstr2, transform=ax.transAxes, fontsize=8, verticalalignment='top', horizontalalignment='left', bbox=props, color='r') ax.text(0.025, .925, textstr1, transform=ax.transAxes, fontsize=8, verticalalignment='top', horizontalalignment='left', color='b') ax.scatter([i[0] for i in medDict10[prot]], [i[1] for i in medDict10[prot]], c = 'r') ax.scatter([i[0] for i in medDict1000[prot]], [i[1] for i in medDict1000[prot]], c = 'b') ax.plot(time, qMS.maxLabFunc(k10, time), c='r') ax.plot(time, qMS.maxLabFunc(k1000, time), c='b') ax.plot(time, qMS.poolFunc(k10, time, p_10), c='r', ls='--') ax.plot(time, qMS.poolFunc(k1000, time, p_1000), c='b', ls='--') ax.set_xlim([0,140]) ax.set_ylim([0,1.00]) ax.set_yticks([0,.25,.50,.75,1.00]) #if a < 7: # plt.setp(ax.get_xticklabels(), visible=False) #if a%2==1: # plt.setp(ax.get_yticklabels(), visible=False) ax.set_xticks([0,20,40,60,80,100,120,140]) ax.yaxis.tick_left() ax.xaxis.tick_bottom() ax.text(0.5, 0.95, prot[4:], transform=ax.transAxes, fontsize=12, verticalalignment='top', horizontalalignment='center') Large1Ax.append(ax) a = a+1 fig.text(0.005, 0.1165, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.317, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.505, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.7, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.005, 0.9, "fraction labeled", fontsize=12, rotation='vertical', verticalalignment='center') fig.text(0.25, 0.0025, "time (mins)", fontsize=12, horizontalalignment='center') fig.text(0.75, 0.0025, "time (mins)", fontsize=12, horizontalalignment='center') fig.tight_layout() #pylab.savefig(name) return Large1Ax