diff --git a/spatialpf2/figures/figureSpatial1.py b/spatialpf2/figures/figureSpatial1.py new file mode 100644 index 0000000..1bf6ed6 --- /dev/null +++ b/spatialpf2/figures/figureSpatial1.py @@ -0,0 +1,23 @@ +""" +PaCMAP of Weighted Projections based on Pf2 +""" + +from ..imports import import_HTAN +from .common import subplotLabel, getSetup +from .commonFuncs.plotPaCMAP import plot_wp_pacmap +from ..factorization import pf2 + + +def makeFigure(): + ax, f = getSetup((12, 10), (5, 4)) + subplotLabel(ax) + + X = import_HTAN() + + rank = 20 + X = pf2(X, rank, doEmbedding=True) + + for i in range(1, 21): + plot_wp_pacmap(X, i, ax[i - 1], cbarMax=0.25) + + return f \ No newline at end of file diff --git a/spatialpf2/figures/figureSpatial2.py b/spatialpf2/figures/figureSpatial2.py new file mode 100644 index 0000000..c882c63 --- /dev/null +++ b/spatialpf2/figures/figureSpatial2.py @@ -0,0 +1,29 @@ +""" +PaCMAP of immune exclusion signature genes +""" +from ..imports import import_HTAN +from .common import subplotLabel, getSetup +from .commonFuncs.plotPaCMAP import plot_gene_pacmap +from ..factorization import pf2 + +def makeFigure(): + ax, f = getSetup((15, 8), (2, 4)) + + subplotLabel(ax) + + X = import_HTAN() + + rank = 20 + X = pf2(X, rank, doEmbedding=True) + + # genes originate from epithelial cells + plot_gene_pacmap("DDR1", "Pf2", X, ax[0]) + plot_gene_pacmap("TGFBI", "Pf2", X, ax[1]) + plot_gene_pacmap("PAK4", "Pf2", X, ax[2]) + plot_gene_pacmap("DPEP1", "Pf2", X, ax[3]) + + + + + + return f \ No newline at end of file diff --git a/spatialpf2/figures/figureSpatial3.py b/spatialpf2/figures/figureSpatial3.py new file mode 100644 index 0000000..86a44e4 --- /dev/null +++ b/spatialpf2/figures/figureSpatial3.py @@ -0,0 +1,24 @@ +""" +PaCMAP of Conditions +""" + +from ..imports import import_HTAN +from .common import subplotLabel, getSetup +import numpy as np +from .commonFuncs.plotPaCMAP import plot_labels_pacmap +from ..factorization import pf2 + +def makeFigure(): + ax, f = getSetup((8, 8), (1, 1)) + + subplotLabel(ax) + + X = import_HTAN() + + rank = 20 + X = pf2(X, rank, doEmbedding=True) + + plot_labels_pacmap(X, "Condition", ax[0]) + + + return f