|
| 1 | +# UTEA Progress Report |
| 2 | + |
| 3 | +**Name:** Reena Obmina |
| 4 | +**Project:** BAR API / ePlant Modernisation |
| 5 | +**Supervisor:** Vincent Lau & Nicholas Provart |
| 6 | +**Week:** 01 (April 13 - April 17) |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## 1. Overview |
| 11 | + |
| 12 | +Project kick-off, initial planning, and research. First meeting held to align on scope and establish a proposal and timeline. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## 2. Work Completed |
| 17 | + |
| 18 | +- Identified all CGI script locations used across ePlant |
| 19 | +- Established proposal structure and 16-week project timeline |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 3. Technical Details |
| 24 | + |
| 25 | +Met with Vincent and Dr. Provart remotely on Discord to discuss project scope, timeline, and expectations. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## 4. Challenges & Solutions |
| 30 | + |
| 31 | +| Challenge | Solution | |
| 32 | +|-----------|----------| |
| 33 | +| Many CGI scripts still in use across the codebase | Prioritised by complexity; phased 16-week migration plan | |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## 5. Results / Outcomes |
| 38 | + |
| 39 | +- Gained understanding of CGI script history and the motivation for removing them |
| 40 | +- Produced a full inventory of 9 CGI endpoints to migrate with file locations and complexity ratings |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## 6. Next Steps |
| 45 | + |
| 46 | +- Convert `/gene_information/gene_query` endpoint from POST to GET |
| 47 | +- Implement autocomplete feature |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## 7. Notes / Observations |
| 52 | + |
| 53 | +A compiled list of the CGI endpoints that need to be migrated. |
| 54 | + |
| 55 | + |
| 56 | +| # | Endpoint | File(s) | Complexity | |
| 57 | +|---|----------|---------|------------| |
| 58 | +| 1 | `idautocomplete.cgi` | `Species/arabidopsis/index.ts:13` | Low | |
| 59 | +| 2 | `querygene.cgi` | `Species/arabidopsis/index.ts:22`, `InteractionsViewer/scripts/eventHandlers.tsx:58` | Low | |
| 60 | +| 3 | `get_rank.php` | `views/eFP/Viewer/GeneDistributionChart.tsx:19` | Low | |
| 61 | +| 4 | `chromosomeinfo.cgi` | `views/ChromosomeViewer/ChromosomeView.tsx:145` | Medium | |
| 62 | +| 5 | `querygenesbyposition.cgi` | `views/ChromosomeViewer/Viewer/GeneList.tsx:45` | Medium | |
| 63 | +| 6 | `groupsuba4.php` | `InteractionsViewer/scripts/loadSublocalizations.tsx:78`, `CellEFP/CellEFPDataObject/index.tsx:43` | Medium (POST) | |
| 64 | +| 7 | `get_interactions_dapseq.py` | `views/InteractionsViewer/InteractionsView.tsx:236` | Medium | |
| 65 | +| 8 | `plantefp.cgi` | `views/eFP/index.tsx:63` | High (chunked, progress callbacks) | |
| 66 | +| 9 | `eplant_navigator_service.cgi` | `views/NavigatorView/NavigatorView.tsx:995` | High (multi-species tree) | |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +### 16-Week Roadmap |
| 71 | + |
| 72 | +**Phase 1 — Foundational Work (Weeks 1–4)** |
| 73 | + |
| 74 | +- **Wk 1–2:** `idautocomplete.cgi` — `Species/arabidopsis/index.ts:13`. Simple GET, returns gene ID suggestions. *(finishing this week)* |
| 75 | +- **Wk 3–4:** `querygene.cgi` — two call sites (`index.ts:22` and `eventHandlers.tsx:58`). Wire up REST replacement in both and verify tooltip generation still works in InteractionsViewer. |
| 76 | + |
| 77 | +**Phase 2 — Chromosome Viewer (Weeks 5–8)** |
| 78 | + |
| 79 | +- **Wk 5–6:** `chromosomeinfo.cgi` — `ChromosomeViewer/ChromosomeView.tsx:145`. Returns chromosome structural data; test that the diagram renders correctly. |
| 80 | +- **Wk 7–8:** `querygenesbyposition.cgi` — `ChromosomeViewer/Viewer/GeneList.tsx:45`. Depends on chromosome data; do after chromosomeinfo. Test gene list populating on chromosome region click. |
| 81 | + |
| 82 | +**Phase 3 — Expression & Ranking (Weeks 9–11)** |
| 83 | + |
| 84 | +- **Wk 9–10:** `get_rank.php` — `eFP/Viewer/GeneDistributionChart.tsx:19`. Single call returning a percentile; verify distribution chart renders correctly after. |
| 85 | +- **Wk 11:** Integration testing of Phases 1–3, catch regressions, supervisor check-in. |
| 86 | + |
| 87 | +**Phase 4 — Interactions & Localization (Weeks 12–14)** |
| 88 | + |
| 89 | +- **Wk 12–13:** `groupsuba4.php` — two call sites (`loadSublocalizations.tsx:78` and `CellEFPDataObject/index.tsx:43`). Only POST endpoint in the list; verify subcellular localisation overlays in both the Interactions and Cell EFP views. |
| 90 | +- **Wk 14:** `get_interactions_dapseq.py` — `InteractionsViewer/InteractionsView.tsx:236`. DAP-seq interaction graph data; test that the force-directed graph still loads. |
| 91 | + |
| 92 | +**Phase 5 — Heavy lifters (Weeks 15–16)** |
| 93 | + |
| 94 | +- **Wk 15–16:** `plantefp.cgi` — `views/eFP/index.tsx:63`. Chunked fetch with progress callbacks — most complex call in the codebase. Sample batching logic will need rethinking for the new API. |
| 95 | +- `eplant_navigator_service.cgi`? Multi-species, returns a nested tree (`NavigatorView.tsx:995`). May run into Week 17+ or be scoped separately. |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +### CGI (Common Gateway Interface) |
| 100 | + |
| 101 | +What is CGI? |
| 102 | +- CGI = Common Gateway Interface |
| 103 | +- Early web standard for connecting web servers to programs/scripts |
| 104 | +- Flow: |
| 105 | + - Server receives request |
| 106 | + - Launches a new process |
| 107 | + - Passes data via environment variables or stdin |
| 108 | + - Script outputs response to stdout |
| 109 | +- Commonly used with: |
| 110 | + - Perl |
| 111 | + - Python |
| 112 | + - PHP |
| 113 | + |
| 114 | +Why CGI Is Being Deprecated/Replaced? |
| 115 | +- Inefficient: |
| 116 | + - New process per request makes it slow and resource-heavy |
| 117 | +- Poor scalability: |
| 118 | + - Does not handle high traffic well |
| 119 | +- Outdated architecture: |
| 120 | + - No persistent state or connection handling |
| 121 | +- Harder to maintain: |
| 122 | + - Requires manual request and response parsing |
| 123 | +- Replaced by: |
| 124 | + - Persistent application servers |
| 125 | + - Structured frameworks with routing, middleware, and APIs |
| 126 | + |
| 127 | +As for CGI in Python... |
| 128 | +- `cgi` module: |
| 129 | + - Deprecated in Python 3.11 |
| 130 | + - Removed in Python 3.13 |
| 131 | +- Part of PEP 594 (removal of outdated standard library modules) |
| 132 | +- Also deprecated: |
| 133 | + - `CGIHTTPRequestHandler` |
| 134 | + - `http.server --cgi` |
| 135 | +- Reason: |
| 136 | + - Shift toward modern web architectures |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +Perl |
| 141 | +- CGI is not removed from the language |
| 142 | +- `CGI.pm` module still exists and is maintained |
| 143 | +- Still usable but considered legacy |
| 144 | +- Modern Perl applications often use: |
| 145 | + - FastCGI |
| 146 | + - mod_perl |
| 147 | + - Web frameworks (e.g., Dancer, Mojolicious) |
| 148 | + |
| 149 | +PHP |
| 150 | +- CGI is still supported via CGI SAPI (`php-cgi`) |
| 151 | +- Not commonly used in modern deployments |
| 152 | +- Standard modern setup: |
| 153 | + - PHP-FPM (FastCGI Process Manager) |
| 154 | +- Key idea: |
| 155 | + - CGI exists but is not the preferred architecture |
0 commit comments