Skip to content

Repository files navigation

PDB Reader — Protein Structure Analysis & 3D Visualization (DEMO)

Upload a protein structure file (.pdb / .fasta / .pdf), parse it, explore it in interactive 3D, and ask questions about it in natural language.

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.

✨ Features

  • Multi-format parsing — .pdb (Protein Data Bank), .fasta (sequences), and .pdf (text extraction via pdfplumber).
  • 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) + azd config, plus gunicorn/nginx/systemd deployment files.

🧩 Tech Stack

  • Backend: Python · Flask · pdfplumber
  • Frontend: Bootstrap 5 · 3Dmol.js
  • Serving: gunicorn + nginx (systemd unit included)
  • Infra: Azure Bicep + Azure Developer CLI (azd)

🚀 Getting Started

python -m venv .venv
.venv\Scripts\activate        # Windows  (use: source .venv/bin/activate on macOS/Linux)
pip install -r requirements.txt
python app.py

Then open http://localhost:5000 and upload a .pdb file.

🗂️ Project Structure

.
├── 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

☁️ Deployment

Provision and deploy to Azure with the Azure Developer CLI:

azd auth login
azd up

Or 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.

About

Protein structure analysis & 3D visualization web app (Flask + 3Dmol.js) - parse PDB/FASTA/PDF, interactive 3D viewer, rule-based structure Q&A agent

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages