wenqi-yue/peptide-screening-tool
<!-- The block above is Hugging Face Spaces configuration. It tells the Space to run app.py as a Streamlit app. Leave it in place when deploying to HF. -->
Peptide Screening Tool
A molecular-engineering engine that screens, optimizes, and (next) discovers peptides for cell-membrane permeability under a strict, non-toxic safety profile.
Run it locally (one command)
# one-time setup (creates .venv and installs runtime deps):
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
# launch the dashboard — the screening engine runs in-process, no backend needed:
streamlit run app.py # → http://localhost:8501Then open http://localhost:8501 and click Analyze next to any example peptide.
What each file does
The permeability model
The permeability score is a trained Random Forest (models/permeability_model.joblib) learned from 5,651 labeled sequences (pLM4CPPs + KELM CPP / non-CPP), using 8 biophysical features from processor.py. On a held-out 20% test split it scores ROC-AUC ≈ 0.94, versus 0.84 for the previous hand-tuned heuristic — a real improvement. If the model file is absent, optimizer.permeability_score() transparently falls back to the heuristic.
Retrain any time with:
pip install -r requirements-dev.txt
python train_models.pyHonest limits. (1) The score is a CPP-likelihood proxy, validated in-silico only — it can misjudge out-of-distribution inputs (e.g. homopolymers). (2) Safety is NOT a trained model: the bundled toxicity labels (ToxinPred2) are length-confounded and contain almost no short non-toxic peptides, so the app keeps its transparent rule-based hemolysis/lytic filter instead. A proper safety model needs short-peptide hemolysis data (HemoPI / HAPPENN).
Deploy it free on Hugging Face Spaces
- Create a new Space at <https://huggingface.co/new-space> → SDK: Streamlit.
- Push this repo to the Space (the frontmatter above wires it up to
app.py). - The Space builds from
requirements.txtand serves a public URL.
The deployed app is fully self-contained — the screening engine runs inside the Streamlit process, so there is no separate backend to start.
Data status
data/advanced_peptide_space.csv — 22,117 sequences with two independent labels: cpp_label (permeability) and tox_label (safety). Product target = permeable and safe.
Safety note
Screening and optimization are research triage aids — not a substitute for wet-lab validation.
