diff --git a/src/plots.py b/src/plots.py index f9d36c1..c3f3a86 100644 --- a/src/plots.py +++ b/src/plots.py @@ -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", ) @@ -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" diff --git a/src/sliders.py b/src/sliders.py index 77c22a2..a4baa42 100644 --- a/src/sliders.py +++ b/src/sliders.py @@ -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", @@ -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)