wenjun99 commited on
Commit
3bc082e
·
verified ·
1 Parent(s): eaba82e

updated generate_fixed_d_source_instructions

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -424,38 +424,43 @@ with tab5:
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
  for row_idx, sample in df_robot.iterrows():
433
- for col in df_robot.columns[1:]:
434
- if int(sample[col]) == 1:
435
- # Check current D well volume
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
  if d_source_volumes[current_d_well] + fixed_volume > volume_limit:
441
  current_d_index += 1
442
  current_d_well = f"D{current_d_index}"
443
  d_source_volumes[current_d_well] = 0
444
-
445
  d_source_volumes[current_d_well] += fixed_volume
446
-
447
  dest = get_well_position(int(sample['Sample']))
448
  tool = 'TS_10' if fixed_volume < 10 else 'TS_50'
449
-
450
  d_source_script.append({
451
  'Source': current_d_well,
452
  'Destination': dest,
453
  'Volume': fixed_volume,
454
  'Tool': tool
455
  })
456
-
457
  return d_source_script, d_source_volumes
458
 
 
459
  # ========== 32-BIT DECODING ==========
460
  st.subheader("32-bit Binary per Row")
461
  st.write("Upload CSV with 32 columns (0 or 1), no headers, from EF Binary format or enter manually below.")
 
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")
466
  st.write("Upload CSV with 32 columns (0 or 1), no headers, from EF Binary format or enter manually below.")