コード例 #1
0
def plot_sudden_markov_fixed_decision_mat(input_fname, plot_fname, label):
    """
    Plot decision matrix for sudden switch Markov model, with
    FIXED growth rates for glucose and galactose.
    """
    print "plotting: %s" %(os.path.basename(plot_fname))
    plt.figure(figsize=(5, 4))
    params = simulation.load_params(MARKOV_PARAM_FNAME)
    params["gluc_growth_rate"] = 0.3
    params["galac_growth_rate"] = 0.075
    model_sudden_markov.plot_decision_mat(params)
    plt.tight_layout()
    plt.savefig(plot_fname)
コード例 #2
0
def plot_sudden_markov_variable_decision_mat(input_fname, plot_fname, label):
    """
    Plot decision matrix for sudden switch Markov model, with
    VARIABLE growth rates for glucose and galactose.
    """
    print "plotting: %s" %(os.path.basename(plot_fname))
    fig = plt.figure(figsize=(6, 3.1))
    params = simulation.load_params(MARKOV_PARAM_FNAME)
    params["gluc_growth_rate"] = 0.3
    # 4-fold lower growth rate, 2-fold, nearly equal growth rates
    galac_growth_rates = [0.075, 0.15, 0.28]
    num_plots = len(galac_growth_rates)
    # set heatmap aspect equal
    plt.gca().set_aspect("equal")
    sns.set_style("white")
    for plot_num, galac_growth_rate in enumerate(galac_growth_rates):
        show_x_label = False
        show_y_label = False
        show_colorbar_label = False
        params["galac_growth_rate"] = galac_growth_rate
        plt.subplot(1, num_plots, plot_num + 1)
        if (plot_num + 1) == 1:
            show_x_label = False
            show_y_label = True
        elif (plot_num + 1) == 2:
            show_x_label = True
            show_y_label = False
        elif (plot_num + 1) == 3:
            show_x_label = False
            show_colorbar_label = True
        model_sudden_markov.plot_decision_mat(params,
                                              show_x_label=show_x_label,
                                              show_y_label=show_y_label,
                                              show_colorbar_label=show_colorbar_label)
    plt.subplots_adjust(wspace=0.5, left=0.1)
    fig.set_tight_layout(True)
    plt.savefig(plot_fname)