# GelPredict Power Tools Guide ## Overview Two advanced features for high-throughput data entry and experimental design: 1. **🔁 Clone This Well** - Duplicate wells for replicates 2. **🧩 Plate Map Wizard** - Bulk-create entire plate layouts ## 🔁 Clone This Well ### Purpose Create multiple copies of an existing well with the same metadata and reagents. Perfect for: - Technical replicates - Biological replicates across adjacent wells - Time-course experiments with identical starting conditions ### Location **📊 View/Edit Data** → Select a well → Scroll to "🔁 Clone this well" ### How to Use 1. **Navigate to View/Edit Data** 2. **Select the well you want to clone** 3. **Configure clone parameters:** - **How many clones?** (1-96) - **Clone reagents** ✓ (checkbox) - **Operator override** (optional) - **Batch override** (optional) - **Plate ID** (where clones will live) - **Start column** (clones go horizontally: Col 1, 2, 3...) - **Row** (A-H) - **Replicate start** (auto-increments for each clone) 4. **Click "✨ Create clones"** ### Example Use Case **Scenario:** You have a well at A1 with a specific collagen formulation. You want 3 technical replicates at A2, A3, A4. ``` Template well: A1 (batch B2025-043, 7 mg/mL collagen, pH 7.2) Clones: 3 Clone reagents: ✓ Row: A Start column: 2 Replicate start: 1 ``` **Result:** - A2: replicate_id=1, new UUID, same reagents - A3: replicate_id=2, new UUID, same reagents - A4: replicate_id=3, new UUID, same reagents ### What Gets Copied ✅ **Copied:** - family, batch_id, donor_id - Composition measurements (protein, pH, conductivity, UV, SDS) - Test conditions (probe_type, target_pH, temp) - Storage info (pre_storage_days, freeze cycles) - Reagents (if checkbox selected) - notes_pre ❌ **Not Copied:** - record_id (new UUID generated) - Outcomes (gel_binary, gel_strength, time_to_halfmax) - Kinetics (slope_OD, final_OD, lag_time) - App predictions - notes_post (filled after experiment) ### Benefits - ⏱️ **Time savings:** 30 seconds per replicate → bulk create in 5 seconds - 🎯 **Accuracy:** No manual re-entry errors - 🧫 **Consistency:** Exact same reagent formulation - 📊 **Traceability:** All clones linked by batch_id ## 🧩 Plate Map Wizard ### Purpose Bulk-create wells across entire plate layouts. Perfect for: - Full 96-well plate setups - Factorial designs (varying pH across rows, ionic strength across columns) - High-throughput screening - Batch processing ### Location **🧩 Plate Map Wizard** (navigation menu) ### How to Use #### Option A: With Template Well 1. **Navigate to Plate Map Wizard** 2. **Select a template well** (optional but recommended) - Choose from dropdown - Template provides base metadata 3. **Override fields** (optional): - Family, Batch ID, Operator ID - Plate ID - pH, temperature, protein concentration 4. **Configure plate geometry:** - **Plate type:** 96-well (8x12), 48-well (6x8), or 24-well (4x6) - **Rows:** Select which rows to use (A-H) - **Column range:** Start and end columns - **Replicate start:** Auto-increments across wells 5. **Reagents:** Check "Copy reagents from template well" if desired 6. **Preview:** See planned wells (row × col × replicate_id) 7. **Click "🚀 Create wells"** #### Option B: From Scratch 1. **Template well:** Select "(none)" 2. **Fill in base metadata:** - ECM Family, Batch ID, Operator ID - Plate ID - Target pH, temperature - Pre-pH, protein, conductivity 3. **Configure geometry** (same as Option A) 4. **Create wells** ### Example Use Cases #### Use Case 1: Full 96-well plate with pH gradient ``` Template: Existing well with collagen batch B2025-043 Plate: 96 (8x12) Rows: A-H (all rows) Columns: 1-12 (full plate) Clone reagents: ✓ Result: 96 wells created, all with same base formulation You can then manually adjust pH for each row/column ``` #### Use Case 2: 2×6 mini-experiment (no template) ``` Template: (none) Family: collagen_decECM Batch ID: B2025-044 Operator ID: AW Plate ID: Plate-001 pH: 7.2, Temp: 37°C, Protein: 8.0 mg/mL Plate: 96 (8x12) Rows: A, B Columns: 1-6 Replicate start: 1 Result: 12 wells created (A1-A6, B1-B6) with replicate_id 1-12 ``` #### Use Case 3: Clone template across 2 rows ``` Template: Well XYZ (has 4 reagents defined) Rows: C, D Columns: 1-8 Clone reagents: ✓ Result: 16 wells (C1-C8, D1-D8), all with same 4 reagents ``` ### What Gets Created Each well receives: - **Unique UUID** (record_id) - **Today's date** - **Specified row/column position** - **Auto-incremented replicate_id** - **Base metadata** (from template or overrides) - **Reagents** (if cloning enabled) - **Empty outcomes** (ready for measurement) ### Preview Table Before creation, you'll see: ``` | row | col | replicate_id | |-----|-----|--------------| | A | 1 | 1 | | A | 2 | 2 | | A | 3 | 3 | | ... ``` ### Performance - **Transaction-safe:** Each well+reagents created atomically - **Speed:** ~100 wells in < 5 seconds - **Memory:** Handles up to 384 wells (four 96-well plates) ## 💡 Pro Tips ### Clone This Well **Tip 1: Horizontal replicates** ``` Template: A1 Clones: 5 Row: A Start column: 2 → Creates A2, A3, A4, A5, A6 ``` **Tip 2: Same position, different batch** ``` Template: A1 (batch B-001) Clones: 1 Batch override: B-002 Row: A Start column: 1 → Creates new well at A1 for batch B-002 ``` **Tip 3: Quick replicates without reagents** ``` Clone reagents: ☐ (unchecked) → Copies metadata only → Then go to Reagents Manager and add custom reagents per well ``` ### Plate Map Wizard **Tip 1: Full plate in one click** ``` Template: Your validated formulation Rows: A-H (all 8) Columns: 1-12 (all 12) → 96 wells instantly ``` **Tip 2: Stripe pattern (rows = conditions)** ``` Rows: A (pH 6.8), B (pH 7.0), C (pH 7.2), D (pH 7.4) Columns: 1-6 (replicates) Clone reagents: ✓ → Create 24 wells, then edit each row's pH ``` **Tip 3: Time course** ``` Rows: A Columns: 1-12 (one per time point) Clone reagents: ✓ → Create 12 wells with identical starting conditions → Sacrifice one well at each time point → Log events for kinetic analysis ``` **Tip 4: No template, just blanks** ``` Template: (none) Family, Batch, Operator filled in → Creates wells with minimal metadata → Complete characterization later as data becomes available ``` ## 🔒 Safety Features ### Data Integrity - ✅ **UUID collision prevention:** Each well gets unique UUID - ✅ **Transaction safety:** Entire clone/bulk operation is atomic - ✅ **Foreign key enforcement:** Reagents automatically linked to wells - ✅ **Cascade delete:** Deleting a template doesn't affect clones ### Validation - ✅ **Plate geometry enforced:** Can't select invalid rows/columns - ✅ **Position preview:** See exactly what will be created - ✅ **Error handling:** Failed clones don't corrupt database - ✅ **Rollback on failure:** All-or-nothing creation ### Audit Trail - ✅ **created_at timestamp:** Know when clones were made - ✅ **operator_id tracked:** Know who created the clones - ✅ **Distinct UUIDs:** Each clone is a separate, traceable record ## 📊 Typical Workflows ### Workflow 1: Validation Plate **Goal:** Test a new formulation across multiple pH values 1. Enter one well manually with full characterization (A1) 2. Navigate to Plate Map Wizard 3. Select that well as template 4. Create A1-A8, B1-B8 (16 wells) 5. Edit each well to adjust pH (7.0, 7.1, 7.2, ..., 7.7) 6. Run experiments 7. Log outcomes and events ### Workflow 2: Technical Replicates **Goal:** Run triplicates of a validated recipe 1. Navigate to View/Edit Data 2. Select your validated well 3. Scroll to "Clone this well" 4. Set clones: 3, clone reagents: ✓ 5. Create clones 6. Run all 4 wells (original + 3 clones) simultaneously ### Workflow 3: Batch Comparison **Goal:** Compare 3 different batches with identical conditions 1. Create template well for Batch A 2. Clone with batch override → Batch B, Batch C 3. All wells have same pH, temp, reagents 4. Only difference: batch_id 5. Measure outcomes to assess batch variability ### Workflow 4: Factorial Design **Goal:** 3 pH levels × 4 ionic strengths = 12 conditions 1. Create template with base formulation 2. Plate Map Wizard: Rows A-C, Columns 1-4 3. Edit each well: - Row A: pH 6.8 - Row B: pH 7.2 - Row C: pH 7.6 - Then adjust NaCl for columns (1=100mM, 2=120mM, 3=140mM, 4=160mM) 4. Run factorial experiment ## ⚠️ Common Pitfalls ### Pitfall 1: Forgot to override batch_id **Problem:** Cloned 96 wells, all have same batch_id as template **Fix:** Use "Batch override" field **Prevention:** Always specify batch_id when cloning across batches ### Pitfall 2: Overlapping positions **Problem:** Created wells at A1-A6, then A4-A8 (A4, A5, A6 duplicate) **Impact:** Second batch fails with "Record ID already exists" (different UUIDs) **Fix:** Check existing wells first, or use different rows **Prevention:** Preview table shows all positions before creation ### Pitfall 3: Cloned outcomes **Problem:** Template had gel_binary=1, clones also marked as success **Reality:** Clones DON'T copy outcomes (by design) **Why:** Outcomes must be measured, not cloned ### Pitfall 4: Too many clones **Problem:** Tried to create 1000 wells at once **Impact:** Long wait, potential timeout **Fix:** Create in batches of 96 **Prevention:** Wizard warns if > 100 wells selected ## 🎓 Advanced Techniques ### Technique 1: Parameterized Sweep Create a grid of conditions: ```python # Template well with base recipe Template: record_id ABC123 # Plate Map Wizard Rows: A-H (8 pH values) Columns: 1-6 (6 ionic strengths) → 48 wells # Then programmatically edit via SQL or CSV export/import: pH_values = np.linspace(6.8, 7.6, 8) ionic_values = np.linspace(100, 200, 6) for row_idx, pH in enumerate(pH_values): for col_idx, ionic in enumerate(ionic_values): # Update well at (row, col) with (pH, ionic) ``` ### Technique 2: Pre-populate from AI Recommendations ``` 1. Get AI recipe recommendation (pH 7.3, NaCl 135 mM) 2. Create template well with those conditions 3. Clone 6 times (replicates) 4. Run experiments to validate AI prediction ``` ### Technique 3: Batch Migration Moving from old batch to new batch: ``` 1. Filter View/Edit by old batch_id 2. Select one representative well 3. Clone with batch override = new_batch_id 4. Repeat for each formulation type → Migrates protocols to new batch systematically ``` ## 📈 Performance Metrics | Operation | Wells | Time | Database Operations | |-----------|-------|------|---------------------| | Clone 1 well | 1 | < 0.1s | 1 INSERT (well) + N INSERTs (reagents) | | Clone 10 wells | 10 | < 1s | 10 wells + 40 reagents (if 4 reagents/well) | | Plate Map (96 wells, no reagents) | 96 | ~3s | 96 INSERTs | | Plate Map (96 wells, 4 reagents each) | 96 | ~5s | 96 + 384 INSERTs | All operations are transaction-wrapped, so failures rollback completely. ## 🔐 Security & Data Integrity ### Clone Safety - **Unique UUIDs:** Each clone gets a new UUID (no collisions) - **Independent records:** Editing a clone doesn't affect the original - **Outcome isolation:** Clones don't inherit experimental results - **Audit trail:** created_at shows when clone was made ### Bulk Creation Safety - **Atomic transactions:** All wells created or none - **Foreign key enforcement:** Reagents can't orphan - **Position validation:** Can't exceed plate dimensions - **Duplicate detection:** SQLite UNIQUE constraint prevents duplicate positions if schema enforced ## 🛠️ Troubleshooting ### Issue: "Record ID already exists" **Cause:** UUID collision (extremely rare) or trying to clone to same position **Solution:** Click "Create clones" again (generates new UUIDs) ### Issue: Clone created but reagents missing **Cause:** "Clone reagents" was unchecked **Solution:** Go to Reagents Manager and add manually, or delete clone and recreate with checkbox on ### Issue: Plate Map created wells with wrong metadata **Cause:** Template well had incorrect values **Solution:** Delete batch of wells, fix template, regenerate **Prevention:** Preview table shows what will be created; verify before clicking "Create" ### Issue: Clones have same replicate_id **Cause:** Replicate start was not set, defaults to template value **Solution:** Set "Replicate start" to 1 (or appropriate value); clones auto-increment from there ### Issue: Bulk create failed halfway **Cause:** CHECK constraint violation (e.g., pH > 14) **Impact:** Transaction rolled back, no wells created **Solution:** Fix invalid values in template/overrides, retry **Evidence:** All-or-nothing atomicity protects database ## 📚 Integration with Other Features ### With Events Logger After bulk-creating wells: 1. Navigate to Events Logger 2. Select first well 3. Log initial observation (t=0) 4. Repeat for remaining wells 5. Log time-series events as experiment progresses ### With Export Bulk-created wells appear immediately in: - View/Edit Data (filter by plate_id or batch_id) - Export → Wells CSV - Export → Excel workbook (Pivots by plate) ### With AI Predictions Future enhancement: 1. Create template from AI recommendation 2. Plate Map Wizard → 96 wells 3. Run experiments 4. Compare actual vs predicted gel_binary 5. Retrain model with batch results ## 🎯 Best Practices ### Before Cloning - ✅ Verify template well has correct metadata - ✅ Check reagents are properly defined - ✅ Decide if you need reagent cloning - ✅ Plan plate layout (sketch on paper first) ### During Bulk Creation - ✅ Start small (test with 6 wells before doing 96) - ✅ Use descriptive plate_ids (e.g., "Plate-pH-Screen-001") - ✅ Preview the table before creating - ✅ Take note of replicate_id numbering ### After Creation - ✅ Verify wells in View/Edit Data - ✅ Spot-check reagents in Reagents Manager - ✅ Edit any per-well variations (pH, etc.) - ✅ Log initial events (t=0 observations) ## 📊 Example Scenarios ### Scenario 1: Time Course (Gelation Kinetics) **Setup:** - Template: Well with 6 mg/mL collagen, pH 7.2 - Clone 12 wells (one per time point: 0, 5, 10, 15, 20, 30, 45, 60, 90, 120, 180, 240 min) - Same row, columns 1-12 **Execution:** 1. Mix master batch 2. Aliquot to 12 wells at t=0 3. At each time point: measure OD, log event, tilt test 4. Final outcomes: plot time_to_halfmax vs predicted ### Scenario 2: Factorial Design (pH × Ionic) **Setup:** - 4 pH levels (7.0, 7.2, 7.4, 7.6) - 6 NaCl levels (100, 120, 140, 160, 180, 200 mM) - 24 total conditions **Execution:** 1. Plate Map Wizard: Rows A-D, Columns 1-6 2. Edit each row: A=pH 7.0, B=7.2, C=7.4, D=7.6 3. Add reagents per column for NaCl gradient 4. Run plate, log outcomes 5. Analyze which (pH, ionic) combinations gel ### Scenario 3: Batch Validation **Setup:** - New batch needs testing at 3 standard conditions - 3 replicates per condition - 9 total wells **Execution:** 1. Create 3 template wells (low pH, medium pH, high pH) 2. Clone each template 3 times 3. Run all 9 wells 4. Compare to historical batch performance ## 🚀 Efficiency Gains | Task | Manual Entry | With Power Tools | Time Saved | |------|--------------|------------------|------------| | 3 technical replicates | 3 × 2 min = 6 min | 10 sec | 5.8 min | | 96-well plate | 96 × 2 min = 192 min | 30 sec | 191.5 min (3+ hours!) | | 24-well factorial | 24 × 2 min = 48 min | 20 sec | 47.7 min | **Average time savings:** **95-98%** for replicate/plate experiments ## 🔮 Future Enhancements Planned features: - [ ] Visual plate map (click wells to select) - [ ] CSV import for plate layout (upload Excel with positions) - [ ] Conditional creation (create only if position empty) - [ ] Pattern-based naming (auto-generate record_ids like "PlateA_A01") - [ ] Reagent gradients (auto-vary concentration across columns) - [ ] Bulk edit (select multiple wells, change pH in batch) ## 📝 Documentation Related docs: - **QUICKSTART.md** - General GUI usage - **README_APP_ARCHITECTURE.md** - System design - **PREFLIGHT_CHECKLIST.md** - Validation and safety - **DATA_PREP.md** - Measurement protocols ## 🆘 Support If you encounter issues: 1. **Check error message** - Usually explains what went wrong 2. **Verify template** - Make sure template well exists and has valid data 3. **Preview before creating** - Use the preview table to catch issues 4. **Test small first** - Try 2-3 wells before bulk-creating 96 5. **Check database** - Ensure gelpredict.db is not locked ## ✅ Success Checklist Your power tools are working well when: - [x] Clone creates exact duplicates (except outcomes) - [x] Reagents copy correctly when checkbox selected - [x] Plate Map preview matches your intent - [x] Replicate IDs auto-increment properly - [x] Bulk creation completes in < 10 seconds - [x] All wells appear in View/Edit Data - [x] No duplicate position errors (if properly designed) --- **Version:** 2.0 **Last Updated:** October 11, 2025 **Status:** Production-ready **Efficiency:** 95%+ time savings on plate-based experiments 🚀