Skip to content

Commit

Permalink
bw and alpha for tissue img in plotting functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gaddamshreya1 committed Aug 22, 2022
1 parent c26d773 commit c4ad9bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tangram/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def plot_cell_annotation_sc(
spot_size=None,
scale_factor=None,
perc=0,
alpha_img=1.0,
bw=False,
ax=None
):

Expand All @@ -204,7 +206,8 @@ def plot_cell_annotation_sc(
raise ValueError("Spot Size and Scale Factor should be None when ad_sp.uns['spatial'] exists")

sc.pl.spatial(
adata_sp, color=annotation_list, cmap="viridis", show=False, frameon=False, spot_size=spot_size, scale_factor=scale_factor, ax=ax
adata_sp, color=annotation_list, cmap="viridis", show=False, frameon=False, spot_size=spot_size,
scale_factor=scale_factor, alpha_img=alpha_img, bw=bw, ax=ax
)

adata_sp.obs.drop(annotation_list, inplace=True, errors="ignore", axis=1)
Expand Down Expand Up @@ -320,6 +323,8 @@ def plot_genes_sc(
scale_factor=None,
cmap="inferno",
perc=0,
alpha_img=1.0,
bw=False,
return_figure=False
):

Expand Down Expand Up @@ -405,6 +410,8 @@ def plot_genes_sc(
ax=ax_m,
show=False,
cmap=cmap,
alpha_img=alpha_img,
bw=bw
)
ax_p = fig.add_subplot(gs[ix, 1])
sc.pl.spatial(
Expand All @@ -416,6 +423,8 @@ def plot_genes_sc(
ax=ax_p,
show=False,
cmap=cmap,
alpha_img=alpha_img,
bw=bw
)

# sc.pl.spatial(adata_measured, color=['{} (measured)'.format(gene) for gene in genes], frameon=False)
Expand Down

0 comments on commit c4ad9bf

Please sign in to comment.