Skip to content

Commit

Permalink
convert all numeric values to int or float
Browse files Browse the repository at this point in the history
  • Loading branch information
serareif committed Jun 18, 2024
1 parent 0c9f532 commit 5c154a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def plot_scatter():
fig, ax = plt.subplots()

ax.scatter(
adata.obs[x_col],
adata.obs[y_col],
c=adata.obs[color_col],
adata.obs[x_col].astype(float),
adata.obs[y_col].astype(float),
c=adata.obs[color_col].astype(float),
s=dot_size,
cmap="viridis",
)
Expand Down Expand Up @@ -133,10 +133,12 @@ def plot_histograms():

return fig

@output
@render.text
def n_cells():
adata = _adata.get()

if adata is not None:
n_cells = adata.n_obs
n_cells = int(adata.n_obs)
print(type(n_cells))
return f"{n_cells} cells pass the current filtering thresholds"
8 changes: 4 additions & 4 deletions src/sliders.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def slider_sample():
if adata is None:
return

n_obs = adata.n_obs
n_obs = int(adata.n_obs)
return ui.input_slider(
"random_sample_size",
"Random sample size",
Expand Down Expand Up @@ -120,9 +120,9 @@ def slider_filters():
absolute = ui.input_slider(
f"{col}_absolute",
"Absolute value",
distributions[col]["min"],
distributions[col]["max"],
[distributions[col]["min"], distributions[col]["max"]],
float(distributions[col]["min"]),
float(distributions[col]["max"]),
[float(distributions[col]["min"]), float(distributions[col]["max"])],
)
panel = ui.accordion_panel(pretty_name, mads, absolute)
panels.append(panel)
Expand Down

0 comments on commit 5c154a3

Please sign in to comment.