Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-cfdna-preprocessing

БесплатноЗапускает вложенные скриптыНе проверен

Decides how to preprocess plasma cfDNA sequencing data so the recoverable signal survives - library-prep-aware fragment expectations (dsDNA vs ssDNA/adaptase…

lilinjiот lilinji★ 18 звёзд на GitHub

Об этом скилле

Version Compatibility

Reference examples tested with: bwa 0.7.17+, fgbio 2.1+, numpy 1.26+, pysam 0.22+, samtools 1.19+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • CLI: <tool> --version then <tool> --help to confirm flags

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Notes specific to this skill: fgbio flag semantics drift across major versions - in CallDuplexConsensusReads the --min-reads is a permissive PRE-filter (fgbio issue #1009), and in FilterConsensusReads the --min-reads (-M) takes up to three values "total strand1 strand2" where if values two and three differ the more stringent value must come first. Confirm both against the installed fgbio --help before scripting.

cfDNA Preprocessing

"Preprocess my plasma cfDNA reads" -> Convert reads to consensus molecules and an analysis-ready BAM without destroying the fragment-size signal or collapsing independent molecules.

  • CLI: fgbio ExtractUmisFromBam -> bwa mem -Y -> fgbio GroupReadsByUmi -> fgbio Call*ConsensusReads -> RE-align -> fgbio FilterConsensusReads
  • Python: shell the fgbio/bwa chain with subprocess; read insert sizes with pysam for QC

The Single Most Important Modern Insight -- Pre-Analytics and Library Prep Set the Ceiling; Consensus Is Error Suppression, Not Just Dedup

What a cfDNA assay can ever see is fixed before any bioinformatics runs. cfDNA is not randomly sheared - it is a nucleosome footprint with a mononucleosome mode at ~167 bp and a ctDNA-enriched short tail (134-144 bp), so fragment length is structured biological signal, not noise to be normalized away. Two upstream choices determine what survives: (1) the blood draw and plasma prep (a delayed draw dumps leukocyte gDNA into the denominator and irreversibly dilutes tumor fraction - no algorithm recovers it; defer that QC to liquid-biopsy/analytical-validation), and (2) the library chemistry (dsDNA ligation polishes native ends and discards the sub-100 bp population; ssDNA/adaptase prep recovers short and damaged molecules). Reverse engineering a fragment the prep threw away, or a molecule a bad draw never delivered, is impossible.

The second reframe: UMI/duplex consensus is error suppression, not merely duplicate removal. Grouping reads by UMI and majority-voting a consensus erases PCR/sequencing errors that are not shared across a family - but a single-strand consensus votes unanimously for damage (C->T deamination, G->T 8-oxoG) that was on the template before amplification. Only DUPLEX consensus, requiring the same base on both independently-copied strands, removes those lesions. Single-strand consensus cannot. Choosing simplex vs duplex is choosing an error floor, and it trades against molecular recovery at low input (the singleton tax below).

Library-Prep and Consensus Landscape

Choice What it does Recoverable distribution / error floor
dsDNA ligation prep (NEB/KAPA-style) needs duplex substrate; end-repair/A-tail polishes native ends clean ~167 bp mode; sub-100 bp tail and native-end signal LOST
ssDNA prep, SRSLY/Kircher-Meyer lineage denatures, ligates single strands; retains native ends + sawtooth recovers short/nicked/damaged + sub-nucleosomal; prep for fragmentomics
ssDNA prep, adaptase/tail-based (Swift/Accel-1S) single-strand but adaptase chemistry shifts apparent size ~10 bp short of the canonical mode; sawtooth blunted (a chemistry signature, not a bug)
Single-strand UMI consensus (CallMolecularConsensusReads) majority-vote one source strand's reads removes PCR/sequencer error (~1e-4 to 1e-5); CANNOT remove deamination/oxidation damage
DUPLEX consensus (CallDuplexConsensusReads) combine both-strand single-strand consensuses error must occur identically on both strands to survive (~<1e-7); removes deamination/oxidation

Decision Tree by Scenario

Scenario Recommended path Why
Deep targeted panel with single-strand UMIs adjacency group -> CallMolecularConsensusReads -> FilterConsensusReads simplex consensus suppresses PCR/sequencer error to ~1e-4; the panel-VAF workhorse
Need VAF below ~0.1% / MRD-grade specificity duplex prep -> --strategy paired -> CallDuplexConsensusReads -> filter 2 1 1 duplex removes damage artifacts; reaches the ~1e-7 floor single-strand cannot
sWGS / ULP-WGS for tumor fraction minimal processing: trim -> align -> light dedup; NO consensus TF from copy number needs even coverage, not error suppression; defer to tumor-fraction-estimation
Degraded / low-input / FFPE-adjacent sample ssDNA prep (SRSLY) to recover short+damaged molecules dsDNA prep discards exactly the mole
Полный SKILL.md на GitHub

Установить bio-cfdna-preprocessing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/preprocess_cfdna.pyusage-guide.md

FAQ

Что делает скилл bio-cfdna-preprocessing?

Decides how to preprocess plasma cfDNA sequencing data so the recoverable signal survives - library-prep-aware fragment expectations (dsDNA vs ssDNA/adaptase prep), UMI/duplex consensus with fgbio (ExtractUmisFromBam, GroupReadsByUmi --strategy paired for duplex, CallMolecularConsensusReads vs CallDuplexConsensusReads, FilterConsensusReads min-reads "total s1 s2"), the align->group->consensus->RE-align ordering, and the cfDNA dedup trap where naive coordinate dedup collapses nucleosome-coincident independent molecules. Covers when single-strand consensus suffices vs when duplex is mandatory, the singleton/sensitivity tax at low input, and reading the insert-size histogram as a pre-analytical QC instrument. Use when processing plasma cfDNA reads before fragmentomics, ctDNA mutation calling, or tumor-fraction estimation.

Как установить скилл bio-cfdna-preprocessing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-cfdna-preprocessing запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-cfdna-preprocessing с