Skip to content

Commit

Permalink
Merge branch 'main' into newer_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmey authored Dec 17, 2024
2 parents 96eb6c4 + 49f0db7 commit 2df26c8
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pf2barcode/figures/figure4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.stats import kruskal

from pf2barcode.imports import import_CCLE

from .common import (
getSetup,
subplotLabel,
)


def makeFigure():
X = import_CCLE()

ax, f = getSetup((10, 6), (1, 1))
subplotLabel(ax)

pvalues = np.zeros(X.obsm["X_pca"].shape[1])

for jj in range(X.obsm["X_pca"].shape[1]):
cells = []
for barcodes in X.obs["SW"].unique():
cells_selected = X.obsm["X_pca"][X.obs["SW"] == barcodes, jj]
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

0 comments on commit 2df26c8

Please sign in to comment.