Ml Peptide Generation logo

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.

Overview

Publisherssinder
Repositorybioinformatics-agent-skills
Skill nameml-peptide-generation
Stars
75
Forks
2
Bundled files
6
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ssinder on GitHub. Read the source before you install it.

Installation

Install the Ml Peptide Generation AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/ml-peptide-generation
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ml Peptide Generation in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ml Peptide Generation on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ml Peptide Generation is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ml Peptide Generation AI skill do?

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...

Why use Ml Peptide Generation on TypingMind?

Because you install it once and use it with any model. Ml Peptide Generation is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ml Peptide Generation in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/ml-peptide-generation. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ml Peptide Generation?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ml Peptide Generation?

As many as you like. As long as a model supports skills, you can use Ml Peptide Generation with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ml Peptide Generation AI skill free?

Yes. It is published on GitHub by ssinder under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇