Spaces:
Sleeping
Sleeping
Update Quality_Control.py
Browse files- Quality_Control.py +15 -6
Quality_Control.py
CHANGED
@@ -925,16 +925,25 @@ def create_line_graph2(quantile):
|
|
925 |
|
926 |
return p
|
927 |
|
|
|
|
|
928 |
# Bind the create_line_graph function to the quantile slider
|
929 |
nucleus_size_line_graph_with_histogram = pn.bind(create_line_graph2, quantile=quantile_slider.param.value)
|
930 |
|
931 |
-
#
|
932 |
-
|
933 |
-
#nucleus_size_line_graph_with_histogram.servable()
|
934 |
-
# Layout the components in a Panel app
|
935 |
-
plot1 = pn.Column(quantile_slider, pn.pane.Bokeh(nucleus_size_line_graph_with_histogram))
|
936 |
-
#plot1.servable()
|
937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
#Removing cells based on nucleus size
|
939 |
|
940 |
quantile = quantile_slider.value
|
|
|
925 |
|
926 |
return p
|
927 |
|
928 |
+
|
929 |
+
|
930 |
# Bind the create_line_graph function to the quantile slider
|
931 |
nucleus_size_line_graph_with_histogram = pn.bind(create_line_graph2, quantile=quantile_slider.param.value)
|
932 |
|
933 |
+
# Clean the 'Nucleus_Size' column by removing NaN and infinite values
|
934 |
+
df = df[np.isfinite(df['Nucleus_Size'])] # This will keep only finite values
|
|
|
|
|
|
|
|
|
935 |
|
936 |
+
# Check if the DataFrame is not empty after cleaning
|
937 |
+
if df.empty:
|
938 |
+
raise ValueError("No valid data available after cleaning.")
|
939 |
+
else:
|
940 |
+
# Calculate the histogram
|
941 |
+
hist, edges = np.histogram(df['Nucleus_Size'], bins=30)
|
942 |
+
print("Histogram calculated successfully.")
|
943 |
+
print("Histogram:", hist)
|
944 |
+
print("Edges:", edges)
|
945 |
+
plot1 = pn.Column(quantile_slider, pn.pane.Bokeh(nucleus_size_line_graph_with_histogram))
|
946 |
+
|
947 |
#Removing cells based on nucleus size
|
948 |
|
949 |
quantile = quantile_slider.value
|