Skip to content

az-said/pvl-case-study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฌ Peptide Visual Lab (DESY โ€” Landau Group) ๐Ÿ”ฌ

Interactive web app for exploring peptide properties and fibril-forming predictions. Designed with the Landau Group (DESY/CSSB, Professor Meytal Landau's group). Developed with guidance from Dr. Aleksandr Golubev.


๐Ÿ—๏ธ Case-Study Mode
Upload and real computation are disabled in this version.
Use โ€œLoad Example Datasetโ€ on the home screen to explore the full interface and workflow with synthetic data that mirrors real outputs.
๐Ÿ”’ The operational laboratory repository remains private; implementation details are summarized below.


๐ŸŽฏ Purpose

  • ๐Ÿ“ค Upload peptide datasets from UniProt (TSV/CSV/XLSX)
  • ๐Ÿงช Compute biophysical features (Hydrophobicity, Charge, Hydrophobic Moment ฮผH)
  • ๐Ÿ”— Integrate Tango (SSW) and JPred results (when local outputs are provided)
  • ๐Ÿ“Š Visualize cohorts, rank candidates, and export reports/shortlists

๐Ÿ’œ Said Azaizahโ€™s Contributions (Expanded)

๐Ÿงฉ Productization & Architecture

  • Reframed a stalled prototype into a deployable research tool featuring a React/TypeScript UI, FastAPI backend endpoints, and a normalized data contract for reliable UI rendering.
  • Implemented per-run temporary directories, direct binary execution, and a robust parser tolerant of multiple TANGO output formats (tabular/mixed text).
  • Executed the JPred โ†’ PSIPRED pivot, replacing brittle dependencies with a probability-based secondary-structure pipeline using P(H)/P(E)/P(C) for accurate %Helix/%Beta predictions and segment mapping.

๐Ÿ“Š Data & Fallbacks

  • Unified column normalization across experiments, ensuring consistent field names, units, and alignment for comparative analytics.
  • Added โ€œalways-onโ€ sequence-only features โ€” including FF-Helix%, charge, hydrophobicity, and ฮผH โ€” to preserve utility even when predictors are offline.

๐ŸŽจ UX & Flows

  • Designed the Upload โ†’ Results โ†’ Detail flow, including triage KPIs, sortable tables, cohort radar visualizations, and a badge system (e.g., chameleon flag).
  • Added export options (CSV/PDF) and a roadmap for researcher-tunable parameters (thresholds, weights, and audit-safe defaults).

๐Ÿ›ก๏ธ Reliability & Privacy

  • Architected for local-only computation within lab environments; prepared a secure PSIPRED server deployment plan for broader access.
  • Established a cross-platform runner strategy, eliminating hard-coded paths and OS-specific dependencies.

โš™๏ธ In this case-study version, computation is mocked โ€” but the architecture, data normalization, and UX faithfully mirror the live production environment.


โœจ Key Features

  • ๐Ÿ”„ Flexible upload: TSV/CSV/XLSX; optional column mapping
  • โœ… Upload QC: invalid sequences reported, download rejected_rows.csv
  • ๐Ÿท๏ธ Provenance pill: JPred/Tango ON/OFF + hit counts
  • ๐Ÿ“ Six core metrics:
    1. ๐ŸฆŽ Chameleon prediction (SSW)
    2. ๐ŸŒ€ Helix segments (JPred)
    3. โšก Charge
    4. ๐Ÿ’ง Hydrophobicity
    5. ๐ŸŒŠ Hydrophobic moment (ฮผH)
    6. ๐Ÿงฌ FF-Helix (derived flag)
  • ๐Ÿ“ˆ Visualizations
    • ๐Ÿ“‰ Hydrophobicity distribution
    • ๐ŸŽฏ Hydrophobicity vs ฮผH scatter
    • ๐ŸฆŽ Chameleon distribution & cohort radar
    • ๐Ÿ“Š Sliding-window profiles (H & ฮผH) with helix overlays
  • ๐ŸŽ›๏ธ Smart ranking: sliders for metric weights + Top-N shortlist (CSV)
  • ๐Ÿ” Per-peptide deep dive: segment track, metrics, interpretations
  • ๐Ÿ“‹ Exports: CSV export; PDF Report (one-click)
  • โ˜๏ธ Cloud (optional): Save/Load datasets via Firebase Auth + Firestore

โš™๏ธ How It Works

1. Backend (backend/ โ€” FastAPI) ๐Ÿ

  • โœ… Accepts UniProt exports (TSV/CSV/XLSX)
  • ๐Ÿ”ง Normalizes headers; derives Length if missing
  • ๐Ÿงฎ Computes Charge, Hydrophobicity, ฮผH (sequence-based)
  • ๐Ÿ”ฎ If local results present and enabled:
    • JPred โ†’ Helix fragments (Jpred), Helix score (Jpred)
    • Tango โ†’ SSW prediction, SSW score
  • ๐Ÿ Computes FF flags from cohort thresholds

2. Frontend (ui/ โ€” React + Vite + shadcn/ui + Recharts) โš›๏ธ

  • ๐Ÿ“ค Upload โ†’ ๐Ÿ‘€ Preview โ†’ ๐Ÿ”ฌ Analyze (calls backend)
  • ๐Ÿ—บ๏ธ Optional column mapping
  • ๐Ÿ“Š Renders dashboards, detail pages, and exports

๐Ÿš€ Quick Start (local)

1๏ธโƒฃ Backend

cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Feature flags (safe defaults)
export USE_TANGO=1          # Tango on (works with mac binary today)
export USE_PSIPRED=true     # OK if PSIPRED isn't installed; it will skip cleanly

uvicorn server:app --host 0.0.0.0 --port 8000 --reload

2๏ธโƒฃ Frontend

cd ui
npm install
echo "VITE_API_BASE_URL=http://127.0.0.1:8000" > .env.local
npm run dev   # open http://127.0.0.1:5173

๐Ÿ“ค Upload a UniProt table (CSV/TSV/XLSX) with Entry and Sequence (others optional). ๐Ÿ“Š You'll see cohort cards + ranking and a full table. Use Export CSV or Export shortlist.csv.

๐Ÿ”ง Tango & PSIPRED

๐Ÿฅญ Tango (macOS recommended)

  1. Put your mac binary at backend/Tango/bin/tango
chmod +x backend/Tango/bin/tango
  1. (Apple Silicon only, x86_64 binary) Install Rosetta:
softwareupdate --install-rosetta --agree-to-license

๐Ÿง  PSIPRED (optional; Docker)

Build/pull an image tagged psipred-hhblits and set PSIPRED_DB to your Uniclust folder. If not available, backend prints a warning and continues.

๐Ÿ“– Details are in DEPLOYMENT.md.

๐ŸŒ Deployment (make it globally accessible)

The backend can keep running locally in your lab and still be reachable worldwide over HTTPS. Choose one:

๐Ÿ…ฐ๏ธ Option A โ€” Lab server + Cloudflare Tunnel (recommended)

  • ๐Ÿ  Keep backend and Tango/PSIPRED on the lab laptop.
  • ๐ŸŽฏ Serve the frontend either:
    • directly from the lab laptop (Nginx), or
    • host the static UI on Firebase Hosting/Vercel and proxy /api to the tunnel URL.
  • ๐ŸŒฉ๏ธ Use Cloudflare Tunnel to expose http://127.0.0.1:8000 to the internet safely (no open inbound port).

Steps (summary):

  1. ๐Ÿ—๏ธ Build the UI: cd ui && npm run build
  2. ๐ŸŒ Install Nginx (or any static server) and serve ui/dist at /.
  3. ๐Ÿš‡ Install Cloudflare Tunnel (cloudflared), authenticate, and create a tunnel that forwards:
    • /api/* โ†’ http://localhost:8000
    • / โ†’ local static files (or skip if using Firebase Hosting/Vercel)
  4. ๐ŸŽฏ Point your domain DNS (Cloudflare) to the tunnel. You get free HTTPS.

This keeps sensitive tools and data inside your lab while offering a stable public URL.

๐Ÿ…ฑ๏ธ Option B โ€” Cloud VM (Hetzner/AWS) with Docker

  • ๐Ÿ–ฅ๏ธ Provision a small VM, install Docker.
  • ๐Ÿณ Run backend in a container with Tango/PSIPRED binaries mounted (or baked into the image).
  • ๐ŸŒ Serve UI via Nginx.
  • ๐Ÿ”’ Add a domain + Let's Encrypt (or Caddy for auto-TLS).

ยฉ๏ธ Option C โ€” Split hosting (very simple)

  • โ˜๏ธ Frontend on Firebase Hosting (push ui/dist/).
  • ๐Ÿ  Backend stays on lab laptop. Expose /api via Cloudflare Tunnel and set VITE_API_BASE_URL="https://your-tunnel-domain.example/api" in the hosted UI.

๐Ÿ“– All options are fully described in DEPLOYMENT.md with exact commands and example configs.

๐Ÿ—บ๏ธ Roadmap (what's next)

  • ๐ŸŽจ Single-sequence drawer: PSIPRED curves (P(H)/P(E)/P(C)), Tango ฮฒ-aggregation track, segment ribbons.
  • ๐Ÿ” Auth + Firestore: sign-in, "previous datasets", cloud export of Tango/PSIPRED outputs (schema and rules outlined in DEV_GUIDE.md).
  • ๐Ÿ” UniProt fetcher: type a protein or organism โ†’ fetch, window peptides to CSV, analyze.

๐Ÿ“œ License

This repository is intended for research use. If you need a permissive OSI license, choose Apache-2.0 (recommended) or BSD-3-Clause.

For now, we include a DESY Research License template (LICENSE-DESY-RESEARCH.md). If you plan a public SaaS, consider switching to Apache-2.0.

๐Ÿ™ Acknowledgements

  • ๐Ÿฅญ Tango: Fernandez-Escamilla et al., Nat Biotechnol 22, 1302โ€“1306 (2004).
  • ๐Ÿง  PSIPRED: Jones, J Mol Biol 292, 195โ€“202 (1999).
  • ๐Ÿ’œ Thanks to DESY / CSSB (Landau Lab): Said Azaizah & Dr. Aleksandr Golubev for guidance on SSW/FF calculations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors