-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plot bottom and top 5 genes. Still error on reorder table
- Loading branch information
1 parent
127f789
commit 9de5e69
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Spatial CC: | ||
""" | ||
|
||
from .common import getSetup | ||
from ..imports import import_HTAN | ||
from ..factorization import pf2 | ||
from .commonFuncs.plotFactors import ( | ||
bot_top_genes | ||
) | ||
import pandas as pd | ||
|
||
|
||
def makeFigure(): | ||
ax, f = getSetup((10, 12), (4, 5)) | ||
|
||
rank = 20 | ||
X = import_HTAN() | ||
|
||
X = pf2(X, rank, doEmbedding=False) | ||
|
||
for i in range(rank): | ||
genes = bot_top_genes(X, i+1) | ||
df = pd.DataFrame( | ||
data=X.varm["Pf2_C"][:, i], index=X.var_names, columns=["Component"] | ||
) | ||
ax[i].barh(genes, df.loc[genes, "Component"]) | ||
|
||
return f |