Логотип Ml Peptide Generation

Ml Peptide Generation

Спільнота
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.

Огляд

Видавецьssinder
Репозиторійbioinformatics-agent-skills
Назва навичкиml-peptide-generation
Зірки
75
Форки
2
Файли в пакеті
6
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 6

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: ssinder. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Ml Peptide Generation у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/ml-peptide-generation
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Ml Peptide Generation в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Ml Peptide Generation, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Ml Peptide Generation не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

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

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ 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...

Навіщо використовувати Ml Peptide Generation у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Ml Peptide Generation — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Ml Peptide Generation у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/ml-peptide-generation. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Ml Peptide Generation?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Ml Peptide Generation?

Зі скількома забажаєте. У TypingMind ви можете використовувати Ml Peptide Generation із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Ml Peptide Generation?

Так. На GitHub цю навичку публікує ssinder за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇