Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -380,6 +380,15 @@ with tab4:
|
|
| 380 |
st.subheader("Decoded String (continuous across rows)")
|
| 381 |
st.write(decoded_string)
|
| 382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
# Tab 5: Binary → String
|
| 384 |
with tab5:
|
| 385 |
st.header("Decode Binary Labels to String")
|
|
@@ -497,7 +506,7 @@ with tab5:
|
|
| 497 |
for row_idx, sample in df_31_robot.iterrows():
|
| 498 |
if sample[col] == 1:
|
| 499 |
source = source_wells_31[i]
|
| 500 |
-
dest =
|
| 501 |
vol = round(sample['volume donors (µl)'], 2)
|
| 502 |
robot_script_31.append({'Source': source, 'Destination': dest, 'Volume': vol})
|
| 503 |
|
|
|
|
| 380 |
st.subheader("Decoded String (continuous across rows)")
|
| 381 |
st.write(decoded_string)
|
| 382 |
|
| 383 |
+
def get_well_position(sample_index):
|
| 384 |
+
"""
|
| 385 |
+
Convert sample index (1-based) into well position (e.g., A1, A2, ..., B1, B2, ..., etc.)
|
| 386 |
+
"""
|
| 387 |
+
row_letter = chr(65 + (sample_index - 1) // 12) # 65 = 'A'
|
| 388 |
+
col_number = ((sample_index - 1) % 12) + 1
|
| 389 |
+
return f"{row_letter}{col_number}"
|
| 390 |
+
|
| 391 |
+
|
| 392 |
# Tab 5: Binary → String
|
| 393 |
with tab5:
|
| 394 |
st.header("Decode Binary Labels to String")
|
|
|
|
| 506 |
for row_idx, sample in df_31_robot.iterrows():
|
| 507 |
if sample[col] == 1:
|
| 508 |
source = source_wells_31[i]
|
| 509 |
+
dest = get_well_position(int(sample['Sample']))
|
| 510 |
vol = round(sample['volume donors (µl)'], 2)
|
| 511 |
robot_script_31.append({'Source': source, 'Destination': dest, 'Volume': vol})
|
| 512 |
|