Spaces:
Running
Running
added default to substrate
Browse files
app.py
CHANGED
|
@@ -277,18 +277,38 @@ with st.sidebar:
|
|
| 277 |
if model_type == "single_cell":
|
| 278 |
try:
|
| 279 |
with st.container(border=False, key="s2f_grp_conditions"):
|
| 280 |
-
st.markdown(
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
substrate_val = st.selectbox(
|
| 286 |
-
"Substrate", substrates, index=0,
|
| 287 |
-
format_func=lambda s: "Default (6 kPa)" if s == REFERENCE_SUBSTRATE
|
| 288 |
-
else get_settings_of_category(s).get("name", s),
|
| 289 |
-
help="Young's modulus and pixel size of the substrate, given to the model as input channels.",
|
| 290 |
-
label_visibility="collapsed",
|
| 291 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
except FileNotFoundError:
|
| 293 |
st.error("config/substrate_settings.json not found")
|
| 294 |
|
|
|
|
| 277 |
if model_type == "single_cell":
|
| 278 |
try:
|
| 279 |
with st.container(border=False, key="s2f_grp_conditions"):
|
| 280 |
+
st.markdown(
|
| 281 |
+
'<p class="s2f-form-label s2f-form-label--section">Substrate setting (model input)</p>',
|
| 282 |
+
unsafe_allow_html=True,
|
| 283 |
+
help="Young's modulus of the gel and pixel size of the TFM reconstruction, given to the model "
|
| 284 |
+
"as two input channels. Select a preset (default: 6 kPa) or enter the values manually.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
)
|
| 286 |
+
conditions_source = st.radio(
|
| 287 |
+
"Substrate setting", ["Preset", "Manual"],
|
| 288 |
+
horizontal=True, label_visibility="collapsed",
|
| 289 |
+
)
|
| 290 |
+
if conditions_source == "Preset":
|
| 291 |
+
substrate_mode_label = "preset"
|
| 292 |
+
substrates = list_substrates()
|
| 293 |
+
if REFERENCE_SUBSTRATE in substrates: # the default preset is listed first
|
| 294 |
+
substrates = [REFERENCE_SUBSTRATE] + [s for s in substrates if s != REFERENCE_SUBSTRATE]
|
| 295 |
+
substrate_val = st.selectbox(
|
| 296 |
+
"Preset", substrates, index=0,
|
| 297 |
+
format_func=lambda s: "Default (6 kPa)" if s == REFERENCE_SUBSTRATE
|
| 298 |
+
else get_settings_of_category(s).get("name", s),
|
| 299 |
+
label_visibility="collapsed",
|
| 300 |
+
)
|
| 301 |
+
else:
|
| 302 |
+
substrate_mode_label = "manual"
|
| 303 |
+
manual_pixelsize = st.number_input(
|
| 304 |
+
"Pixel size of TFM reconstruction", min_value=0.1, max_value=50.0, value=3.0769, step=0.1,
|
| 305 |
+
format="%.4f",
|
| 306 |
+
help="Model input. The presets use 3.0769 for fibroblasts and 6.1538 for U2OS cells.")
|
| 307 |
+
manual_young = st.number_input(
|
| 308 |
+
"Young's modulus (Pa)", min_value=100.0, max_value=100000.0, value=6000.0, step=100.0,
|
| 309 |
+
format="%.0f", help="Model input. Young's modulus of the gel.")
|
| 310 |
+
substrate_config = {"pixelsize": manual_pixelsize, "young": manual_young}
|
| 311 |
+
use_manual = True
|
| 312 |
except FileNotFoundError:
|
| 313 |
st.error("config/substrate_settings.json not found")
|
| 314 |
|