Skip to content

Commit

Permalink
Save work
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ramirez committed Sep 3, 2024
1 parent 10d1cd6 commit a9b00cc
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 175 deletions.
5 changes: 3 additions & 2 deletions pf2/figures/figureA10.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def makeFigure():
# ), ax[0], percentList=percentList, runs=3)

print(X)
ranks = list([5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70])
ranks = list([10, 20, 30, 40, 50, 60, 70])
XX = sc.pp.subsample(
X, fraction=.02, copy=True, random_state=1
X, fraction=.1, copy=True, random_state=1
)
print(XX)
plot_fms_diff_ranks(XX, ax[1], ranksList=ranks, runs=3)
Expand Down Expand Up @@ -85,6 +85,7 @@ def plot_fms_percent_drop(

fmsScore = calculateFMS(dataX, sampledX)
scores.append(fmsScore)
print(i)

fmsLists.append(scores)

Expand Down
11 changes: 9 additions & 2 deletions pf2/figures/figureA11.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ def makeFigure():
X.obs["Label"] = df["Cell Type"].astype(str) + df["Label"].astype(str)

print(X)
# sc.tl.rank_genes_groups(X, "Label", method="wilcoxon", groups=["MacrophagesCmp3", "MacrophagesCmp26"], reference="MacrophagesNoLabel")
# sc.pl.rank_genes_groups(X, n_genes=30, save="Cmp_3_26.png")

XX = X[(X.obs["Label"] == "MacrophagesCmp3") & (X.obs["Label"] == "MacrophagesCmp26") & (X.obs["Label"] == "MacrophagesNoLabel")]

sc.tl.rank_genes_groups(X, "Label", method="wilcoxon", groups="MacrophagesCmp3", reference="MacrophagesCmp26")
sc.pl.rank_genes_groups(X, n_genes=30, save="Cmp_3_26_wilcoxon.png")


# sc.tl.rank_genes_groups(X, "Label", method="'t-test", groups=["MacrophagesCmp3", "MacrophagesCmp26"], reference="MacrophagesNoLabel")
# sc.pl.rank_genes_groups(X, n_genes=30, save="Cmp_3_26_test.png")

return f

Expand Down
6 changes: 3 additions & 3 deletions pf2/figures/figureA13.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def makeFigure():
add_obs(X, "patient_category")
combine_cell_types(X)

cmp1 = 3
cmp2 = 26
cmp1 = 1
cmp2 = 13
threshold = .5
X = add_cmp_both_label(X, cmp1, cmp2, pos1=False, pos2=False, top_perc=threshold)

Expand All @@ -35,7 +35,7 @@ def makeFigure():

# genes = np.concatenate([genes1, genes2])

genes = ["KIF20A", "NEK2", "FAM111B", "RAD54L"]
genes = ["PADI4", "EDN1", "CRYAB", "C11orf96"]
for i, gene in enumerate(genes):
plot_avegene_per_cmp(X, gene, ax[i], cmp1, cmp2, both_cmp = False, cell_type=True)
rotate_xaxis(ax[i])
Expand Down
14 changes: 7 additions & 7 deletions pf2/figures/figureA2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ def makeFigure():

X = read_h5ad("/opt/northwest_bal/full_fitted.h5ad", backed="r")

cmp1 = 3
cmp2 = 26
cmp1 = 1
cmp2 = 13
threshold = .5
X = add_cmp_both_label(X, cmp1, cmp2, pos1=True, pos2=True, top_perc=threshold)
X = add_cmp_both_label(X, cmp1, cmp2, pos1=False, pos2=False, top_perc=threshold)



X_cmp1 = X[(X.obs[f"Cmp{cmp1}"] == True)]
X_cmp2 = X[(X.obs[f"Cmp{cmp2}"] == True)]
# X_cmp1 = X[(X.obs[f"Cmp{cmp1}"] == True)]
# X_cmp2 = X[(X.obs[f"Cmp{cmp2}"] == True)]
# for i in range(1, 51):
plot_wp_pacmap(X_cmp1, cmp1, ax[0], cbarMax=0.3)
plot_wp_pacmap(X_cmp2, cmp2, ax[1], cbarMax=0.3)
plot_wp_pacmap(X, cmp1, ax[0], cbarMax=0.3)
plot_wp_pacmap(X, cmp2, ax[1], cbarMax=0.3)
# plot_wp_per_celltype(X, i, ax[i-1])

return f
Expand Down
4 changes: 2 additions & 2 deletions pf2/figures/figureA8.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def makeFigure():

# for i in range(6):
# for i in range(1):
cmp1 = pc_abs_df.iloc[-(3+1), 0]
cmp2 = pc_abs_df.iloc[-(3+1), 1]
cmp1 = pc_abs_df.iloc[-(3+2), 0]
cmp2 = pc_abs_df.iloc[-(3+2), 1]
plot_pair_gene_factors(X, cmp1, cmp2, ax[(3*3)])
plot_pair_cond_factors(cond_fact_meta_df, cmp1, cmp2, ax[(3*3)+1], "Status")
# plot_pair_wp(X, cmp1, cmp2, ax[(3*3)+2], frac=.001)
Expand Down
Loading

0 comments on commit a9b00cc

Please sign in to comment.