Software
Introduction
Precise medication management remains a significant challenge in treating Type 2 Diabetes Mellitus (T2DM), particularly for patients receiving complex regimens such as combined insulin and GLP-1 receptor agonist therapy. Dosages must be continuous fine-tuning based on dynamic factors including blood glucose levels, dietary intake, and individual metabolic variability. This challenge is further compounded in combination therapy, where synergistic drug interactions make manual dose calculations highly error-prone. Current digital aids are insufficient: most insulin calculators are designed for Type 1 Diabetes and lack integration with GLP-1 therapies, increasing the risk of suboptimal glycemic control.
This challenge of precise dosage control lies at the core of our project. The promise of our LEGO gene therapy system—to produce insulin and GLP-1 on demand using light—rests on a fundamental translational question: how can a required biological dose be converted into a precise instruction for light delivery? Clinicians and patients naturally think in terms of drug units, not in terms of light intensity or duration needed to actuate a genetic circuit.
To bridge this gap, we developed the DiaPlan, a web-based software platform that supports critical therapeutic decision-making. By integrating patient-specific data such as body weight and dietary intake, it calculates personalized doses for either insulin monotherapy or insulin/GLP-1 combination therapy. Furthermore, the software translates these biological doses into the exact light parameters, enabling direct and accurate control of the LEGO system in vivo.
Web-site Architecture
To translate user inputs into personalized light-control parameters for the LEGO system, we developed a modular software architecture comprising the of the following four core components:
This module establishes and stores each user's foundational health profile, including parameters such as sex, body weight, age, and BMI. These values provide the baseline for all subsequent therapeutic calculations.
As the computational core module of the system, this module integrates the user's health profile with real-time inputs—such as current blood glucose level, target glucose level, and meal information—to determine the optimal therapeutic regimen. It supports both Basal doses (long-acting, background insulin) and Bolus doses (rapid-acting insulin to cover meals). For enhanced accuracy in Bolus dose calculation, the engine can incorporate external food recognition APIs to generate precise carbohydrate estimates.
This module converts the calculated drug dosages into precise blue light parameters (intensity, duration, interval) required to activate the LEGO system in vivo. The translation is based on a quantitative model derived from prior Wetlab characterization of the system’s dose–response relationship.
To maximize personalization and clinical flexibility, this module allows users or healthcare providers to view and adjust key variables within the calculation formulas. For instance, the insulin sensitivity factor—typically auto-calculated from weight and age—can be manually overridden with physician-prescribed values.
Together, these modules form a user-friendly and technically robust architecture that links clinical decision-making directly to the control of our synthetic biological system. The design ensures transparency, adaptability, and precision in therapeutic delivery.
Modeling
To bridge the gap between clinical inputs and the control of the LEGO system, we developed a comprehensive computational model. This model integrates established clinical principles for insulin dosing with our proprietary algorithms to achieve two critical translations: 1) converting patient-specific physiological parameters and clinical state into an appropriate therapeutic drug dose, and 2) mapping the drug dose to the precise light illumination parameters required to actuate the genetic circuit. The overall logic flow is illustrated in Fig. 1.
Fig. 1. The computational workflow of the DiaPlan. Click on each node to expand its details.
First, determine the insulin resistance factor based on Age (40):
Now, calculate TDD:
\[ \begin{align} TDD &= 75 \cdot 0.43 \\ &\approx \fbox{32.25\, U} \end{align} \]First, calculate Insulin Sensitivity Factor (ISF) using TDD (32.25):
\[ \begin{align} \text{ISF} &= \frac{1800}{TDD} \\ &= \frac{1800}{32.25} \\ &\approx \fbox{55.8} \end{align} \]Then, calculate the Correction Dose:
\[ \begin{align} C &= \frac{s-t}{\text{ISF}} \\ &= \frac{12-6}{\text{55.8}} \\ &= \boxed{0.11\, U} \end{align} \] where \(C\) is the correction dose.Let \(x\) be the average of the previous 3 readings and \(A\) be the adjustment.
If the readings are \([11.2, 10.5, 12.1]\), then \(x \approx 11.27\). Then,
The final dose \(F\) is calculated by
\[F = B + A + C\]Additionally, for basal dose, a GLP-1 value \(G\) in \(\mu \text{g}\) can be calculated as follows:
Let \(y, z\) be the meal size and the dessert condition, defined as follows:
Then, if \(y=1\), \(A = 1.5+1.5z \, \text{U}\). Otherwise, \(A = 1.5y \, \text{U}\).
In this case, when the meal is larger than usual and is with dessert, \((y,z)=(1,1)\) and \(A = \boxed{3\, U}\).
Let \(w\) be 5 if the sex is male and -161 if the sex is female.
Then, the typical calorie of a meal will be calculated using
This can then be compared with a user-given calorie value to calculate the meal size.
The final dose \(F\) is calculated by
\[F = B + A + C\]We calculate the insulin concentration value \(I\) in \(\text{ng/mL}\) as follows:
\[ I = 36F = 28.73 \cdot 36 = \boxed{1038.24\, \text{ng/mL}} \]Then, Using the light-response model for 2.5×10⁶ cells:
\[500I=\frac{1}{\frac{0.0009}{P} + \frac{0.0266}{T}} + 84.77046\]
Where: \(I\) = Insulin (ng/mL), \(P\) = Power (mW/cm²), \(T\)= Time (s)
With \(500I = 1034.28 \, \text{ng/mL}\) and \(P = 15 \, \text{mW/cm}^2\), we solve for T and get
\[ \begin{align} T &= \frac{0.0266}{\frac{1}{500I - 84.77046} - \frac{0.0009}{P}} \end{align} \]Final light parameters: Power = 15 mW/cm², Duration = 8.42 s
Usage
Visit our GitLab or click below to download the software: https://gitlab.igem.org/2025/software-tools/wlsa-shanghaiacademy.
PDF DiaPlan Software Instructions
This PDF file shows a detailed usage instruction.
Discussion
The development of the DiaPlan software marks a critical step in translating our LEGO gene circuit from a conceptual breakthrough into a potential clinical therapy. By creating a computational bridge between established diabetic care and novel synthetic biology control mechanisms, this software serves as the operational core of our proposed treatment system.
1. Software Advantages, Potentials and Project Importance
The primary advantage of our software lies in its ability to integrate and streamline complex clinical decision-making. It addresses a clear gap in existing tools by providing a unified platform for managing both insulin and GLP-1 combination therapy, which is an increasingly important treatment for T2DM treatment but poorly supported by current digital solutions. Within our project, the software is indispensable: it solves the fundamental challenge of enabling clinicians and patients, who naturally thinks in terms of drug units, to control a therapy that is actuated by light. The Dose-to-Light Translation module is the key innovation, directly linking calculated biological doses to the precise physical parameters required to activate the LEGO system in vivo.
In terms of usability, the software is designed to be user-friendly. It guides users through a clear, logical sequence, starting from input of basic health data and progressing to the generation a ready-to-use therapy regimen. The option to provide qualitative meal descriptions (e.g., "larger than usual") reduces the entry barrier, while integration with a food recognition API ensures higher precision for users seeking more accurate data.
2. Compatibility, Extensibility, and Limitations
Our software demonstrates strong potential for integration with external tools. The modular architecture is designed to facilitate the incorporation of external APIs, as demonstrated by the food recognition feature. This flexible design allows for the future integration of additional components, such as continuous glucose monitor (CGM) data feeds, paving the way for a fully automated closed-loop treatment system. Furthermore, the software's most critical integration is with our custom hardware, forming the core of the treatment pipeline. It seamlessly generates and transmits precise light control parameters, which the hardware executes, enabling a cohesive and automated therapeutic workflow from calculation to delivery.
The software can be extended to benefit the broader iGEM and synthetic biology community. While most engineered genetic circuits are designed to respond to specific inputs—such as endogenous or exogenous chemicals, or physical triggers like electrical, optical, or magnetic perturbations—our software introduces a distinctive capability: wireless, quantitative control of light illumination. These programmable light commands can be used to trigger downstream biochemical processes, providing a versatile and standardized interface for actuating optogenetic systems. Moreover, when integrated with our light source, the software forms a closed-loop feedback system for blood glucose regulation and metabolic control. Looking ahead, its compatibility with external APIs—including large language models such as ChatGPT or DeepSeek—opens the door to even more sophisticated and adaptive modes of control.
However, we openly acknowledge several limitations inherent to the scope of this project. Regarding biosafety constrains, the performance of the software’s wireless-controlled light illumination and its final outputs for guiding hormone production have not been validated in vivo. Nonetheless, we have provided a web-embedded user-interactive platform that enables users to visualize how defined parameters are converted into light and applied for diabetes treatment.
Additionally, while the formulas for combination therapy are based on clinical research, they are simplified models. The complex, synergistic effects of insulin and GLP-1 are not fully captured, and the model relies on user-adjustable parameters to account for individual variability. These limitations affect the software’s immediate adaptability for use by other groups (Q6). Although the code is well-structured and commented, its accuracy remains closely linked to the biological performance of the specific LEGO system. Consequently, future teams wishing to adapt the software will need to recalibrate the core dose-to-light translation model to suit their particular genetic circuit and experimental context.
3. General Usefulness and Future Outlook
Beyond the scope of our specific project, the software's architecture and underlying logic have broad applicability. It serves as a conceptual blueprint for controlling any therapeutic synthetic biology system whose output needs to be dynamically tuned based on patient physiology. The principle of DiaPlan, which bridges clinical inputs and biological actuator commands, could be adapted for other inducible systems or diseases or therapeutic applications.
Looking ahead, the vision for this software is a evolve into closed-loop, personalized therapy system. Future work would focus on:
- Integration with Real-Time Data: Connecting the software directly to CGMs and eventually, an implanted light device to enable automatic, real-time adjustment of therapy.
- Refinement of Models: Incorporating more sophisticated pharmacological models and machine learning techniques to improve dosing predictions, especially for combination therapies.
- Clinical Interface Development: Evolving the user interface to serve both patients and healthcare providers, ensuring safety and efficacy diseases management.
In conclusion, our software not only adds significant value to the LEGO system by making it operable but also offers a generalizable framework for the computational control of future precision therapies emerging from the field of synthetic biology.
References
1. Balena, R., Hensley, I. E., Miller, S., & Barnett, A. H. (2012). Combination therapy with GLP-1 receptor agonists and basal insulin: a systematic review of the literature. Diabetes, Obesity and Metabolism, 15(1), 1–13. https://doi.org/10.1111/dom.12025
2. Davidson, P. C., Hebblewhite, H. R., Steed, R. D., & Bode, B. W. (2020). Analysis of guidelines for basal-bolus insulin dosing: Basal insulin, correction factor, and carbohydrate-to-insulin ratio. Endocrine Practice, 26(12), 1479–1488. https://doi.org/10.4158/EP-2020-0107
3. Giugliano, D., Scappaticcio, L., Longo, M., Caruso, P., Maiorino, M. I., Bellastella, G., Ceriello, A., Chiodini, P., & Esposito, K. (2021). GLP-1 receptor agonists and cardiorenal outcomes in type 2 diabetes: An updated meta-analysis of eight CVOTs. Cardiovascular Diabetology, 20(1), 189. https://doi.org/10.1186/s12933-021-01366-8
4. Hughes, E. (2016). IDegLira: Redefining insulin optimisation using a single injection in patients with type 2 diabetes. Primary Care Diabetes, 10(3), 202–209. https://doi.org/10.1016/j.pcd.2016.01.002
5. Huckvale, K., Adomaviciute, S., Prieto, J. T., Leow, M. K.-S., & Car, J. (2015). Smartphone apps for calculating insulin dose: A systematic assessment. BMC Medicine, 13, 106. https://doi.org/10.1186/s12916-015-0314-7
6. Kurtzhals, P., Nishimura, E., Haahr, H., Høeg-Jensen, T., Johansson, E., Madsen, P., Sturis, J., & Kjeldsen, T. (2021). Commemorating insulin's centennial: Engineering insulin pharmacology towards physiology. Trends in Pharmacological Sciences, 42(8), 620–639. https://doi.org/10.1016/j.tips.2021.05.005
7. Lixisenatide. (2019). In LiverTox: Clinical and Research Information on Drug-Induced Liver Injure. National Institute of Diabetes and Digestive and Kidney Diseases. Retrieved from https://www.ncbi.nlm.nih.gov/books/NBK547852/
8. Nauck, M. A., Quast, D. R., Wefers, J., & Meier, J. J. (2021). GLP-1 receptor agonists in the treatment of type 2 diabetes - state-of-the-art. Molecular Metabolism, 46, 101102. https://doi.org/10.1016/j.molmet.2020.101102
9. Perkovic, V., Tuttle, K. R., Rossing, P., Mahaffey, K. W., Mann, J. F. E., Bakris, G., Baeres, F. M. M., Idorn, T., Bosch-Traberg, H., Lausvig, N. L., Pratley, R., & FLOW Trial Committees and Investigators. (2024). Effects of semaglutide on chronic kidney disease in patients with type 2 diabetes. The New England Journal of Medicine, 391(2), 109–121. https://doi.org/10.1056/NEJMoa2403347
10. Šakić, Z., Rudež, K. D., Radoš Kajić, A., Klobučar Majanović, S., & Rahelić, D. (2022). Celebrating 100 years of insulin use. Acta Clinica Croatica, 61(3), 482–487. https://doi.org/10.20471/acc.2022.61.03.15
11. Warren, M., & Steel, D. (2020). Clinical use of IDegLira: Initiation to titration after basal insulin. Clinical Diabetes, 38(1), 62–70. https://doi.org/10.2337/cd19-0043
12. Yang, Y., Liu, S. M., Mo, X., et al. (2024). Cost-effectiveness analysis of insulin glargine and lixisenatide injection (Ⅰ) in the treatment of adult type 2 diabetes mellitus with poor glycemic control in China. China Journal of Pharmaceutical Economics, 19(10), 5–13+23. (In Chinese)
13. Liu, S. M., Yang, Y., Mo, X., et al. (2024). Cost-effectiveness analysis of insulin glargine and lixisenatide injection (Ⅱ) in the treatment of adult type 2 diabetes mellitus with poor glycemic control in China. China Journal of Pharmaceutical Economics, 19(10), 14–23. (In Chinese)
14. Expert Guidance Drafting Group on the Clinical Application of Insulin Degludec and Liraglutide Injection. (2023). Expert guidance on the clinical application of insulin degludec and liraglutide injection. Chinese Journal of Diabetes, 15(3), 209–215. (In Chinese)
15. Chinese Endocrine-Related Expert Panel. (2023). Clinical expert recommendations on the use of basal insulin/glucagon-like peptide-1 receptor agonist fixed-ratio combinations for the treatment of type 2 diabetes. Chinese Journal of Endocrinology and Metabolism, 39(8), 645–650. (In Chinese)