Пример #1
0
def _heatmap_alignment(gs, alignment, col_idx):
    xlim, ylim = FigureUtil._limits(alignment._all_fecs)
    max_x = xlim[1]
    bin_step_nm = 1
    bin_step_pN = 5
    bins_x = np.arange(xlim[0], xlim[1] + bin_step_nm, step=bin_step_nm)
    bins_y = np.arange(ylim[0], ylim[1] + bin_step_pN, step=bin_step_pN)
    common_kw = dict(separation_max=max_x,
                     use_colorbar=False,
                     title="",
                     bins=(bins_x, bins_y))
    ax1 = plt.subplot(gs[0, col_idx])
    FEC_Plot.heat_map_fec(alignment.zeroed.fec_list, **common_kw)
    FigureUtil._plot_fmt(ax1, xlim, ylim, color=True)
    ax2 = plt.subplot(gs[1, col_idx])
    FEC_Plot.heat_map_fec(alignment.polished.fec_list, **common_kw)
    FigureUtil._plot_fmt(ax2, xlim, ylim, color=True)
    title_kw = dict(color='b', y=0.95, loc='left', fontsize=6)
    downarrow = "$\Downarrow$"
    title_sub = downarrow + " Subtract $X_{\mathbf{PEG3400}}(F)$ + " + \
                "$L_{\mathbf{0,C-term}}$"
    PlotUtilities.title(title_sub, **title_kw)
    PlotUtilities.no_x_label(ax=ax2)
    ax3 = plt.subplot(gs[2, col_idx])
    FEC_Plot.heat_map_fec(alignment.blacklisted.fec_list, **common_kw)
    FigureUtil._plot_fmt(ax3, xlim, ylim, is_bottom=True, color=True)
    PlotUtilities.title(downarrow + " Remove poorly-fit FECs", **title_kw)
    return [ax1, ax2, ax3]
Пример #2
0
def _G0_plot(plot_dir, data_sliced, landscape, fmt):
    # XXX why is this necessary?? screwing up absolute values
    previous_JCP = FigureUtil.read_non_peg_landscape(base="../../FigData/")
    offset_s = np.mean([d.Separation[0] for d in data_sliced])
    G_hao = landscape.G0_kcal_per_mol
    idx_zero = np.where(landscape.q_nm <= 100)
    G_hao = G_hao - landscape.G0_kcal_per_mol[0]
    G_JCP = previous_JCP.G0_kcal_per_mol - previous_JCP.G0_kcal_per_mol[0] + 50
    offset_jcp_nm = min(previous_JCP.q_nm)
    landscape_offset_nm = min(landscape.q_nm)
    q_JCP_nm = previous_JCP.q_nm - offset_jcp_nm + 5
    q_Hao_nm = landscape.q_nm - landscape_offset_nm
    fig = FigureUtil._fig_single(y=6)
    xlim, ylim = FigureUtil._limits(data_sliced)
    ax1 = plt.subplot(2, 1, 1)
    FigureUtil._plot_fec_list(data_sliced, **fmt)
    FigureUtil._plot_fmt(ax1, **fmt)
    ax2 = plt.subplot(2, 1, 2)
    plt.plot(q_Hao_nm, G_hao, label="Aligned, IWT")
    plt.plot(q_JCP_nm, G_JCP, 'r--', label="JCP landscape")
    FigureUtil._plot_fmt(ax2,
                         ylabel="G (kcal/mol)",
                         is_bottom=True,
                         xlim=xlim,
                         ylim=[None, None])
    PlotUtilities.legend(ax=ax2, handlelength=2)
    ax2.set_xlim(fmt['xlim'])
    PlotUtilities.savefig(fig, plot_dir + "FigureSX_LandscapeComparison.png")
Пример #3
0
def _ensemble_alignment(gs, alignment, col_idx):
    xlim, ylim = FigureUtil._limits(alignment._all_fecs)
    common_kw = dict(xlim=xlim, ylim=ylim)
    kw_fmt = dict(color=False, is_left=(col_idx == 0), **common_kw)
    ax1 = plt.subplot(gs[0, col_idx])
    FigureUtil._plot_fec_list(alignment.zeroed.fec_list, **common_kw)
    FigureUtil._plot_fmt(ax1, **kw_fmt)
    ax2 = plt.subplot(gs[1, col_idx])
    FigureUtil._plot_fec_list(alignment.polished.fec_list, **common_kw)
    FigureUtil._plot_fmt(ax2, **kw_fmt)
    PlotUtilities.no_x_label(ax=ax2)
    ax3 = plt.subplot(gs[2, col_idx])
    FigureUtil._plot_fec_list(alignment.blacklisted.fec_list, **common_kw)
    FigureUtil._plot_fmt(ax3, is_bottom=True, **kw_fmt)
Пример #4
0
def _make_plots(galleries_labels):
    alignments = [
        FigureUtil._alignment_pipeline(gallery_tmp[0])
        for gallery_tmp in galleries_labels
    ]
    for i, (_, label) in enumerate(galleries_labels):
        # make the standard aligning plot
        alignment = alignments[i]
        _make_algned_plot(alignment, label)
    # plot the final curves on the same plot
    xlim, ylim = FigureUtil._limits(alignment._all_fecs)
    colors = ['rebeccapurple', 'g']
    fig = PlotUtilities.figure((5, 3))
    gs = gridspec.GridSpec(2, 2)
    # reverse everything, so PEG600 is on top
    galleries_labels = galleries_labels[::-1]
    alignments = alignments[::-1]
    for i, (_, l) in enumerate(galleries_labels):
        ax = plt.subplot(gs[i, 0])
        a = alignments[i]
        FigureUtil._plot_fec_list(a.blacklisted.fec_list,
                                  xlim,
                                  ylim,
                                  label=l,
                                  color=colors[i])
        if (i == 0):
            PlotUtilities.no_x_label(ax)
            PlotUtilities.xlabel("", ax=ax)
    # plot them both on the last column
    plt.subplot(gs[:, 1])
    kw = [dict(), dict(linewidth=0.6)]
    for i, (_, l) in enumerate(galleries_labels):
        a = alignments[i]
        FigureUtil._plot_fec_list(a.blacklisted.fec_list,
                                  xlim,
                                  ylim,
                                  label=l,
                                  color=colors[i],
                                  **kw[i])
    PlotUtilities.savefig(fig, "FigureS_3400vs600.png")