]: plot_df = pd.concat( [ mlib[["Library", mtype]], minlib[[mtype ]].assign(Library="MinLibCas9") ], ignore_index=True, ).dropna() fig, ax = plt.subplots(1, 1, figsize=(1.5, 2), dpi=600) QCplot.bias_boxplot( plot_df, x="Library", y=mtype, add_n=False, tick_base=None, order=order, draw_violin=True, ax=ax, ) ax.set_xticklabels(order, rotation=45, ha="right") ax.grid(True, ls=":", lw=0.1, alpha=1.0, zorder=0, axis="y") ax.set_xlabel("") ax.set_ylabel(f"{mtype.split('_')[1]}") plt.savefig( f"{RPATH}/lib_metrics_library_boxplot_{mtype}.pdf", bbox_inches="tight",
) for i, mtype in enumerate(row_order): plot_df = pd.concat( [polyt_pos_df, master_lib.loc[polyt_pos_df.index, mtype]], axis=1) for j, p in enumerate(polyt): ax = axs[i][j] order = natsorted(set(plot_df[p].dropna().astype(int))) QCplot.bias_boxplot( plot_df[plot_df["polyt5"].isnull()] if p == "polyt4" else plot_df[~plot_df["polyt5"].isnull()], x="polyt4", y=mtype, add_n=True, tick_base=None, order=order, ax=ax, ) ax.set_xticklabels(ax.get_xticklabels() if i == (len(row_order) - 1) else [], rotation=0, horizontalalignment="right") ax.grid(True, ls=":", lw=0.1, alpha=1.0, zorder=0, axis="y") if mtype == "JACKS": ax.axhline(1, ls="-",