Skip to content

Commit

Permalink
PaCMAP figures
Browse files Browse the repository at this point in the history
  • Loading branch information
Breanna Remigio committed Jun 4, 2024
1 parent f00c15c commit 118d0b9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spatialpf2/figures/figureSpatial1.py
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions spatialpf2/figures/figureSpatial2.py
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions spatialpf2/figures/figureSpatial3.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 118d0b9

Please sign in to comment.