This web application is designed to provide a user-friendly interface for protein structure prediction using AI tools. It allows users to upload protein sequences, run predictions, visualize the results in web and download the results locally. The application is built using Next.js for the frontend and Flask for the backend, with Docker for containerization and deployment in Kubernetes.
For development purposes (the submission of jobs will not work), the application can be run via Docker Compose or manually on a local machine. For production use (with working prediction submission), the application can be deployed in a Kubernetes cluster with prepared Docker images for every prediction tool. The app uses session management to allow anonymous guest access.
- Linux - the application is designed to run on Linux systems
- Docker (version 28.0.1 or higher) - for running the application in containers
- Node.js (version 20.19.1)
- npm (version 10.8.2)
- Python (version 3.10.17) - required for the AlphaFold 2
- Pip (version 25.1)
Anonymous Session: This version of application is designed to work publicly, but for preserving the computed data, an anonymous authentication via JWT tokens is used. All you need is to establish an authentication secret that will be provided both for backend and frontend.
- Copy the template
config-template.pyfile toconfig.pyin theapidirectory:cd api cp config-template.py config.py - All the variables listed in the config must be set as ENV variables in your deployment environment. In particular, set the
SESSION_SECRETvariable to a strong random secret generated withopenssl rand -base64 32. The rest of the variables shall be set with needed values for your environment.
- Copy the template
.env-template.localfile to.env.localin thewebdirectory:cd web cp .env-template.local .env.local - Edit
.env.localand set theSESSION_SECRETvariable to the same value as in the backend configuration.
- Copy the template kubernetes manifests from
kubernetes-templatesdirectory to the newkubernetesdirectory (including all the files inside):cp -r kubernetes-manifests kubernetes
- Edit
secrets.yamland set theSESSION_SECRETvariable to a strong random secret generated withopenssl rand -base64 32. All the other manifests update with your namespace, image names, and other necessary configurations as described in the comments within each file. Theconfigmap.yamlneeds to be updated with the same ENV variables as in the backend configuration.
Note: The kubernetes files should not be committed to version control. Directory is included in the .gitignore file to prevent accidental exposure of sensitive information.
The application can be run using Docker Compose, which simplifies the process of managing multiple containers. The compose.yml file in root directory defines the services required for the application to run.
Run the following command to start the application:
docker compose upThis command will build the necessary Docker images and start the containers for the frontend, backend, and any other required services. The application will be accessible at http://localhost:3000.
The application can also be run locally without Docker. This is useful for development and testing purposes.
The frontend is located in the web directory. To run the frontend locally, follow these steps:
- Navigate to the
webdirectory:cd web - Install the required dependencies:
npm install
- Start the development server:
npm run dev
- Open your web browser and navigate to
http://localhost:5000orhttp://localhost:3000to access the application.
The backend is located in the api directory. To run the backend locally, follow these steps:
- Navigate to the
apidirectory:cd api - Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
- On macOS and Linux:
source venv/bin/activate
- On macOS and Linux:
- Install the required dependencies:
pip install -r requirements.txt
- Install
jaxandjaxlibin version 0.3.5 (required for AlphaFold 2):pip install jax==0.3.25 -f https://storage.googleapis.com/jax-releases/jax_releases.html pip install jaxlib==0.3.25 -f https://storage.googleapis.com/jax-releases/jax_releases.html
- Set the environment variable for Flask:
export FLASK_ENV=development - Start the Flask server:
python3 server.py
- The backend will be accessible at
http://localhost:8080. - To deactivate the virtual environment, run:
deactivate
The application can be deployed in a Kubernetes cluster for production use.
The instructions are described in kubernetes/deployment_notes.md. Or you can use prepared script. But do not forget to update the data in the script !!
Script template is located in the root directory of the project. It automates the process of building Docker images and deploying the application to a Kubernetes cluster. Note that the scripts need to be modified for your environment, the namespace is set in the scripts via NS variable.
- Copy the template
deploy-template.shfile todeploy.shin therootdirectory:cp deploy-template.sh deploy.sh
- Edit
deploy.shand set theNSvariable to your namespace and theBACKEND_IMAGEandFRONTEND_IMAGEvariables to your image names in the registry, e.g.registy.io/<your-username>/<image>. - Make the script executable:
chmod +x deploy.sh
- Run the script:
./deploy.sh
The application supports multiple protein structure prediction tools. Each tool requires specific manifests and Docker images for deployment in Kubernetes. The currently supported tools include:
- AlphaFold 3
- AlphaFold 2
- ColabFold
- OmegaFold
- ESMFold
The configuration for these tools is contained within the configmap.yaml file in the kubernetes directory. Ensure that the Docker images for each tool are built and pushed to your container registry before deploying the application.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or support, please contact the author at [email protected].
