Upload a protein structure file (
.pdb/.fasta/
A Flask web app that parses molecular structure files and renders them as an interactive 3D model in the browser (via 3Dmol.js). It also includes a lightweight, rule-based Q&A agent that answers questions about the loaded structure (chains, residues, molecule summary) — no external LLM or API keys required.
🧬 Demonstration prototype. Uploaded files are processed locally and are not committed to this repository.
- Multi-format parsing —
.pdb(Protein Data Bank),.fasta(sequences), and.pdf(text extraction viapdfplumber). - Interactive 3D viewer — rotate / zoom / style protein structures in the browser with 3Dmol.js.
- Structure Q&A agent — ask natural-language questions (e.g. "how many chains?", "summarize the molecules") answered by a deterministic keyword-scoring agent.
- Clean web UI — Bootstrap 5 single-page interface.
- Cloud-ready — Azure infrastructure (Bicep) +
azdconfig, plus gunicorn/nginx/systemd deployment files.
- Backend: Python · Flask · pdfplumber
- Frontend: Bootstrap 5 · 3Dmol.js
- Serving: gunicorn + nginx (systemd unit included)
- Infra: Azure Bicep + Azure Developer CLI (
azd)
python -m venv .venv
.venv\Scripts\activate # Windows (use: source .venv/bin/activate on macOS/Linux)
pip install -r requirements.txt
python app.pyThen open http://localhost:5000 and upload a .pdb file.
.
├── app.py # Flask application & routes
├── parsers/ # File parsers
│ ├── pdb_parser.py
│ ├── fasta_parser.py
│ └── pdf_parser.py
├── agents/ # Rule-based structure Q&A agent
│ └── pdb_reader_agent.py
├── templates/index.html # Web UI (Bootstrap + 3Dmol.js)
├── static/css/style.css
├── infra/ # Azure Bicep IaC
├── azure.yaml # azd project config
├── gunicorn_config.py / nginx.conf / pdb_reader.service # production serving
└── requirements.txt
Provision and deploy to Azure with the Azure Developer CLI:
azd auth login
azd upOr use the included deploy.sh (gunicorn + nginx + systemd) for a VM deployment.
Note: the
uploads/folder, local virtual environments,deploy.zip, and.azure/(which holds your subscription ID and local environment values) are git-ignored.