Recommending Bacterial Cultivation Conditions from 16S rRNA
Organizations: Harvard University USA · Duke Kunshan University China · Duke University USA · Boston University USA
Abstract
Recommending bacterial cultivation conditions from sequence data is a challenging structured problem characterized by missing standardized benchmarks and limited use of sequence structure. To address this, we introduce DSNI, a benchmark of 65,023 bacterial strains with phylogeny-aware splits, pairing 16S rRNA sequences with four cultivation conditions (media, temperature, pH, oxygen). Exploiting the mosaic structure of 16S rRNA, where hypervariable regions support discrimination and conserved regions support primer design, we propose a Variability-Gated Encoder that learns position-dependent importance weights conditioned on biological features (region type, position, and local complexity). The gating module adds minimal overhead (1,280 parameters, <1%) while providing an explicit inductive bias valuable in low-data regimes. Experiments demonstrate that the learnable gate improves flat Transformers by 4.7% in joint accuracy and complements RNABERT, yielding 44.2% exact-match joint accuracy. The model also recovers 90.2% of ground-truth cultivation protocols within its top-25 recommendations, narrowing the exhaustive search space by approximately 60 times.
Figures & tables
| Method | Params | Media Acc. | Temp. Acc. | pH Acc. | O 2 Acc. | Joint Acc. |
|---|---|---|---|---|---|---|
| Traditional ML | ||||||
| -mer + RF | — | 38.2 1.1 | 86.4 0.8 | 89.1 0.7 | 72.3 0.9 | 24.7 1.2 |
| -mer + XGBoost | — | 41.5 0.9 | 87.8 0.6 | 90.3 0.5 | 74.6 0.8 | 27.3 1.0 |
| Phylogenetic / Similarity-Based | ||||||
| GROWREC | — | 46.3 0.0 | 85.2 0.0 | 88.4 0.0 | 71.8 0.0 | 28.9 0.0 |
| -NN (Sequence) | — | 43.8 0.0 | 87.1 0.0 | 89.7 0.0 | 73.5 0.0 | 27.6 0.0 |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Table | Field | Description |
| STRAINS | strain_id | Unique identifier (DSM/BEI number) |
| genus | Taxonomic genus assignment | |
| species | Species epithet | |
| sequence_16s | Full or partial 16S rRNA sequence | |
| opt_temp | Optimal growth temperature ( ∘ C) | |
| opt_ph | Optimal growth pH |
| Resource | Organisms | Labels | Split strategy |
|---|---|---|---|
| KOMODO [ 22 ] | K pairs | Media only | Random |
| MediaDB | orgs. | Media composition | None (catalog) |
| DSNI (ours) | 65,023 strains | 4 conditions | Genus-aware |
| Method | Input | Throughput | Coverage | Limitation |
|---|---|---|---|---|
| Trial-and-error | Isolate | 50–200 cond./org. | Single organism | Slow, expensive |
| Culturomics [ 16 ] | Fecal/env. sample | cond./run | Broad, untargeted | 5–30% success |
| Dilution-to-extinction | Liquid sample | Low | Specialized | Low-nutrient only |
| DSNI (ML) | 16S only | Instant | Any 16S-tagged org. | Needs validation |
| Hyperparameter | Transformer | RNABERT |
|---|---|---|
| Hidden dimension | 256 | 768 (fixed) |
| Number of layers | 6 | 12 (fixed) |
| Attention heads | 8 | 12 (fixed) |
| Feed-forward dim | 1024 | 3072 (fixed) |
| Dropout | 0.1 | 0.1 |
| Gating Layer | ||
| Media Temperature | 4.61 | 4.38 | 0.23 |
|---|---|---|---|
| Media Oxygen | 4.61 | 4.27 | 0.34 |
| Temperature pH | 0.61 | 0.57 | 0.04 |
| Flat Trans. | +Gating | RNABERT+Gating | |
| Temperature | |||
| Psychrophile (6%) | 52.3 | 58.7 | 61.2 |
| Mesophile (89%) | 94.2 | 95.1 | 95.8 |
| Thermophile (5%) | 48.6 | 55.4 | 58.9 |
| pH | |||
| Acidophile (4%) | 45.2 | 52.8 | 56.3 |
| Media category | # samples | F1 |
|---|---|---|
| TSA (most common) | 8,247 | 68.4 |
| BHI | 5,182 | 61.7 |
| Nutrient Agar | 4,891 | 59.3 |
| Marine Agar | 3,256 | 52.8 |
| Acidic mineral (tail) | 47 | 12.3 |
| Methanogen medium (tail) | 31 | 8.7 |
| Method | Media | Temp. | pH | O 2 |
|---|---|---|---|---|
| -mer + RF | 28.4 | 62.3 | 58.7 | 54.2 |
| -mer + XGBoost | 31.2 | 65.1 | 61.4 | 57.8 |
| CNN Encoder | 34.6 | 67.8 | 63.2 | 60.4 |
| Transformer (Flat) | 38.2 | 71.5 | 66.8 | 64.1 |
| Transformer + Gating | 43.7 | 76.2 | 72.4 | 69.8 |
| RNABERT | 41.8 | 74.6 | 70.9 | 68.2 |
| Distance to nearest training genus | RNABERT+Gating | GROWREC | ||
|---|---|---|---|---|
| Close ( 90% 16S identity) | 3,180 | 52.1% | 38.4% | pp |
| Medium (80–90%) | 4,130 | 43.8% | 27.6% | pp |
| Distant ( 80%) | 2,443 | 33.1% | 16.3% | pp |
| # conditions correct | % of test strains | Cumulative |
|---|---|---|
| 4/4 (exact match) | 44.2% | 44.2% |
| 3/4 | 32.1% | 76.3% |
| 2/4 | 16.8% | 93.1% |
| 1/4 | 6.9% | 100% |
| Task | Classes | Top-1 | Top-2 | Top-3 | Top-5 |
|---|---|---|---|---|---|
| Media | 42 | 54.8% | 66.3% | 74.8% | 82.1% |
| Temperature | 3 | 92.1% | 98.4% | — | — |
| pH | 3 | 93.5% | 98.8% | — | — |
| Oxygen | 4 | 82.7% | 93.2% | 97.1% | — |
| Split strategy | Flat Trans. | Trans.+Gating | RNABERT+Gating |
|---|---|---|---|
| Random split | 58.2% | 61.7% | 64.3% |
| Genus-aware (ours) | 36.8% | 41.5% | 44.2% |
| Inflation | pp | pp | pp |
| Comparison | Joint Acc. | 95% Bootstrap CI | McNemar |
|---|---|---|---|
| Transformer+Gating vs. Flat Transformer | % | ||
| RNABERT+Gating vs. RNABERT | % | ||
| RNABERT+Gating vs. Flat Transformer | % |
| Method | Full length | 440-token crop | (crop) |
|---|---|---|---|
| Flat Transformer | 36.8% | 33.4% | pp |
| Transformer+Gating | 41.5% | 38.2% | pp |
| RNABERT (fixed 440) | — | 39.7% | — |
| RNABERT+Gating (fixed 440) | — | 44.2% | — |