Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -393,7 +393,7 @@ with tab5:
|
|
| 393 |
st.header("Decode Binary Labels to String")
|
| 394 |
|
| 395 |
# Utility: Track source volumes and update if exceeds limit
|
| 396 |
-
def track_and_replace_source(source_list, robot_script, volume_limit=
|
| 397 |
source_volumes = {}
|
| 398 |
adjusted_sources = []
|
| 399 |
|
|
@@ -422,37 +422,33 @@ with tab5:
|
|
| 422 |
|
| 423 |
return adjusted_sources, source_volumes
|
| 424 |
|
| 425 |
-
# Utility:
|
| 426 |
-
def
|
| 427 |
d_source_volumes = {}
|
| 428 |
d_source_script = []
|
| 429 |
current_d_index = 1
|
| 430 |
|
| 431 |
-
|
|
|
|
|
|
|
| 432 |
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
if col in sample and int(sample[col]) == 1:
|
| 436 |
-
current_d_well = f"D{current_d_index}"
|
| 437 |
-
if current_d_well not in d_source_volumes:
|
| 438 |
-
d_source_volumes[current_d_well] = 0
|
| 439 |
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
|
| 445 |
-
|
|
|
|
| 446 |
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
'Volume': fixed_volume,
|
| 454 |
-
'Tool': tool
|
| 455 |
-
})
|
| 456 |
|
| 457 |
return d_source_script, d_source_volumes
|
| 458 |
|
|
@@ -534,7 +530,7 @@ with tab5:
|
|
| 534 |
|
| 535 |
robot_script_32, source_volumes_32 = track_and_replace_source(source_wells_32, robot_script_32)
|
| 536 |
|
| 537 |
-
d_script, d_volumes =
|
| 538 |
full_robot_script = robot_script_32 + d_script
|
| 539 |
|
| 540 |
robot_script_32_df = pd.DataFrame(full_robot_script)
|
|
|
|
| 393 |
st.header("Decode Binary Labels to String")
|
| 394 |
|
| 395 |
# Utility: Track source volumes and update if exceeds limit
|
| 396 |
+
def track_and_replace_source(source_list, robot_script, volume_limit=180):
|
| 397 |
source_volumes = {}
|
| 398 |
adjusted_sources = []
|
| 399 |
|
|
|
|
| 422 |
|
| 423 |
return adjusted_sources, source_volumes
|
| 424 |
|
| 425 |
+
# Utility: Generate fixed-volume D source for all wells
|
| 426 |
+
def generate_fixed_d_source_instructions_for_all_wells(fixed_volume=16, volume_limit=170):
|
| 427 |
d_source_volumes = {}
|
| 428 |
d_source_script = []
|
| 429 |
current_d_index = 1
|
| 430 |
|
| 431 |
+
all_destinations = [f"{row}{col}" for row in "ABCDEFGH" for col in range(1, 13)]
|
| 432 |
+
for dest in all_destinations:
|
| 433 |
+
current_d_well = f"D{current_d_index}"
|
| 434 |
|
| 435 |
+
if current_d_well not in d_source_volumes:
|
| 436 |
+
d_source_volumes[current_d_well] = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 437 |
|
| 438 |
+
if d_source_volumes[current_d_well] + fixed_volume > volume_limit:
|
| 439 |
+
current_d_index += 1
|
| 440 |
+
current_d_well = f"D{current_d_index}"
|
| 441 |
+
d_source_volumes[current_d_well] = 0
|
| 442 |
|
| 443 |
+
d_source_volumes[current_d_well] += fixed_volume
|
| 444 |
+
tool = 'TS_10' if fixed_volume < 10 else 'TS_50'
|
| 445 |
|
| 446 |
+
d_source_script.append({
|
| 447 |
+
'Source': current_d_well,
|
| 448 |
+
'Destination': dest,
|
| 449 |
+
'Volume': fixed_volume,
|
| 450 |
+
'Tool': tool
|
| 451 |
+
})
|
|
|
|
|
|
|
|
|
|
| 452 |
|
| 453 |
return d_source_script, d_source_volumes
|
| 454 |
|
|
|
|
| 530 |
|
| 531 |
robot_script_32, source_volumes_32 = track_and_replace_source(source_wells_32, robot_script_32)
|
| 532 |
|
| 533 |
+
d_script, d_volumes = generate_fixed_d_source_instructions_for_all_wells()
|
| 534 |
full_robot_script = robot_script_32 + d_script
|
| 535 |
|
| 536 |
robot_script_32_df = pd.DataFrame(full_robot_script)
|