def asymptotic_plot(figure): results = data.load_data('results/asymptotic_adppi_v_pi.dat') pis, fractions = results[0], results[1:] with contexts.subplot(figure, (2, 2, 2), title='C', x_label=r'Pi Concentration [$\mu$M]', y_label=r'Asymptotic Fraction [F-ADP-Pi-actin]', logscale_x=True) as axes: # for frac in fractions: # contexts.plot(axes, 'plot', pis, frac) contexts.plot(axes, 'plot', pis, fractions[0], 'b') axes.set_ylim(0, 1) axes.axhline(0.5, 0, 1, linestyle='-', linewidth=0.5, color='k') axes.axvline(HALF_CONCENTRATION, 0, 0.5, linestyle=':', linewidth=0.5, color='k') axes.annotate(r'$c^*$', xy=(HALF_CONCENTRATION, 0.001), xytext=(HALF_CONCENTRATION + 2000, 0.15), arrowprops={'facecolor': 'black', 'arrowstyle': '->'}, size=settings.SMALL_FONT_SIZE) axes.text(4000, 0.8, r'$\rho_d =\,1$', horizontalalignment='right', # verticalalignment='bottom', size=settings.SMALL_FONT_SIZE)
def copoly_timecourse_plot(figure, xmax=1000, ymax=35): timecourses = data.load_data('results/copoly_timecourse.dat') with contexts.subplot(figure, (2, 1, 1), title='A', x_label='Time [s]', y_label=r'Concentrations [$\mu$M]') as axes: # factin contexts.plot(axes, 'plot', timecourses[0], timecourses[1], 'b-.') # pi contexts.plot(axes, 'plot', timecourses[0], timecourses[3], 'g-') axes.set_xlim(0, xmax) axes.set_ylim(0, ymax) # Lines to highlight halftime axes.axhline(15, 0, 1, linestyle='-', linewidth=0.5, color='k') axes.axvline(TIMECOURSE_HALFTIME, 0, 15.0 / 35, linestyle=':', linewidth=0.5, color='k') # Halftime label with arrow # axes.annotate('halftime', xy=(TIMECOURSE_HALFTIME, 0.05), axes.annotate(r'$t_{\frac{1}{2}}$', xy=(TIMECOURSE_HALFTIME, 0.05), xytext=(TIMECOURSE_HALFTIME + 200, 5), arrowprops={'facecolor': 'black', 'arrowstyle': '->'}, size=settings.SMALL_FONT_SIZE) # Curve labels axes.text(0.5 * xmax, 30.5, '[F-actin]', horizontalalignment='center', verticalalignment='bottom', size=settings.SMALL_FONT_SIZE) axes.text(600, 20.5, '[Pi]', horizontalalignment='right', verticalalignment='bottom', size=settings.SMALL_FONT_SIZE)
def copoly_adp_only(figure): adp_halftimes = data.load_data('results/adp_copoly_halftimes.dat') adp_v_halftimes = data.load_data( 'results/adp_copoly_halftimes_vectorial.dat') fractions, halftimes = adp_halftimes[0], adp_halftimes[1:] v_fractions, v_halftimes = adp_v_halftimes[0], adp_v_halftimes[1] with contexts.subplot( figure, (1, 1, 1), #title='B', y_label=r'[Pi] Halftime [s]', x_label=r'% ADP-actin') as axes: for ht, lt, in zip(halftimes, LINETYPES): # contexts.plot(axes, 'plot', fractions, numpy.array(ht)/ht[0], lt) contexts.plot(axes, 'plot', fractions, numpy.array(ht), lt) # contexts.plot(axes, 'plot', v_fractions, numpy.array(v_halftimes)/v_halftimes[0], 'k-') contexts.plot(axes, 'plot', v_fractions, numpy.array(v_halftimes), 'k-') new_x_tick_labels = [0, 5, 10, 15, 20] axes.set_xticks([0, 0.05, 0.1, 0.15, 0.2]) axes.set_xticklabels(new_x_tick_labels)
def melki_rate_error_plot(figure): # results = data.load_data('results/melki_rate_sensitivities.dat') results = data.load_data("results/melki_cooperative_fit.dat") cooperativities, rates, min_rates, max_rates = results[:4] theoretical_rates = 1.0 / (HALFTIME * numpy.sqrt(cooperativities)) errors = numpy.array(numpy.array(rates) - numpy.array(min_rates)) / theoretical_rates rates = numpy.array(rates) / theoretical_rates # with contexts.basic_figure('plots/melki_rate_errors.pdf', with contexts.subplot( figure, (2, 1, 2), title="B", x_label=r"Pi Dissociation Cooperativity, $\rho_d$", y_label=r"$r_d$ [Simulation / Theory]", logscale_x=True, # logscale_y=True ) as axes: axes.axvline(RHO_CRIT, 0, 1, linestyle="--", color="g", linewidth=0.5) contexts.plot(axes, "errorbar", cooperativities, rates, errors, fmt="k.") contexts.plot(axes, "plot", cooperativities, [1 for c in cooperativities], "r-", linewidth=0.5) axes.set_xlim([0.1, 10 ** 12]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000]) axes.set_ylim([0, 1.2])
def melki_rate_error_plot(figure): # results = data.load_data('results/melki_rate_sensitivities.dat') results = data.load_data('results/melki_cooperative_fit.dat') cooperativities, rates, min_rates, max_rates = results[:4] theoretical_rates = 1.0 / (HALFTIME * numpy.sqrt(cooperativities)) errors = numpy.array(numpy.array(rates) - numpy.array(min_rates)) / theoretical_rates rates = numpy.array(rates) / theoretical_rates # with contexts.basic_figure('plots/melki_rate_errors.pdf', with contexts.subplot(figure, (2, 1, 2), title='B', x_label=r'Pi Dissociation Cooperativity, $\rho_d$', y_label=r'$r_d$ [Simulation / Theory]', logscale_x=True, # logscale_y=True ) as axes: axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.5) contexts.plot(axes, 'errorbar', cooperativities, rates, errors, fmt='k.') contexts.plot(axes, 'plot', cooperativities, [1 for c in cooperativities], 'r-', linewidth=0.5) axes.set_xlim([0.1, 10**12]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000]) axes.set_ylim([0, 1.2])
def tip_filaments(): random_results = data.load_data('results/depolymerization_timecourses.dat') expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') rtimes, rvalues = numpy.array(random_results[0]), random_results[1:] etimes, evals = numpy.array(expt[0]), expt[1] rtimes -= 300 # with contexts.basic_figure('plots/depoly_tip_filaments.pdf', with contexts.subplot(figure, (2, 2, 3), title='A', x_label='Time [s]', y_label=r'Filament Length [$\mu$m]') as axes: for y in rvalues: y = numpy.array(y) y *= 0.0027 contexts.plot(axes, 'plot', rtimes, y, '-', color='#FFA0A0', linewidth=THIN_LINE) contexts.plot(axes, 'plot', etimes, evals, 'k', linewidth=0.7) axes.set_ylim(0, 15) axes.set_xlim(0, 1000)
def melki_rate_fit_quality(figure): results = data.load_data('results/melki_cooperative_fit.dat') (cooperativities, rates, min_rates, max_rates, rate_pe, chi2, min_chi2, max_chi2, chi2_pe) = results v_results = data.load_data('results/melki_vectorial_fit.dat') (v_rate, junk, junk, junk, v_chi2, v_min_chi2, v_max_chi2, junk) = zip(*v_results)[0] with contexts.subplot(figure, (2, 1, 2), title='B', x_label=r'$\rho_d$', y_label=r'$\chi^2$ Comparison To Data', logscale_x=True) as axes: axes.fill_between([0.1, 1.0e12], [v_min_chi2, v_min_chi2], v_max_chi2, color='#CCCCFF') axes.axhline(v_chi2, 0, 1, linestyle=':', color='b') axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.5) contexts.plot(axes, 'errorbar', cooperativities, chi2, [c - m for c, m in zip(chi2, min_chi2)], fmt='k.') axes.set_xlim([0.1, 10**12]) axes.set_ylim([0, 14]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000])
def cooperativity_plot(figure): x, y = data.load_data('results/rho_v_pi.dat') with contexts.subplot(figure, (2, 2, 4), title='D', # x_label=r'Asymptotic Fraction [F-ADP-Pi-actin]', x_label=r'[Pi]$_{\frac{1}{2}}$ [$\mu$M]', y_label=r'Pi Dissociation Cooperativity, $\rho_d$', logscale_x=True, logscale_y=True) as axes: contexts.plot(axes, 'plot', x, y, 'k')
def copoly_halftime_plot(filename): adp_halftimes = data.load_data('results/adp_copoly_halftimes.dat') nh_halftimes = data.load_data('results/nh_copoly_halftimes.dat') adp_v_halftimes = data.load_data('results/adp_copoly_halftimes_vectorial.dat') nh_v_halftimes = data.load_data('results/nh_copoly_halftimes_vectorial.dat') fractions, combined_data = _combine_data(adp_halftimes, nh_halftimes) vfractions, vcombined_data = _combine_data(adp_v_halftimes, nh_v_halftimes) with contexts.basic_figure(filename, y_label=r'Halftime [s]', logscale_y=True) as axes: for local_data, lt, in zip(combined_data, LINETYPES): contexts.plot(axes, 'plot', fractions, local_data, lt) for vld in vcombined_data: contexts.plot(axes, 'plot', vfractions, vld, 'k-') # new_x_tick_labels = [10, 5, 0, 5, 10] # # axes.set_xticks([-10, -5, 0, 5, 10]) new_x_tick_labels = [50, 40, 30, 20, 10, 0, 10] axes.set_xticks([-50, -40, -30, -20, -10, 0, 10]) axes.set_xticklabels(new_x_tick_labels) axes.set_ylim(10, 10**5) axes.text(X_LABEL_PADDING, X_LABEL_MARGIN, 'ADP-actin [%]', verticalalignment='top', horizontalalignment='left', transform=axes.transAxes) axes.text(1 - X_LABEL_PADDING, X_LABEL_MARGIN, 'NH-actin [%]', verticalalignment='top', horizontalalignment='right', transform=axes.transAxes) # \rho_d arrows axes.annotate(INCREASING_RHO_TEXT, xy=(-HT_ARROW_X_OFFSET, TIMECOURSE_HALFTIME), xytext=(-HT_ARROW_X_OFFSET, 6e3), arrowprops={'facecolor': 'black', 'arrowstyle': '->'}, horizontalalignment='center', verticalalignment='top', size=settings.SMALL_FONT_SIZE) axes.annotate(INCREASING_RHO_TEXT, xy=(HT_ARROW_X_OFFSET, TIMECOURSE_HALFTIME), xytext=(HT_ARROW_X_OFFSET, 17), arrowprops={'facecolor': 'black', 'arrowstyle': '->'}, horizontalalignment='center', verticalalignment='bottom', size=settings.SMALL_FONT_SIZE) axes.axvline(0, 0, 1, linestyle=':', linewidth=0.5, color='k')
def cooperativity_plot(figure): x, y = data.load_data('results/rho_v_pi.dat') with contexts.subplot( figure, (2, 2, 4), title='D', # x_label=r'Asymptotic Fraction [F-ADP-Pi-actin]', x_label=r'[Pi]$_{\frac{1}{2}}$ [$\mu$M]', y_label=r'Pi Dissociation Cooperativity, $\rho_d$', logscale_x=True, logscale_y=True) as axes: contexts.plot(axes, 'plot', x, y, 'k')
def halftime_plot(figure, data_filename='results/halftime_v_rho.dat'): results = data.load_data(data_filename) pis, halftimes = results[0], results[1:] pis = numpy.array(pis) / 1000.0 # with contexts.subplot(figure, (2, 2, 3), title='B', with contexts.subplot(figure, (1, 1, 1), #title='B', x_label=r'Pi Concentration [mM]', y_label=r'[Pi] Halftime [s]', logscale_x=True, logscale_y=False) as axes: for ht in halftimes: contexts.plot(axes, 'plot', pis, ht) axes.set_xlim(0, 1000) axes.set_ylim(0, 3000)
def copoly_timecourse_plot(figure, xmax=1000, ymax=35): timecourses = data.load_data('results/copoly_timecourse.dat') with contexts.subplot(figure, (2, 1, 1), title='A', x_label='Time [s]', y_label=r'Concentrations [$\mu$M]') as axes: # factin contexts.plot(axes, 'plot', timecourses[0], timecourses[1], 'b-.') # pi contexts.plot(axes, 'plot', timecourses[0], timecourses[3], 'g-') axes.set_xlim(0, xmax) axes.set_ylim(0, ymax) # Lines to highlight halftime axes.axhline(15, 0, 1, linestyle='-', linewidth=0.5, color='k') axes.axvline(TIMECOURSE_HALFTIME, 0, 15.0 / 35, linestyle=':', linewidth=0.5, color='k') # Halftime label with arrow # axes.annotate('halftime', xy=(TIMECOURSE_HALFTIME, 0.05), axes.annotate(r'$t_{\frac{1}{2}}$', xy=(TIMECOURSE_HALFTIME, 0.05), xytext=(TIMECOURSE_HALFTIME + 200, 5), arrowprops={ 'facecolor': 'black', 'arrowstyle': '->' }, size=settings.SMALL_FONT_SIZE) # Curve labels axes.text(0.5 * xmax, 30.5, '[F-actin]', horizontalalignment='center', verticalalignment='bottom', size=settings.SMALL_FONT_SIZE) axes.text(600, 20.5, '[Pi]', horizontalalignment='right', verticalalignment='bottom', size=settings.SMALL_FONT_SIZE)
def cc_tip(figure): results = data.load_data('results/cc_d_tip.dat') pars, ccs, ds = results with contexts.subplot(figure, (2, 1, 1), title='A', y_label=r'Critical Concentration [$\mu$M]', logscale_x=False, logscale_y=False) as axes: contexts.plot(axes, 'plot', pars, ccs, 'k-') with contexts.subplot(figure, (2, 1, 2), title='B', y_label=r'Diffusion Coefficient [mon^2/s]', x_label=r'Barbed End Pi Dissociation Rate [s$^{-1}$]', logscale_x=False, logscale_y=False) as axes: contexts.plot(axes, 'plot', pars, ds, 'k-')
def halftime_plot(figure, data_filename='results/halftime_v_rho.dat'): results = data.load_data(data_filename) pis, halftimes = results[0], results[1:] pis = numpy.array(pis) / 1000.0 # with contexts.subplot(figure, (2, 2, 3), title='B', with contexts.subplot( figure, (1, 1, 1), #title='B', x_label=r'Pi Concentration [mM]', y_label=r'[Pi] Halftime [s]', logscale_x=True, logscale_y=False) as axes: for ht in halftimes: contexts.plot(axes, 'plot', pis, ht) axes.set_xlim(0, 1000) axes.set_ylim(0, 3000)
def melki_rate_fit_quality(figure): results = data.load_data("results/melki_cooperative_fit.dat") (cooperativities, rates, min_rates, max_rates, rate_pe, chi2, min_chi2, max_chi2, chi2_pe) = results v_results = data.load_data("results/melki_vectorial_fit.dat") (v_rate, junk, junk, junk, v_chi2, v_min_chi2, v_max_chi2, junk) = zip(*v_results)[0] with contexts.subplot( figure, (2, 1, 2), title="B", x_label=r"$\rho_d$", y_label=r"$\chi^2$ Comparison To Data", logscale_x=True ) as axes: axes.fill_between([0.1, 1.0e12], [v_min_chi2, v_min_chi2], v_max_chi2, color="#CCCCFF") axes.axhline(v_chi2, 0, 1, linestyle=":", color="b") axes.axvline(RHO_CRIT, 0, 1, linestyle="--", color="g", linewidth=0.5) contexts.plot(axes, "errorbar", cooperativities, chi2, [c - m for c, m in zip(chi2, min_chi2)], fmt="k.") axes.set_xlim([0.1, 10 ** 12]) axes.set_ylim([0, 14]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000])
def cc_tip(figure): results = data.load_data('results/cc_d_tip.dat') pars, ccs, ds = results with contexts.subplot(figure, (2, 1, 1), title='A', y_label=r'Critical Concentration [$\mu$M]', logscale_x=False, logscale_y=False) as axes: contexts.plot(axes, 'plot', pars, ccs, 'k-') with contexts.subplot( figure, (2, 1, 2), title='B', y_label=r'Diffusion Coefficient [mon^2/s]', x_label=r'Barbed End Pi Dissociation Rate [s$^{-1}$]', logscale_x=False, logscale_y=False) as axes: contexts.plot(axes, 'plot', pars, ds, 'k-')
def crit_conc(figure): results = data.load_data('results/cc_d_cooperative.dat') v_results = data.load_data('results/cc_d_vectorial.dat') coops, ccs, ds = results vcc, vd = v_results[0][0], v_results[1][0] with contexts.subplot(figure, (2, 1, 1), title='A', y_label=r'Critical Concentration [$\mu$M]', logscale_x=True, logscale_y=False) as axes: contexts.plot(axes, 'plot', coops, ccs, 'k-') axes.axhline(vcc, 0, 1, linestyle=':', linewidth=0.5, color='k') axes.set_ylim(0.1, 0.2) with contexts.subplot(figure, (2, 1, 2), title='B', y_label=r'Diffusion Coefficient [mon^2/s]', logscale_x=True, logscale_y=False) as axes: contexts.plot(axes, 'plot', coops, ds, 'k-') axes.axhline(vd, 0, 1, linestyle=':', linewidth=0.5, color='k')
def inset_error_plot(figure): results = data.load_data('results/melki_cooperative_fit.dat') cooperativities, rates, min_rates, max_rates = results[:4] theoretical_rates = 1.0 / (HALFTIME * numpy.sqrt(cooperativities)) errors = numpy.array(numpy.array(rates) - numpy.array(min_rates)) / theoretical_rates rates = numpy.array(rates) / theoretical_rates # Box: left, bottom, width, height box = (0.395, 0.25, 0.22, 0.22) axes = figure.add_axes(box) axes.set_xscale('log') axes.set_xlabel(r'$\rho_d$', size=6, labelpad=0) axes.set_ylabel(r'$r_d^{sim} / r_d^{th}$', size=6, labelpad=-1) for spine in axes.spines.values(): spine.set_linewidth(0.5) axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.3, dashes=(2, 2)) contexts.plot(axes, 'errorbar', cooperativities, rates, errors, fmt='k.', markersize=4, linewidth=0.5, capsize=2) contexts.plot(axes, 'plot', cooperativities, [1 for c in cooperativities], 'r-', linewidth=0.3) axes.set_xlim([0.01, 10**12]) axes.set_xticks([1, 100000, 10000000000]) axes.minorticks_off() axes.xaxis.set_tick_params(size=2, pad=2) axes.yaxis.set_tick_params(size=2, pad=2) axes.set_ylim([0, 1.2]) axes.set_yticks([0, 1]) for label in itertools.chain(axes.get_xticklabels(), axes.get_yticklabels()): label.set_size(4)
def copoly_adp_only(figure): adp_halftimes = data.load_data('results/adp_copoly_halftimes.dat') adp_v_halftimes = data.load_data('results/adp_copoly_halftimes_vectorial.dat') fractions, halftimes = adp_halftimes[0], adp_halftimes[1:] v_fractions, v_halftimes = adp_v_halftimes[0], adp_v_halftimes[1] with contexts.subplot(figure, (1, 1, 1), #title='B', y_label=r'[Pi] Halftime [s]', x_label=r'% ADP-actin') as axes: for ht, lt, in zip(halftimes, LINETYPES): # contexts.plot(axes, 'plot', fractions, numpy.array(ht)/ht[0], lt) contexts.plot(axes, 'plot', fractions, numpy.array(ht), lt) # contexts.plot(axes, 'plot', v_fractions, numpy.array(v_halftimes)/v_halftimes[0], 'k-') contexts.plot(axes, 'plot', v_fractions, numpy.array(v_halftimes), 'k-') new_x_tick_labels = [0, 5, 10, 15, 20] axes.set_xticks([0, 0.05, 0.1, 0.15, 0.2]) axes.set_xticklabels(new_x_tick_labels)
def tip_fit(figure): best_tc = data.load_data('results/depoly_timecourse.dat') times, values = numpy.array(best_tc[0]), numpy.array(best_tc[1]) times -= 300 values *= 0.0027 expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') etimes, evals = numpy.array(expt[0]), expt[1] # with contexts.basic_figure('plots/depoly_tip_fit_timecourse.pdf', with contexts.subplot(figure, (2, 2, 2), title='B' # x_label='Time [s]', # y_label=r'Filament Length [$\mu$m]' ) as axes: contexts.plot(axes, 'plot', times, values, 'r-') contexts.plot(axes, 'plot', etimes, evals, 'k-') axes.set_xlim(0, 1000) axes.set_ylim(0, 15)
def asymptotic_plot(figure): results = data.load_data('results/asymptotic_adppi_v_pi.dat') pis, fractions = results[0], results[1:] with contexts.subplot(figure, (2, 2, 2), title='C', x_label=r'Pi Concentration [$\mu$M]', y_label=r'Asymptotic Fraction [F-ADP-Pi-actin]', logscale_x=True) as axes: # for frac in fractions: # contexts.plot(axes, 'plot', pis, frac) contexts.plot(axes, 'plot', pis, fractions[0], 'b') axes.set_ylim(0, 1) axes.axhline(0.5, 0, 1, linestyle='-', linewidth=0.5, color='k') axes.axvline(HALF_CONCENTRATION, 0, 0.5, linestyle=':', linewidth=0.5, color='k') axes.annotate(r'$c^*$', xy=(HALF_CONCENTRATION, 0.001), xytext=(HALF_CONCENTRATION + 2000, 0.15), arrowprops={ 'facecolor': 'black', 'arrowstyle': '->' }, size=settings.SMALL_FONT_SIZE) axes.text( 4000, 0.8, r'$\rho_d =\,1$', horizontalalignment='right', # verticalalignment='bottom', size=settings.SMALL_FONT_SIZE)
def tip_fit(figure): best_tc = data.load_data('results/depoly_timecourse.dat') times, values = numpy.array(best_tc[0]), numpy.array(best_tc[1]) times -= 300 values *= 0.0027 expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') etimes, evals = numpy.array(expt[0]), expt[1] # with contexts.basic_figure('plots/depoly_tip_fit_timecourse.pdf', with contexts.subplot( figure, (2, 2, 2), title='B' # x_label='Time [s]', # y_label=r'Filament Length [$\mu$m]' ) as axes: contexts.plot(axes, 'plot', times, values, 'r-') contexts.plot(axes, 'plot', etimes, evals, 'k-') axes.set_xlim(0, 1000) axes.set_ylim(0, 15)
def inset_error_plot(figure): results = data.load_data("results/melki_cooperative_fit.dat") cooperativities, rates, min_rates, max_rates = results[:4] theoretical_rates = 1.0 / (HALFTIME * numpy.sqrt(cooperativities)) errors = numpy.array(numpy.array(rates) - numpy.array(min_rates)) / theoretical_rates rates = numpy.array(rates) / theoretical_rates # Box: left, bottom, width, height box = (0.395, 0.25, 0.22, 0.22) axes = figure.add_axes(box) axes.set_xscale("log") axes.set_xlabel(r"$\rho_d$", size=6, labelpad=0) axes.set_ylabel(r"$r_d^{sim} / r_d^{th}$", size=6, labelpad=-1) for spine in axes.spines.values(): spine.set_linewidth(0.5) axes.axvline(RHO_CRIT, 0, 1, linestyle="--", color="g", linewidth=0.3, dashes=(2, 2)) contexts.plot(axes, "errorbar", cooperativities, rates, errors, fmt="k.", markersize=4, linewidth=0.5, capsize=2) contexts.plot(axes, "plot", cooperativities, [1 for c in cooperativities], "r-", linewidth=0.3) axes.set_xlim([0.01, 10 ** 12]) axes.set_xticks([1, 100000, 10000000000]) axes.minorticks_off() axes.xaxis.set_tick_params(size=2, pad=2) axes.yaxis.set_tick_params(size=2, pad=2) axes.set_ylim([0, 1.2]) axes.set_yticks([0, 1]) for label in itertools.chain(axes.get_xticklabels(), axes.get_yticklabels()): label.set_size(4)
def non_be_rates(figure): results = data.load_data('results/melki_cooperative_fit.dat') nb_results = data.load_data('results/melki_non_be_coop_fit.dat') nop_results = data.load_data('results/melki_no_pointed_coop_fit.dat') cooperativities, rates, min_rates, max_rates = results[:4] nbc, nbr, nb_minr, nb_maxr = nb_results[:4] nopc, nopr, nopminr, nopmaxr = nop_results[:4] theoretical_rates = 1.0 / (HALFTIME * numpy.sqrt(cooperativities)) errors = numpy.array(numpy.array(rates) - numpy.array(min_rates)) / theoretical_rates rates = numpy.array(rates) / theoretical_rates nberrors = numpy.array(numpy.array(nbr) - numpy.array(nb_minr)) / theoretical_rates nbrates = numpy.array(nbr) / theoretical_rates noperrors = numpy.array(numpy.array(nopr) - numpy.array(nopminr)) / theoretical_rates noprates = numpy.array(nopr) / theoretical_rates with contexts.subplot(figure, (2, 1, 1), title='A', # x_label=r'Pi Dissociation Cooperativity, $\rho_d$', y_label=r'$r_d$ [Simulation / Theory]', logscale_x=True, ) as axes: axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.5) # With enhanced BE dissociation rate contexts.plot(axes, 'errorbar', cooperativities, rates, errors, fmt='k.') # Without enhanced BE dissociation rate contexts.plot(axes, 'errorbar', cooperativities, nbrates, nberrors, fmt='b.') # No pointed end kinetics contexts.plot(axes, 'errorbar', cooperativities, noprates, noperrors, fmt='g.') contexts.plot(axes, 'plot', cooperativities, [1 for c in cooperativities], 'r-', linewidth=0.5) axes.set_xlim([0.1, 10**12]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000]) axes.set_ylim([0, 1.2])
def non_be_quality(figure): results = data.load_data('results/melki_cooperative_fit.dat') (cooperativities, rates, min_rates, max_rates, rate_pe, chi2, min_chi2, max_chi2, chi2_pe) = results nb_results = data.load_data('results/melki_non_be_coop_fit.dat') (nbc, nbr, nbminr, nbmaxr, nbrpe, nbchi2, nbminc2, nbmaxc2, nbcpe) = nb_results nop_results = data.load_data('results/melki_no_pointed_coop_fit.dat') (nbc, nopr, junk, junk, jukn, nopc2, nopminc2, nopmaxc2, junk) = nop_results v_results = data.load_data('results/melki_vectorial_fit.dat') (v_rate, junk, junk, junk, v_chi2, v_min_chi2, v_max_chi2, junk) = zip(*v_results)[0] v_nb_results = data.load_data('results/melki_non_be_vec_fit.dat') (v_nbr, v_nbminr, v_nbmaxr, v_nbrpe, v_nbchi2, v_nbminc2, v_nbmaxc2, v_nbcpe) = zip(*v_nb_results)[0] with contexts.subplot(figure, (2, 1, 2), title='B', x_label=r'Pi Dissociation Cooperativity, $\rho_d$', y_label=r'$\chi^2$ Comparison To Data', logscale_x=True) as axes: axes.fill_between([0.1, 1.0e12], [v_min_chi2, v_min_chi2], v_max_chi2, color='#AAAAAA') axes.fill_between([0.1, 1.0e12], [v_nbminc2, v_nbminc2], v_nbmaxc2, color='#CCCCFF') axes.axhline(v_chi2, 0, 1, linestyle=':', color='k') axes.axhline(v_nbchi2, 0, 1, linestyle=':', color='b') axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.5) contexts.plot(axes, 'errorbar', cooperativities, chi2, [c - m for c, m in zip(chi2, min_chi2)], fmt='k.') contexts.plot(axes, 'errorbar', cooperativities, nbchi2, [c - m for c, m in zip(nbchi2, nbminc2)], fmt='b.') contexts.plot(axes, 'errorbar', cooperativities, nopc2, [c - m for c, m in zip(nopc2, nopminc2)], fmt='g.') axes.set_xlim([0.1, 10**12]) axes.set_ylim([0, 14]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000])
def melki_rate_plot(figure): # results = data.load_data('results/melki_rates.dat') results = data.load_data('results/melki_cooperative_fit.dat') v_results = data.load_data('results/melki_vectorial_fit.dat') # results = data.load_data('results/melki_rate_sensitivities.dat') # cooperativities, rates, statistical_errors, halftimes, hte = results # cooperativities, rates, errors = results[:3] cooperativities, rates = results[:2] v_rate_pack = zip(*v_results)[0][:3] # with contexts.basic_figure('plots/melki_rates.pdf', with contexts.subplot(figure, (1, 1, 1), #title='A', x_label=r'$\rho_d$', # y_label=r'Non-Boundary Pi Dissociation Rate, $r_d$ [$s^{-1}$]', y_label=r'$r_d$ [$s^{-1}$]', logscale_x=True, logscale_y=True) as axes: contexts.plot(axes, 'plot', cooperativities, rates, 'k.') # contexts.plot(axes, 'errorbar', cooperativities, rates, # errors, fmt='k.') cooperativities = numpy.array(cooperativities) contexts.plot(axes, 'plot', cooperativities, 1.0 / (HALFTIME * numpy.sqrt(cooperativities)), 'r-', linewidth=0.5) axes_2 = axes.twinx() axes_2.set_yscale('log') axes_2.set_ylabel(r'$R_d$ [$s^{-1}$]', size=settings.LABEL_FONT_SIZE) for label in axes_2.get_yticklabels(): label.set_size(settings.TICK_FONT_SIZE) axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.5, dashes=(3, 3)) axes.set_yticks([1.0e-9, 1.0e-8, 1.0e-7, 1.0e-6, 1.0e-5, 1.0e-4, 1.0e-3]) axes.minorticks_off() contexts.plot(axes_2, 'plot', cooperativities, cooperativities * rates, 'k.', markerfacecolor='None') axes_2.axhline(v_rate_pack[0], 0, 1, linestyle=':', color='b') axes_2.set_ylim([1.0e-4, 100]) axes_2.set_yticks([1.0e-3, 1.0e-2, 1.0e-1, 1, 1.0e1]) axes_2.minorticks_off() axes.set_xlim([0.1, 10**11]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000]) inset_error_plot(figure)
def melki_rate_plot(figure): # results = data.load_data('results/melki_rates.dat') results = data.load_data("results/melki_cooperative_fit.dat") v_results = data.load_data("results/melki_vectorial_fit.dat") # results = data.load_data('results/melki_rate_sensitivities.dat') # cooperativities, rates, statistical_errors, halftimes, hte = results # cooperativities, rates, errors = results[:3] cooperativities, rates = results[:2] v_rate_pack = zip(*v_results)[0][:3] # with contexts.basic_figure('plots/melki_rates.pdf', with contexts.subplot( figure, (1, 1, 1), # title='A', x_label=r"$\rho_d$", # y_label=r'Non-Boundary Pi Dissociation Rate, $r_d$ [$s^{-1}$]', y_label=r"$r_d$ [$s^{-1}$]", logscale_x=True, logscale_y=True, ) as axes: contexts.plot(axes, "plot", cooperativities, rates, "k.") # contexts.plot(axes, 'errorbar', cooperativities, rates, # errors, fmt='k.') cooperativities = numpy.array(cooperativities) contexts.plot( axes, "plot", cooperativities, 1.0 / (HALFTIME * numpy.sqrt(cooperativities)), "r-", linewidth=0.5 ) axes_2 = axes.twinx() axes_2.set_yscale("log") axes_2.set_ylabel(r"$R_d$ [$s^{-1}$]", size=settings.LABEL_FONT_SIZE) for label in axes_2.get_yticklabels(): label.set_size(settings.TICK_FONT_SIZE) axes.axvline(RHO_CRIT, 0, 1, linestyle="--", color="g", linewidth=0.5, dashes=(3, 3)) axes.set_yticks([1.0e-9, 1.0e-8, 1.0e-7, 1.0e-6, 1.0e-5, 1.0e-4, 1.0e-3]) axes.minorticks_off() contexts.plot(axes_2, "plot", cooperativities, cooperativities * rates, "k.", markerfacecolor="None") axes_2.axhline(v_rate_pack[0], 0, 1, linestyle=":", color="b") axes_2.set_ylim([1.0e-4, 100]) axes_2.set_yticks([1.0e-3, 1.0e-2, 1.0e-1, 1, 1.0e1]) axes_2.minorticks_off() axes.set_xlim([0.1, 10 ** 11]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000]) inset_error_plot(figure)
def random_vectorial_timecourse(figure): random_results = data.load_data('results/depoly_timecourse_random.dat') vectorial_results = data.load_data( 'results/depoly_timecourse_vectorial.dat') expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') rtimes, rvalues = numpy.array(random_results[0]), random_results[1:] vtimes, vvalues = numpy.array(vectorial_results[0]), vectorial_results[1:] etimes, evals = numpy.array(expt[0]), expt[1] rtimes -= 300 vtimes -= 300 # with contexts.basic_figure('plots/depoly_rv_timecourses.pdf', with contexts.subplot( figure, (2, 2, 1), title='A', # x_label='Time [s]', y_label=r'Filament Length [$\mu$m]') as axes: for y in rvalues: y = numpy.array(y) y *= 0.0027 contexts.plot( axes, 'plot', rtimes, y, '-', color='#FF8080', # color='#FFA0A0', linewidth=THIN_LINE) for y in vvalues: y = numpy.array(y) y *= 0.0027 contexts.plot( axes, 'plot', vtimes, y, '-', color='#8080FF', # color='#A0A0FF', linewidth=THIN_LINE) contexts.plot(axes, 'plot', etimes, evals, 'k', linewidth=0.7) axes.set_ylim(0, 15) axes.set_xlim(0, 1000)
def _timecourse(fnc, f_filename, p_filename, sim_filename, output_filename): ftimes, fdata = data.load_data(f_filename) ptimes, pdata = data.load_data(p_filename) sim_results = data.load_data(sim_filename) stimes = numpy.array(sim_results[0]) slengths = numpy.array(sim_results[1]) sadppi = numpy.array(sim_results[3]) stimes /= 60 slengths *= fnc / ACTIN_CONCENTRATION sadppi *= fnc / ACTIN_CONCENTRATION with contexts.basic_figure(output_filename, x_label='Time [min]', y_label='Polymer Fraction') as axes: contexts.plot(axes, 'plot', ftimes, fdata, 'k.') contexts.plot(axes, 'plot', ptimes, pdata, 'r.') contexts.plot(axes, 'plot', stimes, slengths, 'k-') contexts.plot(axes, 'plot', stimes, sadppi, 'r-') axes.set_xlim(0, 35)
def cooperative_timecourse(figure): filament_results = data.load_data( 'results/depoly_timecourse_rho_200000.dat') mean_results = data.load_data('results/depoly_mean_tc.dat') expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') ftimes, fvalues = numpy.array(filament_results[0]), filament_results[1:] mtimes, mvalues = (numpy.array(mean_results[0]), 0.0027 * numpy.array(mean_results[1])) etimes, evals = numpy.array(expt[0]), expt[1] ftimes -= 300 mtimes -= 300 # with contexts.basic_figure('plots/depoly_coop_timecourses.pdf', with contexts.subplot(figure, (2, 2, 4), title='D', x_label='Time [s]' # y_label=r'Filament Length [$\mu$m]' ) as axes: for y in fvalues: y = numpy.array(y) y *= 0.0027 contexts.plot( axes, 'plot', ftimes, y, '-', # color='#FF8080', # color='#80FF80', color='#8080FF', linewidth=THIN_LINE) contexts.plot(axes, 'plot', etimes, evals, 'k-', linewidth=0.7) contexts.plot(axes, 'plot', mtimes, mvalues, 'r-', linewidth=0.7) axes.set_ylim(0, 15) axes.set_xlim(0, 1000)
def random_vectorial_timecourse(figure): random_results = data.load_data('results/depoly_timecourse_random.dat') vectorial_results = data.load_data('results/depoly_timecourse_vectorial.dat') expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') rtimes, rvalues = numpy.array(random_results[0]), random_results[1:] vtimes, vvalues = numpy.array(vectorial_results[0]), vectorial_results[1:] etimes, evals = numpy.array(expt[0]), expt[1] rtimes -= 300 vtimes -= 300 # with contexts.basic_figure('plots/depoly_rv_timecourses.pdf', with contexts.subplot(figure, (2, 2, 1), title='A', # x_label='Time [s]', y_label=r'Filament Length [$\mu$m]') as axes: for y in rvalues: y = numpy.array(y) y *= 0.0027 contexts.plot(axes, 'plot', rtimes, y, '-', color='#FF8080', # color='#FFA0A0', linewidth=THIN_LINE) for y in vvalues: y = numpy.array(y) y *= 0.0027 contexts.plot(axes, 'plot', vtimes, y, '-', color='#8080FF', # color='#A0A0FF', linewidth=THIN_LINE) contexts.plot(axes, 'plot', etimes, evals, 'k', linewidth=0.7) axes.set_ylim(0, 15) axes.set_xlim(0, 1000)
def cooperative_timecourse(figure): filament_results = data.load_data( 'results/depoly_timecourse_rho_200000.dat') mean_results = data.load_data('results/depoly_mean_tc.dat') expt = data.load_data( 'experimental_data/jegou_2011/sample_filament_timecourse.dat') ftimes, fvalues = numpy.array(filament_results[0]), filament_results[1:] mtimes, mvalues = (numpy.array(mean_results[0]), 0.0027 * numpy.array(mean_results[1])) etimes, evals = numpy.array(expt[0]), expt[1] ftimes -= 300 mtimes -= 300 # with contexts.basic_figure('plots/depoly_coop_timecourses.pdf', with contexts.subplot(figure, (2, 2, 4), title='D', x_label='Time [s]' # y_label=r'Filament Length [$\mu$m]' ) as axes: for y in fvalues: y = numpy.array(y) y *= 0.0027 contexts.plot(axes, 'plot', ftimes, y, '-', # color='#FF8080', # color='#80FF80', color='#8080FF', linewidth=THIN_LINE) contexts.plot(axes, 'plot', etimes, evals, 'k-', linewidth=0.7) contexts.plot(axes, 'plot', mtimes, mvalues, 'r-', linewidth=0.7) axes.set_ylim(0, 15) axes.set_xlim(0, 1000)
def non_be_rates(figure): results = data.load_data('results/melki_cooperative_fit.dat') nb_results = data.load_data('results/melki_non_be_coop_fit.dat') nop_results = data.load_data('results/melki_no_pointed_coop_fit.dat') cooperativities, rates, min_rates, max_rates = results[:4] nbc, nbr, nb_minr, nb_maxr = nb_results[:4] nopc, nopr, nopminr, nopmaxr = nop_results[:4] theoretical_rates = 1.0 / (HALFTIME * numpy.sqrt(cooperativities)) errors = numpy.array(numpy.array(rates) - numpy.array(min_rates)) / theoretical_rates rates = numpy.array(rates) / theoretical_rates nberrors = numpy.array(numpy.array(nbr) - numpy.array(nb_minr)) / theoretical_rates nbrates = numpy.array(nbr) / theoretical_rates noperrors = numpy.array(numpy.array(nopr) - numpy.array(nopminr)) / theoretical_rates noprates = numpy.array(nopr) / theoretical_rates with contexts.subplot( figure, (2, 1, 1), title='A', # x_label=r'Pi Dissociation Cooperativity, $\rho_d$', y_label=r'$r_d$ [Simulation / Theory]', logscale_x=True, ) as axes: axes.axvline(RHO_CRIT, 0, 1, linestyle='--', color='g', linewidth=0.5) # With enhanced BE dissociation rate contexts.plot(axes, 'errorbar', cooperativities, rates, errors, fmt='k.') # Without enhanced BE dissociation rate contexts.plot(axes, 'errorbar', cooperativities, nbrates, nberrors, fmt='b.') # No pointed end kinetics contexts.plot(axes, 'errorbar', cooperativities, noprates, noperrors, fmt='g.') contexts.plot(axes, 'plot', cooperativities, [1 for c in cooperativities], 'r-', linewidth=0.5) axes.set_xlim([0.1, 10**12]) axes.set_xticks([1, 100, 10000, 1000000, 100000000, 10000000000]) axes.set_ylim([0, 1.2])
def copoly_halftime_plot(filename): adp_halftimes = data.load_data('results/adp_copoly_halftimes.dat') nh_halftimes = data.load_data('results/nh_copoly_halftimes.dat') adp_v_halftimes = data.load_data( 'results/adp_copoly_halftimes_vectorial.dat') nh_v_halftimes = data.load_data( 'results/nh_copoly_halftimes_vectorial.dat') fractions, combined_data = _combine_data(adp_halftimes, nh_halftimes) vfractions, vcombined_data = _combine_data(adp_v_halftimes, nh_v_halftimes) with contexts.basic_figure(filename, y_label=r'Halftime [s]', logscale_y=True) as axes: for local_data, lt, in zip(combined_data, LINETYPES): contexts.plot(axes, 'plot', fractions, local_data, lt) for vld in vcombined_data: contexts.plot(axes, 'plot', vfractions, vld, 'k-') # new_x_tick_labels = [10, 5, 0, 5, 10] # # axes.set_xticks([-10, -5, 0, 5, 10]) new_x_tick_labels = [50, 40, 30, 20, 10, 0, 10] axes.set_xticks([-50, -40, -30, -20, -10, 0, 10]) axes.set_xticklabels(new_x_tick_labels) axes.set_ylim(10, 10**5) axes.text(X_LABEL_PADDING, X_LABEL_MARGIN, 'ADP-actin [%]', verticalalignment='top', horizontalalignment='left', transform=axes.transAxes) axes.text(1 - X_LABEL_PADDING, X_LABEL_MARGIN, 'NH-actin [%]', verticalalignment='top', horizontalalignment='right', transform=axes.transAxes) # \rho_d arrows axes.annotate(INCREASING_RHO_TEXT, xy=(-HT_ARROW_X_OFFSET, TIMECOURSE_HALFTIME), xytext=(-HT_ARROW_X_OFFSET, 6e3), arrowprops={ 'facecolor': 'black', 'arrowstyle': '->' }, horizontalalignment='center', verticalalignment='top', size=settings.SMALL_FONT_SIZE) axes.annotate(INCREASING_RHO_TEXT, xy=(HT_ARROW_X_OFFSET, TIMECOURSE_HALFTIME), xytext=(HT_ARROW_X_OFFSET, 17), arrowprops={ 'facecolor': 'black', 'arrowstyle': '->' }, horizontalalignment='center', verticalalignment='bottom', size=settings.SMALL_FONT_SIZE) axes.axvline(0, 0, 1, linestyle=':', linewidth=0.5, color='k')