Logo van Ml Peptide Generation

Ml Peptide Generation

Community
ssinder
ml-peptide-generation

Generates candidate binder peptides for a target protein using the PepMLM-650M masked language model — appends <mask> tokens to the target sequence and samples amino acids at each position, with illegal residues (X, B, Z) excluded from the sampling candidates. Reports pseudo-perplexity for each candidate, supports reproducible generation via an explicit random seed, and provides offline filtering and parameter-sweep analysis that needs no GPU. This skill should be used when designing peptides or protein fragments that should bind a target, generating a ranked candidate pool for a target sequence, or comparing how peptide length and top-k sampling settings affect candidate quality.

Overzicht

Uitgeverssinder
Repositorybioinformatics-agent-skills
Skillnaamml-peptide-generation
Sterren
75
Forks
2
Meegeleverde bestanden
6
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 6

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door ssinder op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Ml Peptide Generation in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/ml-peptide-generation
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ssinder/bioinformatics-agent-skills.git /tmp/bioinformatics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/bioinformatics-agent-skills/skills/ml-peptide-generation .claude/skills/ml-peptide-generation
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Ml Peptide Generation in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Ml Peptide Generation automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Ml Peptide Generation niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

ML Peptide Generation

Overview

This skill generates candidate binder peptides for a target protein with PepMLM-650M, a masked language model trained on protein sequences.

The mechanism is straightforward: append N <mask> tokens to the target sequence, ask the model for its amino-acid distribution at each masked position, and sample from it. Repeating that for N positions produces an N-residue peptide.

Two things this skill does that a naive implementation does not:

  • Reproducible by construction. Every run takes an explicit --seed. The same seed and the same input always produce the same peptides, so a parameter sweep is a controlled experiment rather than a lottery.
  • Illegal residues are excluded at sampling time, not afterwards. The model's vocabulary contains X (unknown), B and Z (ambiguous amino acids). Sampling from the raw vocabulary produces peptides that are not chemically meaningful. Here those candidates are removed before the draw, so the sampling budget is not wasted on rejects.

When to Use This Skill

  • Designing a peptide or protein fragment intended to bind a target protein
  • Producing a ranked candidate pool for a set of targets
  • Comparing peptide lengths (10 / 12 / 15 aa) or top-k settings
  • Screening candidates before committing to synthesis or wet-lab validation

Quick Start

bash
export PYTHONPATH="$PWD/packages"

# 生成(需要 torch + transformers)
python scripts/generate_peptides.py \
    --input-fasta targets.fasta \
    --output-dir results/ \
    --peptide-lengths 10,12,15 \
    --num-binders 20 \
    --seed 42

# 分析(只用标准库,无需 GPU)
python scripts/analyze_peptides.py \
    --input results/peptides.csv \
    --output-dir analysis/ \
    --max-ppl 5.0

Workflow

  1. Collect targets — --input-fasta (FASTA), --input-csv (needs id and seq columns) or --input-seq (a single sequence).
  2. Set the seed — --seed fixes random, numpy and torch. The seed is written into every output row so a run can be reproduced later.
  3. Generate — for each target × peptide length × top-k combination, sample --num-binders peptides and score each by pseudo-perplexity.
  4. Analyse — analyze_peptides.py filters invalid peptides, applies optional PPL/length thresholds, and reports per-configuration statistics.
  5. Select — rank by pseudo-perplexity and carry the top candidates into downstream validation.

Parameters

generate_peptides.py

ParameterDefaultDescription
--input-fasta—Target protein FASTA file
--input-csv—Target CSV file (needs id and seq columns)
--input-seq—A single target sequence
--output-dirpeptide_resultsOutput directory
--per-target-diroffAlso write one CSV per target
--peptide-lengths10,12,15Peptide lengths to generate
--top-ks3Top-k values to sweep
--num-binders10Peptides per (target × length × top-k)
--seed42Random seed — same seed, same results
--modelTianlaiChen/PepMLM-650MPretrained model
--deviceautoForce cuda or cpu
--allow-invalid-amino-acidsoffAllow sampling X/B/Z

analyze_peptides.py

ParameterDefaultDescription
--inputrequiredOne or more result CSV files
--output-dirpeptide_analysisOutput directory
--max-pplnoneKeep only peptides with PPL ≤ this value
--min-length / --max-lengthnonePeptide length bounds
--keep-invalidoffKeep peptides containing non-standard residues
--top-n20How many to print

Outputs

FileContent
peptides.csvAll candidates: rank, target, length, top-k, binder, pseudo-perplexity, validity flag, seed
peptides.jsonSame content as JSON
filtered_peptides.csvCandidates passing the filters, sorted by PPL
parameter_analysis.csv / .jsonPer-configuration totals, mean/median/min/max PPL

Validation

  • Pseudo-perplexity measures the model's own belief, not binding affinity. A low PPL means "this looks like a peptide the model would have generated", not "this binds the target". It is a triage filter for wet-lab follow-up, nothing more. Any claim about affinity needs an experimental or orthogonal computational check.
  • PPL is only comparable within one (target, length) pair. The scale depends on the target sequence; do not compare PPL across different targets and conclude one target is "easier".
  • Check the validity flag. has_unknown_aa=True means the peptide contains a residue the model could not decide on — such a peptide is not a real design. The skill excludes these at sampling time, but the flag stays in the output so the filter can be audited.
  • Verify reproducibility. Re-run with the same --seed and diff peptides.csv; the files must be byte-identical apart from the generated_at timestamp.
  • Peptides shorter than about 8 residues rarely bind meaningfully. Use --min-length to exclude them from a synthesis list.
  • The model truncates at 552 tokens. Target sequences longer than that are rejected by the skill rather than silently truncated — a truncated target produces peptides for the wrong protein.

References

  • references/methodology.md — PepMLM mechanism, pseudo-perplexity derivation, sampling strategy
  • references/troubleshooting.md — common failures and how to diagnose them
  • Model card: https://huggingface.co/TianlaiChen/PepMLM-650M
  • E-utilities context for target discovery: the bioproject-search skill

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Ml Peptide Generation?

Generates candidate binder peptides for a target protein using the PepMLM-650M masked language model — appends <mask> tokens to the target sequence and samples amino acids at each position, with illegal residues (X, B, Z) excluded from the sampling candidates. Reports pseudo-perplexity for each candidate, supports reproducible generation via an explicit random seed, and provides offline filtering and parameter-sweep analysis that needs no GPU. This skill should be used when designing peptides or protein fragments that should bind a target, generating a ranked candidate pool for a target seq...

Waarom Ml Peptide Generation gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Ml Peptide Generation bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Ml Peptide Generation in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/ml-peptide-generation. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Ml Peptide Generation gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Ml Peptide Generation gebruiken?

Zoveel als je wilt. Je kunt Ml Peptide Generation gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Ml Peptide Generation gratis?

Ja. Deze skill is door ssinder op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇