Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -424,42 +424,39 @@ with tab5:
|
|
| 424 |
return adjusted_sources, source_volumes
|
| 425 |
|
| 426 |
# Utility: Track D source volume separately for fixed-volume dispensing
|
| 427 |
-
# Updateed
|
| 428 |
def generate_fixed_d_source_instructions(df_robot, fixed_volume=16, volume_limit=170):
|
| 429 |
d_source_volumes = {}
|
| 430 |
d_source_script = []
|
| 431 |
current_d_index = 1
|
| 432 |
-
|
| 433 |
-
# Only use the actual 32 site mutation headers
|
| 434 |
mutation_headers = [str(h) for h in mutation_site_headers_actual_3614]
|
| 435 |
-
|
| 436 |
for row_idx, sample in df_robot.iterrows():
|
| 437 |
for col in mutation_headers:
|
| 438 |
if col in sample and int(sample[col]) == 1:
|
|
|
|
| 439 |
current_d_well = f"D{current_d_index}"
|
| 440 |
-
|
| 441 |
if current_d_well not in d_source_volumes:
|
| 442 |
d_source_volumes[current_d_well] = 0
|
| 443 |
-
|
| 444 |
if d_source_volumes[current_d_well] + fixed_volume > volume_limit:
|
| 445 |
current_d_index += 1
|
| 446 |
current_d_well = f"D{current_d_index}"
|
| 447 |
d_source_volumes[current_d_well] = 0
|
| 448 |
-
|
| 449 |
d_source_volumes[current_d_well] += fixed_volume
|
| 450 |
-
|
| 451 |
dest = get_well_position(int(sample['Sample']))
|
| 452 |
tool = 'TS_10' if fixed_volume < 10 else 'TS_50'
|
| 453 |
-
|
| 454 |
d_source_script.append({
|
| 455 |
'Source': current_d_well,
|
| 456 |
'Destination': dest,
|
| 457 |
'Volume': fixed_volume,
|
| 458 |
'Tool': tool
|
| 459 |
})
|
| 460 |
-
|
| 461 |
-
return d_source_script, d_source_volumes
|
| 462 |
|
|
|
|
| 463 |
|
| 464 |
# ========== 32-BIT DECODING ==========
|
| 465 |
st.subheader("32-bit Binary per Row")
|
|
|
|
| 424 |
return adjusted_sources, source_volumes
|
| 425 |
|
| 426 |
# Utility: Track D source volume separately for fixed-volume dispensing
|
|
|
|
| 427 |
def generate_fixed_d_source_instructions(df_robot, fixed_volume=16, volume_limit=170):
|
| 428 |
d_source_volumes = {}
|
| 429 |
d_source_script = []
|
| 430 |
current_d_index = 1
|
| 431 |
+
|
|
|
|
| 432 |
mutation_headers = [str(h) for h in mutation_site_headers_actual_3614]
|
| 433 |
+
|
| 434 |
for row_idx, sample in df_robot.iterrows():
|
| 435 |
for col in mutation_headers:
|
| 436 |
if col in sample and int(sample[col]) == 1:
|
| 437 |
+
# Check current D well volume
|
| 438 |
current_d_well = f"D{current_d_index}"
|
|
|
|
| 439 |
if current_d_well not in d_source_volumes:
|
| 440 |
d_source_volumes[current_d_well] = 0
|
| 441 |
+
|
| 442 |
if d_source_volumes[current_d_well] + fixed_volume > volume_limit:
|
| 443 |
current_d_index += 1
|
| 444 |
current_d_well = f"D{current_d_index}"
|
| 445 |
d_source_volumes[current_d_well] = 0
|
| 446 |
+
|
| 447 |
d_source_volumes[current_d_well] += fixed_volume
|
| 448 |
+
|
| 449 |
dest = get_well_position(int(sample['Sample']))
|
| 450 |
tool = 'TS_10' if fixed_volume < 10 else 'TS_50'
|
| 451 |
+
|
| 452 |
d_source_script.append({
|
| 453 |
'Source': current_d_well,
|
| 454 |
'Destination': dest,
|
| 455 |
'Volume': fixed_volume,
|
| 456 |
'Tool': tool
|
| 457 |
})
|
|
|
|
|
|
|
| 458 |
|
| 459 |
+
return d_source_script, d_source_volumes
|
| 460 |
|
| 461 |
# ========== 32-BIT DECODING ==========
|
| 462 |
st.subheader("32-bit Binary per Row")
|