PBAP · Peptide Bioactivity Audit Pipeline
Phase 1 · operational Phase 2 · offline audit tooling
Technical diagram · May 2026

How PBAP works.

A modular orchestrator that audits 26 published peptide-bioactivity prediction tools, runs the 10 that actually work under a unified output schema, and adds analytical layers — concordance, pathogen/commensal selectivity, hierarchical ranking — that no individual tool ships with.

26
Tools evaluated
10
Operational (38%)
7
Bioactivity categories
6
Conda environments
34
APEX strains
5
Output formats
🤗 Try the live demo View source on GitHub Free · non-commercial · up to 50 peptides
01 · ARCHITECTURE

Two phases, one philosophy.

PBAP operates in two independent modes. Phase 1 is what a user runs on their FASTA — sections 02–06 below describe it in detail. Phase 2 is the offline scientific audit that validates each tool against independent evaluation pools; its output is internal QC, not part of any user run.

Phase 01 · scripts/run_audit.py

User inference

FASTA → consolidated predictions + ranking. What the end user actually runs.

  1. FASTA batchinganti-OOM, default 100 peptides / batch
  2. Per-tool execution in sub-processesmicromamba run · 6 isolated tool envs
  3. Normalisation to the dual schemaclass_norm + score + extra_metrics
  4. Intra-category agreementconsensus_positive · split · single_tool
  5. APEX selectivity (pathogen vs commensal)post-processing of the 34 MICs
  6. Hierarchical rankingstructural_score → holistic_score
  7. Report generationHTML · MD · CSV · XLSX · JSON
Phase 02 · bin/audit_pipeline.sh

Scientific audit — offline only

Per tool, validate against independent data and quantify its biases. Never invoked by a user run.

  1. Mining positives per bioactivityUniProt + 9 specialised databases
  2. Extracting the author's training setfrom each tool's repo
  3. Leakage analysis (CD-HIT-2D)40 / 60 / 80% identity bands
  4. Negative generation per toollength-stratified sampling
  5. Prediction & benchmarkingrecall, precision, MCC on the independent pool
  6. Taxonomic biasFisher exact · Wilson CI · BH-FDR
  7. Per-tool QCdistributions, AA composition, score_oor
  8. Global cross-tool reportJSON · TXT · XLSX
02 · PHASE 1 FLOW

Anatomy of a run.

What happens between Inputs/peptides.fasta and Outputs/peptides_2026-05-08T1530/REPORT.html. Click on any step to inspect it.

03 · CATALOG

10 tools, 7 categories.

Out of 26 published tools (2023–2025), only 10 are runnable end-to-end. Each one lives in its own conda environment — pinned, isolated — and emits into the common schema. Categories carry a polarity: GOOD adds to holistic, BAD subtracts.

04 · UNIFIED SCHEMA

Two axes, not mutually exclusive.

Some tools predict active / inactive (binary). Others predict continuous magnitudes — MIC in µM against 34 strains, in APEX's case. Forcing everything to binary discards information; using magnitudes only kills cross-tool comparison. PBAP keeps both axes alive.

Axis 01
Binary

Every classifier emits class_norm ∈ {positive, negative, null} with score ∈ [0, 1]. Feeds the cross-tool matrix and the intra-category agreement detection.

# pipeline_config.yaml — toxinpred3 output_parsing: format: csv prediction_column: Prediction positive_label: 1 score_column: Probability score_threshold: 0.5
Axis 02
Extra metrics

Magnitudes with a unit. Materialised as columns <tool>__<metric>__<unit>. Same magnitude + target + unit → same column; any difference → separate column.

# pipeline_config.yaml — apex (34 strains) output_parsing: extra_metrics: - name: MIC_E_coli unit: uM field: E.coli K12 - name: MIC_S_aureus unit: uM field: S.aureus ATCC25923 # … 32 more

Intra-category agreement — what happens when two tools disagree

05 · HIERARCHICAL RANKING

Profile first, magnitude second.

Two levels so the user can prioritise peptides without a high score in one category masking a structurally weak profile. A peptide with a good profile across many categories always ranks above one with a single high score in few.

06 · SPECIAL CASE

APEX — 34 strains, 4 labels, 2 means.

APEX predicts MIC against 34 bacterial strains. Some are pathogens (S. aureus, MRSA, K. pneumoniae). Others are gut-microbiome commensals (Akkermansia, Bacteroides). PBAP post-processes this into a selectivity label that feeds directly into the holistic_score.

PHASE 2 Audit-only
not in user runs

Everything from here down is offline tooling.

The sections above describe what runs when a user invokes scripts/run_audit.py on their FASTA. The section below describes a separate orchestratorbin/audit_pipeline.sh — which validates each tool against an independently constructed evaluation pool. Its artifacts live under Dataset_Bioactividad/Reports/ and are never emitted by a user run.

07 · PHASE 2 ARTIFACT offline only

Scientific validation — Gold, Silver, Bronze, Red.

When PBAP audits a tool against an independent evaluation pool (Phase 2 — bin/audit_pipeline.sh), cd-hit-2d bins each evaluation peptide by its maximum identity to the tool's training set. These are identity bands, not a single confidence ladder — they map onto the Applicability Domain concept from QSAR (Tropsha & Golbraikh; OECD Principle 3). The right reading depends on what you are asking.

SOURCE OF TRUTH · docs/leakage_analysis.md Phase 1 user reports do NOT include per-peptide tags. Applicability-domain calibration and per-peptide tagging in production are tracked as future work in docs/roadmap.md under "Leakage analysis via CD-HIT-2D (Phase 2)". What exists today: scripts/cdhit_leakage_analysis.py and scripts/auditoria_validation.py produce these bands for offline analysis over independently built evaluation pools.
Gold · far from training
survives 80%, 60% and 40% · <40% identity
Nearest training neighbor sits below 40% identity. The peptide is outside the applicability domain of this tool.
Silver · in-domain, medium
survives 80%, 60% · dies at 40% · 40–60% identity
Remote-to-moderate similarity (40–60%) to training. Inside the model's reasonable working range.
Bronze · in-domain, close
survives 80% · dies at 60% · 60–80% identity
Close similarity (60–80%) to a training neighbor. Solidly inside the applicability domain.
Red · near-duplicate
dies at 80% · ≥80% identity
Training has a peptide at ≥80% identity. Not literally the same sequence (a 50-aa peptide at 80% differs in 10 residues) but the local sequence fingerprint is largely preserved.
Lens A · Benchmarking the tool

How good is the model at generalizing?

  • Goldbest signaluncontaminated test of true generalization
  • Silvercleaninside the AD, minimal leakage bias
  • Bronzemildly inflatedclose-neighbor recognition leaks into the score
  • Redexcludenear-memorization by interpolation; any decent model wins here trivially
Lens B · Trusting a specific prediction

Will this tool be right on this peptide?

  • Goldlowpeptide is out-of-distribution; the model extrapolates
  • Silverhighinside the applicability domain
  • Bronzehighinterpolation from known territory
  • Redhigh but trivialpractically correct because the model has seen a near-clone

Practical takeaway: for benchmarking a tool, Gold is the cleanest signal and Red is excluded. For estimating how much to trust a specific prediction the tool just made on a specific peptide, the order is roughly reversed — Bronze and Silver are the operational sweet spot, Gold is where the model is least trustworthy. Phase-2 audit reporting therefore publishes per-band metrics side by side rather than a single trust verdict.

08 · ARTIFACTS phase 1 · user run

What ends up in Outputs/.

Five formats, same data. The user picks the tool — the browser for rich visual inspection, Excel for hand-filtering, CSV/JSON to plug into other pipelines.

PRIMARY
REPORT.html
HTML5 standalone · no CDN
Interactive matrix with sort by category or by specific tool, filters (holistic ≥, length, pathogen_specific only), per-peptide drill-down, APEX sub-block coloured per strain, collapsible sections.
5 sheets
consolidated.xlsx
openpyxl · conditional formatting
Matrix · Disagreements · Extra_Metrics · Tool_Health · Run_Info. Autofilter on, freeze pane at row 1, green/yellow/grey fills per consensus.
wide
consolidated.csv
flat CSV
One row per peptide. Ordered by structural_score desc → holistic_score desc.
nested
consolidated.json
nested JSON
Hierarchical: peptide → predictions per tool → extra_metrics + full apex_selectivity.
backup
REPORT.md
plain Markdown
6 sections — header, per-peptide summary, disagreements, extra_metrics, per-tool health, footer.
diagnostic
tool_health_report.json
JSON
Per tool: runtime, status, n_batches_ok/total, diagnosis. Detects partial failures without aborting the run.