Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,6 +37,7 @@ def get_well_position(sample_index):
|
|
| 37 |
col_number = ((sample_index - 1) % 12) + 1 # 12 columns
|
| 38 |
return f"{row_letter}{col_number}"
|
| 39 |
|
|
|
|
| 40 |
def get_plate_id(sample_index):
|
| 41 |
"""Return Plate number based on 96 samples per plate"""
|
| 42 |
plate_number = math.ceil(sample_index / 96)
|
|
@@ -163,14 +164,15 @@ if not df_binary.empty:
|
|
| 163 |
source_wells = generate_source_wells(df_robot.shape[1] - 1)
|
| 164 |
|
| 165 |
for i, col in enumerate(df_robot.columns[1:]):
|
| 166 |
-
for
|
| 167 |
if sample['# donors'] == 0:
|
| 168 |
continue # skip samples with no donors
|
| 169 |
if int(sample[col]) == 1:
|
| 170 |
sample_id = int(sample['Sample'])
|
| 171 |
-
|
|
|
|
| 172 |
source = source_wells[i]
|
| 173 |
-
dest = get_well_position(
|
| 174 |
vol = round(sample['volume donors (µL)'], 2)
|
| 175 |
tool = 'TS_50' if vol > 10 else 'TS_10'
|
| 176 |
robot_script.append({
|
|
|
|
| 37 |
col_number = ((sample_index - 1) % 12) + 1 # 12 columns
|
| 38 |
return f"{row_letter}{col_number}"
|
| 39 |
|
| 40 |
+
|
| 41 |
def get_plate_id(sample_index):
|
| 42 |
"""Return Plate number based on 96 samples per plate"""
|
| 43 |
plate_number = math.ceil(sample_index / 96)
|
|
|
|
| 164 |
source_wells = generate_source_wells(df_robot.shape[1] - 1)
|
| 165 |
|
| 166 |
for i, col in enumerate(df_robot.columns[1:]):
|
| 167 |
+
for row_idx, sample in df_robot.iterrows():
|
| 168 |
if sample['# donors'] == 0:
|
| 169 |
continue # skip samples with no donors
|
| 170 |
if int(sample[col]) == 1:
|
| 171 |
sample_id = int(sample['Sample'])
|
| 172 |
+
sample_index = row_idx + 1
|
| 173 |
+
plate = get_plate_id(sample_index)
|
| 174 |
source = source_wells[i]
|
| 175 |
+
dest = get_well_position(sample_index)
|
| 176 |
vol = round(sample['volume donors (µL)'], 2)
|
| 177 |
tool = 'TS_50' if vol > 10 else 'TS_10'
|
| 178 |
robot_script.append({
|