Launch a Full Peptide Screening Campaign, Model Properties in Parallel

Define a multi-stage pipeline, run stability and solubility predictions in parallel, and rank your library down to a shortlist.




What you'll learn:

  • Defining a multi-stage pipeline with parallel predictions
  • Filtering by melting temperature and solubility
  • Exploring results with summary(), stats(), and SQL queries

export BIOLMAI_TOKEN=your-token-here

Setup

import os
from biolmai.pipeline import (
    DataPipeline, DuckDBDataStore,
    ThresholdFilter, RankingFilter,
    ValidAminoAcidFilter, EmbeddingSpec,
    DiversitySamplingFilter,
)

TOKEN = os.environ.get("BIOLMAI_TOKEN", "")
if not TOKEN:
    raise EnvironmentError(
        "Set BIOLMAI_TOKEN before running.\n"
        "Get one at https://biolm.ai/ui/accounts/user-api-tokens/"
    )

Peptide library

30 antimicrobial peptides of varying length, charge, and hydrophobicity.

MY_PEPTIDES = [
    # Magainins / frog-derived
    "GIGKFLHSAKKFGKAFVGEIMNS",
    "GIGKFLHSAGKFGKAFVGEIMKS",
    "GLFDIIKKIAESF",
    "GLFDIVKKVVGALGSL",
    "FLPLILRKIVTAL",
    # Human defensins / cathelicidins
    "LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES",
    "RLFDKIRQVIRKF",
    "KWKLFKKIPKFLHLAKKF",
    # Insect-derived
    "GIGAVLKVLTTGLPALISWIKRKRQQ",
    "VDKGSYLPRPTPPRPIYNRN",
    # Synthetic / designed
    "KLAKLAKKLAKLAK",
    "LKLLKKLLKLLKKL",
    "RRWWRRWWRR",
    "KWKWKWKWKW",
    "GIKKFLGSIWKFIKAFVKEIMN",
    # Short peptides
    "RRWQWR",
    "RWRWRW",
    "FKRIVQRIKDFL",
    "KFLKKAKKFGK",
    "GIGKFLHSAK",
    "KWKLFKKI",
    "RLFDKIRQ",
    # Longer peptides
    "GLFDIIKKIAESFLPKV",
    "GIGKFLHSAKKFGKAFV",
    "KWKLFKKIPKFLHLAK",
]
print(f"{len(MY_PEPTIDES)} peptides, length range: {min(len(s) for s in MY_PEPTIDES)}{max(len(s) for s in MY_PEPTIDES)} aa")
25 peptides, length range: 637 aa

Build and run the pipeline

The dependency graph:

validate
   ├── predict_tm   ─┐
   └── predict_sol  ─┴── filter_tm >= 40°C ── rank top 15 by solubility

Both prediction stages run in parallel because they share the same dependency.

pipeline = DataPipeline(sequences=MY_PEPTIDES, verbose=True)

pipeline.add_filter(ValidAminoAcidFilter(), stage_name="validate")

pipeline.add_prediction(
    "temberture-regression", extractions="prediction",
    columns="melting_temperature", stage_name="predict_tm",
    depends_on=["validate"],
)
pipeline.add_prediction(
    "biolmsol", extractions="solubility_score",
    columns="solubility", stage_name="predict_sol",
    depends_on=["validate"],
)

pipeline.add_filter(ThresholdFilter("melting_temperature", min_value=40.0), stage_name="filter_tm")
pipeline.add_filter(RankingFilter("solubility", n=15, ascending=False), stage_name="top15")

pipeline.run()
Added stage: FilterStage('validate')
Added stage: PredictionStage('predict_tm', depends_on=['validate'])
Added stage: PredictionStage('predict_sol', depends_on=['validate'])
Added stage: FilterStage('filter_tm', depends_on=['predict_sol'])
Added stage: FilterStage('top15', depends_on=['filter_tm'])

############################################################
# Pipeline: DataPipeline
# Run ID: 20260617_141507_e9d0a416
# Initial sequences: 25
# Streaming: ENABLED
############################################################

Execution plan: 4 level(s)
  Level 1: validate
  Level 2: predict_tm, predict_sol (parallel)
  Level 3: filter_tm
  Level 4: top15

============================================================
Stage: validate
Input: 25 sequences
  Applying filter: ValidAminoAcidFilter(alphabet='ACDEFGHIKLMNPQRSTVWY')
  Filtered out: 0/25
  Remaining: 25
StageResult(validate: in=25, out=25, cached=0, computed=0, filtered=0, time=0.0s)
============================================================

Executing 2 stages in parallel...

============================================================
Stage: predict_tm
Input: 25 sequences
Depends on: validate
  Cached: 0/25
  To compute: 25
  Calling temberture-regression.predict...
============================================================
Stage: predict_sol
Input: 25 sequences
Depends on: validate
  Cached: 0/25
  To compute: 25
  Calling biolmsol.predict...
Completed: 25 sequences in 1 batches (max 5 concurrent)

StageResult(predict_sol: in=25, out=25, cached=0, computed=25, filtered=0, time=21.5s)
============================================================
Completed: 25 sequences in 1 batches (max 5 concurrent)

StageResult(predict_tm: in=25, out=25, cached=0, computed=25, filtered=0, time=26.0s)
============================================================

============================================================
Stage: filter_tm
Input: 25 sequences
Depends on: predict_sol
  Applying filter: ThresholdFilter(column='melting_temperature', min=40.0)
  Filtered out: 0/25
  Remaining: 25

StageResult(filter_tm: in=25, out=25, cached=0, computed=0, filtered=0, time=0.0s)
============================================================

============================================================
Stage: top15
Input: 25 sequences
Depends on: filter_tm
  Applying filter: RankingFilter(column='solubility', n=15, method='top')
  Filtered out: 10/25
  Remaining: 15

StageResult(top15: in=25, out=15, cached=0, computed=0, filtered=10, time=0.0s)
============================================================

############################################################
# Pipeline completed in 26.2s
# Final sequences: 15
############################################################
{'validate': StageResult(validate: in=25, out=25, cached=0, computed=0, filtered=0, time=0.0s),
 'predict_tm': StageResult(predict_tm: in=25, out=25, cached=0, computed=25, filtered=0, time=26.0s),
 'predict_sol': StageResult(predict_sol: in=25, out=25, cached=0, computed=25, filtered=0, time=21.5s),
 'filter_tm': StageResult(filter_tm: in=25, out=25, cached=0, computed=0, filtered=0, time=0.0s),
 'top15': StageResult(top15: in=25, out=15, cached=0, computed=0, filtered=10, time=0.0s)}

Explore results

pipeline.summary()
Stage Input Output Filtered Cached Computed Time (s)
0 validate 25 25 0 0 0 0.0
1 predict_tm 25 25 0 0 25 26.0
2 predict_sol 25 25 0 0 25 21.5
3 filter_tm 25 25 0 0 0 0.0
4 top15 25 15 10 0 0 0.0
pipeline.stats()
stage_name status input_count output_count completed_at
0 validate completed 25 25 2026-06-17 14:15:07.468943
1 predict_sol completed 25 25 2026-06-17 14:15:29.181349
2 predict_tm completed 25 25 2026-06-17 14:15:33.469389
3 filter_tm completed 25 25 2026-06-17 14:15:33.492115
4 top15 completed 25 15 2026-06-17 14:15:33.511078
# Top 10 sequences by melting temperature
pipeline.query("""
    SELECT s.sequence,
           MAX(CASE WHEN p.prediction_type = 'melting_temperature' THEN p.value END) AS tm,
           MAX(CASE WHEN p.prediction_type = 'solubility' THEN p.value END) AS solubility
    FROM sequences s
    JOIN predictions p ON s.sequence_id = p.sequence_id
    GROUP BY s.sequence
    ORDER BY tm DESC
    LIMIT 10
""")
sequence tm solubility
0 LKLLKKLLKLLKKL 81.053093 1.993930
1 KLAKLAKKLAKLAK 79.101234 2.326550
2 GIKKFLGSIWKFIKAFVKEIMN 78.899384 0.614828
3 FKRIVQRIKDFL 74.703255 1.318316
4 KWKLFKKIPKFLHLAKKF 74.061577 1.513157
5 LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES 73.924812 1.391619
6 KWKLFKKI 73.292221 1.766447
7 KFLKKAKKFGK 70.871254 2.850865
8 KWKLFKKIPKFLHLAK 67.577049 1.308439
9 GLFDIIKKIAESFLPKV 67.185707 0.364214
pipeline.plot("funnel")
No description has been provided for this image

Next Steps

Check out additional tutorials at jupyter.biolm.ai, or head over to our BioLM Documentation to explore additional models and functionality.

See more use-cases and APIs on your BioLM Console Catalog.


BioLM hosts deep learning models and runs inference at scale. You do the science.

Contact us to learn more.

Accelerate yourLead generation

BioLM offers tailored AI solutions to meet your experimental needs. We deliver top-tier results with our model-agnostic approach, powered by our highly scalable and real-time GPU-backed APIs and years of experience in biological data modeling, all at a competitive price.

CTA

We speak the language of bio-AI

© 2022 - 2026 BioLM. All Rights Reserved.

Screen 1,000 Peptides Before Lunch | BioLM