Example #1
0
plot_df = pd.concat(
    [
        mofa.factors[[f_x, f_y]],
        gexp.loc[["CDH1", "VIM"]].T.add_suffix("_transcriptomics"),
        prot.loc[["CDH1", "VIM"]].T.add_suffix("_proteomics"),
        ss["Tissue_type"],
    ],
    axis=1,
    sort=False,
)

# Tissue plot
ax = GIPlot.gi_tissue_plot(f_x,
                           f_y,
                           plot_df,
                           plot_reg=False,
                           pal=PALETTE_TTYPE)
ax.set_xlabel(f"Factor {f_x[1:]}")
ax.set_ylabel(f"Factor {f_y[1:]}")
plt.savefig(f"{RPATH}/MultiOmics_{f_x}_{f_y}_tissue_plot.pdf",
            bbox_inches="tight")
plt.savefig(f"{RPATH}/MultiOmics_{f_x}_{f_y}_tissue_plot.png",
            bbox_inches="tight",
            dpi=600)
plt.close("all")

# Continous annotation
for z in ["VIM_proteomics", "CDH1_proteomics"]:
    ax = GIPlot.gi_continuous_plot(f_x,
                                   f_y,
Example #2
0
        p, c, dtype, ctissues = ("UBFD1", "TP63", "crispr", ["Lung"])

        plot_df = pd.concat(
            [
                drespo.loc[[c]].T.add_suffix("_y")
                if dtype == "drug" else crispr.loc[[c]].T.add_suffix("_y"),
                prot.loc[[p]].T.add_suffix("_prot"),
                gexp.loc[[p]].T.add_suffix("_gexp"),
                prot_obj.ss["tissue"],
            ],
            axis=1,
            sort=False,
        ).dropna(subset=[f"{c}_y", f"{p}_prot"])

        # Protein
        ax = GIPlot.gi_tissue_plot(f"{p}_prot", f"{c}_y", plot_df)

        if dtype == "drug":
            ax.axhline(np.log(drespo_maxc[c]),
                       ls="--",
                       lw=.3,
                       color=CrispyPlot.PAL_DTRACE[1])

        ax.set_xlabel(f"{p}\nProtein intensities")
        ax.set_ylabel(
            f"{c}\n{'Drug response IC50' if dtype == 'drug' else 'CRISPR-Cas9 (log2 FC)'}"
        )
        plt.savefig(
            f"{RPATH}/TopHits_{p}_{c}_{dtype}_regression_tissue_plot.pdf",
            bbox_inches="tight",
        )
Example #3
0
    plot_df = pd.concat(
        [
            drespo.loc[[c]].T.add_suffix("_y")
            if dtype == "drug" else crispr.loc[[c]].T.add_suffix("_y"),
            prot.loc[[p]].T.add_suffix("_prot"),
            gexp.loc[[p]].T.add_suffix("_gexp"),
            ss["Tissue_type"],
        ],
        axis=1,
        sort=False,
    ).dropna(subset=[f"{c}_y", f"{p}_prot"])

    # Protein
    ax = GIPlot.gi_tissue_plot(f"{p}_prot",
                               f"{c}_y",
                               plot_df,
                               pal=PALETTE_TTYPE)

    if dtype == "drug":
        ax.axhline(np.log(dmaxc[c]),
                   ls="--",
                   lw=0.3,
                   color=CrispyPlot.PAL_DTRACE[1])

    ax.set_xlabel(f"{p}\nProtein intensities")
    ax.set_ylabel(
        f"{c}\n{'Drug response IC50' if dtype == 'drug' else 'CRISPR-Cas9 (log2 FC)'}"
    )
    plt.savefig(
        f"{RPATH}/TopHits_{p}_{c}_{dtype}_regression_tissue_plot.pdf",
        bbox_inches="tight",