Software

Introduction

We have developed a mathematical model for the genetic circuit of CRISPRi-mediated gene regulation. The mathematical model was then implemented as a web-application, where users can explore how different model parameters will impact the system over time. Our goal was to develop an easy to use and easy to access application that does not require much knowledge to operate.

Model

For mathematical modeling, the classical approach of creating a system of linear ODEs (ordinary differential equations) was chosen. The model describes interactions between various molecules involved in CRISPRi-mediated gene regulation. The system is solved numerically using an adaptive Runge-Kutta method, which is reasonably accurate and easy to implement in code. Here is the model:

Let’s describe each equation separately. The first equation is production of protein 1 at some rate from mRNA 1. The second equation is consumption of mRNA 1 in the process of protein 1 production, and the replenishing of mRNA 1 by the promoter 1. The third equation is blocking and unblocking of the promoter 1 by dCAS+sgRNA complexes. The fourth equation is the amount of “blockage” of promoter 1. The fifth equation is the concentration of dCAS+sgRNA complexes, which can decrease if a complex is used to block the promoter 1, or if the complex breaks, but replenishes from newly formed complexes and unblocked promoter 1. The rest of the equations describe the concentrations of dCAS and sgRNA, that get created by their respective promoters, may degrade into nothing, combine into a complex, or split off from the complex. The model requires some input parameters that define the speed at which these processes occur, starting values for each of the unknown functions, and the duration of the simulation.

Application

A web-based application for experimenting with the model parameters was developed. The application can either be accessed at https://seashell-app-yxaof.ondigitalocean.app/ (the website should be up at least until the end of 2023), or by hosting it manually. The format of web application was chosen for the flexibility and ease of deployment: users can simply open the website in their browser, without having to install or configure anything on their own computers.

The application consists of two parts: a web-based user interface (frontend or client), and a server (backend). The typical workflow goes something like this: the user enters the model parameters on the website, the parameters are automatically sent to the server, the server does all the necessary computations, and the numerical solutions to the system of ODEs are sent as points back to the frontend, where they are conveniently displayed as plots for the user to analyze further. The user may request another solution for a different set of parameters, and its solution will be shown at the top, while still preserving any older plots. Alongside each plot, the model parameters that lead to that plot are also displayed, and these parameters can be restored – basically “written back” to the parameter selection form.

On the frontend, we use the tried and true combination of HTML+JS+CSS, something that every programmer is familiar with. For plot drawing, a third-party library Plotly.js was chosen, for its ease of use and good performance when drawing bigger plots. On the backend, we employed the Rust programming language, as it is a language with great run-time performance, ideal for making computations. For all server-related needs, such as receiving model parameters or sending back the solution, the Rust Axum framework has been used, one of the most popular and well-maintained web-application frameworks in the Rust ecosystem. We host the server inside a Docker container, which provides a common environment, and helps us avoid the common issue of “works on my machine”, where something breaks because of some subtle configuration differences between the computers used by developers, users, and the hosting provider. For hosting we used the DigitalOcean platform, an easy-to-use service for deploying web-applications.

Usage

Using the application is simple – just visit the website https://seashell-app-yxaof.ondigitalocean.app/. It is also possible to host the application manually. First, with Docker:

  1. Install docker, using the instructions here: https://docs.docker.com/desktop/
  2. Open the terminal
  3. Use the following command: docker run -d -p 8080:80 zeromarble/smbu-igem-2023:1.0
  4. Take a note of the container id that will be written to the terminal after you run the previous command
  5. Press enter, it should first download the docker container, than run it
  6. Open up your web browser, and go to address 127.0.0.1:8080
  7. To close the server, run the following command: docker kill id, where id is the one from step 4. You can use just a couple of first symbols from the id.

It is also possible to run the server without Docker:

  1. Install the Rust programming language: https://www.rust-lang.org/learn/get-started
  2. Open up the terminal
  3. Clone the repository: git clone https://gitlab.igem.org/2023/software-tools/smbu.git
  4. Open the repository’s folder: cd smbu
  5. Build and run the server: cargo run (might take a while the first time, as it needs to download all of the dependencies)
  6. Open up your web browser, and go to address 127.0.0.1:8080
  7. To close the server, press Control+C

Operating the website itself is easy. Enter your preferred parameters in the form labeled “Parameters”, and click “Solve”. Note that setting the parameter “t” (the duration of the simulation) will increase the computation time. A plot should appear, with two buttons on the top: “x” to remove the plot, and “<” to restore the parameters of that plot into the “Parameters” form. The plot itself has a number of associated controls, it is possible to pan, zoom, disable plots of individual functions, save the plot as an image. Clicking the arrow button in the bottom right corner will take you to the “Parameters” form on the top of the page. The website works well for both desktop and mobile.

Possible improvements

  1. The design of the frontend, its look and feel, is definitely very basic.
  2. It would be nice to conduct actual mathematical exploration of the model, and perhaps find an analytical solution.
  3. Doing calculations on the server might not be optimal, as modern browsers are fast enough to run them locally.