if not os.path.exists(out_dir):
        os.makedirs(out_dir)
    out_fig = os.path.join(out_dir, "algdock_vs_experiment.pdf")
    out_log = os.path.join(out_dir, "rmse_pearsonR.dat")

    ys = []
    y_errs = []
    for target_ligand in target_ligands:
        ys.append(algdock_bfes[ref_ligand][target_ligand])
        y_errs.append(algdock_errors[ref_ligand][target_ligand])

    ys = np.array(ys)
    y_errs = np.array(y_errs) * error_scales[i] / 2.

    dummy_ligands = ["abc" for _ in ys]
    scatter_plot_info(xs, ys, dummy_ligands, out_log)

    ylim = ylims[i]
    if ylim is not None:
        ylim = [float(s) for s in ylim.split("_")]

    scatter_plot(xs,
                 ys,
                 args.xlabel,
                 args.ylabel,
                 out_fig,
                 show_xy_axes=True,
                 yerr=y_errs,
                 ylimits=ylim,
                 show_regression_line=True,
                 show_diagonal_line=False,
        # use one std for errorbar
        xerr /= 2.
        yerr /= 2.

        if ref_ligand in ligands_to_scale_error:
            yerr *= args.error_scale_factor

        #markercolors = ["b" if ".inactive." in ligand or ligand == "phenol.A__AAA" else "r" for ligand in ligands]
        markers = [
            "D" if ".inactive." in ligand or ligand == "phenol.A__AAA" else "."
            for ligand in ligands
        ]
        markercolors = ["k" for ligand in ligands]

        if len(x) > 1:
            scatter_plot_info(x, y, ligands, out_text_file)

            scatter_plot(x,
                         y,
                         args.xlabel,
                         args.ylabel,
                         out_figure_file,
                         show_xy_axes=args.show_xy_axes,
                         xerr=xerr,
                         yerr=yerr,
                         show_regression_line=True,
                         show_diagonal_line=False,
                         show_rmse=True,
                         show_R=True,
                         show_regression_line_eq=True,
                         markers=markers,
Ejemplo n.º 3
0
xs = np.array(xs)

# without CV
ys = []
y_errs = []
for ref_ligand in ref_ligands:
    for target_ligand in target_ligands:
        ys.append(rbfes_without_cv[ref_ligand][target_ligand])
        y_errs.append(rbfe_errors_without_cv[ref_ligand][target_ligand])

ys = np.array(ys)
y_errs = np.array(y_errs) / 2.

dummy_ligands = ["abc" for _ in ys]
scatter_plot_info(xs, ys, dummy_ligands, "rmse_pearsonR_without_CV.dat")

ylimits = [-10, 10]
scatter_plot(xs, ys, args.xlabel, args.ylabel, "without_CV.pdf",
             show_xy_axes=True,
             yerr=y_errs,
             ylimits=ylimits,
             show_regression_line=True,
             show_diagonal_line=False,
             show_rmse=True,
             show_R=True,
             show_regression_line_eq=True,
             markersize=4,
             same_xy_scale=False,
             text_pos=[0.1, 0.7])