Skip to content

Commit

Permalink
Added Figure 4
Browse files Browse the repository at this point in the history
  • Loading branch information
jolinahor committed Nov 6, 2024
1 parent c908023 commit 5fe4a5d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pf2barcode/figures/figure2.py
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)
36 changes: 36 additions & 0 deletions pf2barcode/figures/figure4.py
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
5 changes: 5 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ idna==3.8
# via requests
igraph==0.11.6
# via pf2barcode
importlib-metadata==8.5.0
# via dask
iniconfig==2.0.0
# via pytest
ipykernel==6.29.5
Expand Down Expand Up @@ -252,6 +254,7 @@ traitlets==5.14.3
# via jupyter-core
# via matplotlib-inline
typing-extensions==4.12.2
# via ipython
# via pyright
tzdata==2024.1
# via pandas
Expand All @@ -263,3 +266,5 @@ wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.13
# via ipywidgets
zipp==3.20.2
# via importlib-metadata
6 changes: 6 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ idna==3.8
# via requests
igraph==0.11.6
# via pf2barcode
importlib-metadata==8.5.0
# via dask
ipykernel==6.29.5
# via pf2barcode
ipython==8.27.0
Expand Down Expand Up @@ -238,6 +240,8 @@ traitlets==5.14.3
# via jupyter-client
# via jupyter-core
# via matplotlib-inline
typing-extensions==4.12.2
# via ipython
tzdata==2024.1
# via pandas
umap-learn==0.5.6
Expand All @@ -248,3 +252,5 @@ wcwidth==0.2.13
# via prompt-toolkit
widgetsnbextension==4.0.13
# via ipywidgets
zipp==3.20.2
# via importlib-metadata

0 comments on commit 5fe4a5d

Please sign in to comment.