bio-workflows-outbreak-pipeline
БесплатноЗапускает вложенные скриптыНе проверенEnd-to-end outbreak investigation from pathogen isolates to transmission networks. Orchestrates MLST typing, AMR surveillance, phylodynamic dating, and…
от FridrichMethod★ 17 звёзд на GitHubОб этом скилле
Outbreak Pipeline
Complete workflow for genomic epidemiology: from pathogen isolates to transmission networks and outbreak characterization.
Workflow Overview
Pathogen Isolate Genomes (FASTA/FASTQ)
|
v
+---------+---------+
| |
v v
[1a. MLST Typing] [1b. AMR Detection] <-- Parallel execution
| |
+--------+----------+
|
v
[2. Core Genome Alignment] --> snippy / ParSNP
|
v
[3. Phylodynamics] --> TreeTime / BEAST2
|
v
[4. Transmission Inference] --> TransPhylo
|
v
Transmission Network + R0 Estimates + Timeline
Prerequisites
conda install -c bioconda mlst abricate snippy iqtree fasttree
pip install treetime transphylo biopython pandas matplotlib
# R packages for TransPhylo
Rscript -e "install.packages('TransPhylo')"
Primary Path: Bacterial Outbreak Investigation
Step 1a: MLST Typing (Parallel)
#!/bin/bash
ISOLATES="isolate1.fasta isolate2.fasta isolate3.fasta"
OUTDIR="outbreak_results"
mkdir -p ${OUTDIR}/{mlst,amr,alignment,phylo,transmission}
# Run MLST on all isolates
echo "=== MLST Typing ==="
for fasta in $ISOLATES; do
sample=$(basename $fasta .fasta)
mlst $fasta > ${OUTDIR}/mlst/${sample}.mlst.txt
done
# Combine results
cat ${OUTDIR}/mlst/*.mlst.txt > ${OUTDIR}/mlst/all_mlst.tsv
echo "MLST complete: ${OUTDIR}/mlst/all_mlst.tsv"
Step 1b: AMR Detection (Parallel)
echo "=== AMR Detection ==="
for fasta in $ISOLATES; do
sample=$(basename $fasta .fasta)
abricate --db ncbi $fasta > ${OUTDIR}/amr/${sample}.amr.tsv
done
# Summary matrix
abricate --summary ${OUTDIR}/amr/*.amr.tsv > ${OUTDIR}/amr/amr_summary.tsv
echo "AMR summary: ${OUTDIR}/amr/amr_summary.tsv"
Step 2: Core Genome Alignment
echo "=== Core Genome Alignment ==="
REFERENCE="reference.gbk" # Reference genome in GenBank format
# Run snippy for each isolate
for fasta in $ISOLATES; do
sample=$(basename $fasta .fasta)
snippy --outdir ${OUTDIR}/alignment/snippy_${sample} \
--ref $REFERENCE \
--ctgs $fasta \
--cpus 8
done
# Core SNP alignment
snippy-core --ref $REFERENCE ${OUTDIR}/alignment/snippy_*
# Clean alignment (remove recombination, optional)
# run_gubbins.py core.full.aln
mv core.* ${OUTDIR}/alignment/
echo "Core alignment: ${OUTDIR}/alignment/core.aln"
Step 3: Phylodynamics with TreeTime
import subprocess
from Bio import Phylo, AlignIO
import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Path
outdir = Path('outbreak_results')
# Build ML tree
subprocess.run([
'iqtree2', '-s', str(outdir / 'alignment/core.aln'),
'-m', 'GTR+G', '-bb', '1000', '-nt', 'AUTO',
'--prefix', str(outdir / 'phylo/outbreak')
], check=True)
# Prepare metadata with dates
# Format: name\tdate (YYYY-MM-DD or decimal year)
metadata = pd.DataFrame({
'name': ['isolate1', 'isolate2', 'isolate3', 'isolate4', 'isolate5'],
'date': ['2024-01-15', '2024-01-22', '2024-02-01', '2024-02-10', '2024-02-15']
})
metadata.to_csv(outdir / 'phylo/metadata.tsv', sep='\t', index=False)
# Run TreeTime
subprocess.run([
'treetime',
'--tree', str(outdir / 'phylo/outbreak.treefile'),
'--aln', str(outdir / 'alignment/core.aln'),
'--dates', str(outdir / 'phylo/metadata.tsv'),
'--outdir', str(outdir / 'phylo/treetime_output'),
'--coalescent', 'skyline',
'--clock-filter', '3' # Remove outliers >3 IQR from clock
], check=True)
# Check temporal signal
# Good signal: R2 > 0.5, clock rate ~1e-6 to 1e-7 subs/site/year for bacteria
print('TreeTime output:', outdir / 'phylo/treetime_output')
Step 4: Transmission Inference with TransPhylo
library(TransPhylo)
library(ape)
# Load dated tree from TreeTime
tree <- read.nexus("outbreak_results/phylo/treetime_output/timetree.nexus")
# Set parameters
# dateT: date when sampling stopped
# w.shape, w.scale: generation time distribution (Gamma)
# For many bacteria: mean ~14 days, shape=2, scale=7
dateT <- 2024.2 # Decimal year when sampling ended
w_shape <- 2 # Generation time shape (Gamma)
w_scale <- 7/365 # Generation time scale in years (~7 days mean)
# Run TransPhylo
res <- inferTTree(tree, dateT = dateT,
w.shape = w_shape, w.scale = w_scale,
mcmcIterations = 10000,
startNeg = 1, startPi = 0.5)
# Extract results
ttree <- extractTTree(res)
# Transmission network
medTTree <- medTTree(res)
# Plot transmission tree
pdf("outbreak_resu
Установить bio-workflows-outbreak-pipeline в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
read_filerun_shell_commandВложенные файлы
FAQ
Что делает скилл bio-workflows-outbreak-pipeline?
End-to-end outbreak investigation from pathogen isolates to transmission networks. Orchestrates MLST typing, AMR surveillance, phylodynamic dating, and transmission inference with TransPhylo. Use when investigating disease outbreaks or tracking pathogen transmission chains.
Как установить скилл bio-workflows-outbreak-pipeline?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bio-workflows-outbreak-pipeline запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub