-
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.
- Loading branch information
jolinahor
committed
Nov 6, 2024
1 parent
c908023
commit 5fe4a5d
Showing
4 changed files
with
58 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,11 @@ | ||
import scanpy as sc | ||
from pf2barcode.imports import import_CCLE | ||
import seaborn as sns | ||
|
||
def makeFigure(): | ||
X = import_CCLE() | ||
|
||
Xsel = X[:, X.var.index.str.contains('AXL')] | ||
Xsel.uns | ||
|
||
sc.pl.pca(X, color="SW", components=['1,2', '3,4'], size=10) |
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,36 @@ | ||
import seaborn as sns | ||
import numpy as np | ||
from scipy.stats import kruskal | ||
import matplotlib.pyplot as plt | ||
|
||
from pf2barcode.imports import import_CCLE | ||
|
||
from .common import ( | ||
getSetup, | ||
subplotLabel, | ||
) | ||
|
||
def makeFigure(): | ||
|
||
X = import_CCLE() | ||
|
||
"""Get a list of the axis objects and create a figure.""" | ||
ax, f = getSetup((10, 6), (1, 1)) | ||
subplotLabel(ax) | ||
|
||
idx_selected = 0 | ||
cells = [] | ||
pvalues = np.zeros(X.obsm["X_pca"].shape[1]) | ||
|
||
for jj in range(X.obsm["X_pca"].shape[1]): | ||
for barcodes in X.obs["SW"].unique(): | ||
cells_selected = X.obsm["X_pca"][X.obs["SW"] == barcodes, idx_selected] | ||
cells.append(cells_selected.flatten()) | ||
|
||
pvalues[jj] = kruskal(*cells).pvalue | ||
|
||
sns.barplot(x=np.arange(pvalues.shape[0]), y=-np.log10(pvalues)) | ||
plt.xlabel("PC") | ||
plt.ylabel("-log10(p-value)") | ||
|
||
return f |
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
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