Nextflow Development
AnthropicOfficialPublished by Anthropic
- Skill
- Workflow
- Science and research
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for researchers to execute nf-core bioinformatics pipelines. It guides users through environment validation, data acquisition from public repositories like GEO/SRA or local sources, samplesheet generation, and pipeline execution. It supports standard omics analyses including gene expression, variant calling, and chromatin accessibility, while ensuring the computing environment is correctly configured with Docker and Nextflow.
What it does
- Validates system requirements including Docker, Nextflow, and Java versions.
- Fetches and prepares public sequencing data from GEO/SRA accessions.
- Automates the creation and validation of pipeline-specific samplesheets.
- Executes nf-core pipelines for RNA-seq, Sarek, and ATAC-seq workflows.
- Manages reference genome downloads and configuration.
- Verifies analysis outputs and pipeline completion logs.
When to use it
- When you need to perform large-scale omics analysis on local FASTQ files.
- When reanalyzing public datasets from GEO/SRA.
- When you require a standardized, reproducible pipeline for RNA-seq, WGS/WES, or ATAC-seq.
- When setting up a new bioinformatics environment for nf-core pipeline execution.
Advantages
- Standardizes bioinformatics workflows for non-specialists.
- Reduces manual errors in samplesheet creation and environment setup.
- Provides clear decision points for pipeline selection and configuration.
- Includes built-in validation steps to ensure pipeline success.
- Simplifies the integration of public data into local analysis pipelines.
Usage examples
- “Run the rnaseq pipeline on my local FASTQ files.”
- The agent will check your environment, help you generate a samplesheet, confirm the genome, and execute the nf-core/rnaseq pipeline.
- “Analyze the public dataset GSE110004.”
- The agent will fetch the study metadata, download the relevant FASTQ files, create the necessary samplesheet, and prepare the pipeline for execution.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/anthropics/nextflow-development/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip nextflow-development.zip -d .agents/skills
Documentation by Anthropic
nf-core Pipeline Deployment
Run nf-core bioinformatics pipelines on local or public sequencing data.
Target users: Bench scientists and researchers without specialized bioinformatics training who need to run large-scale omics analyses—differential expression, variant calling, or chromatin accessibility analysis.
Workflow Checklist
- [ ] Step 0: Acquire data (if from GEO/SRA)
- [ ] Step 1: Environment check (MUST pass)
- [ ] Step 2: Select pipeline (confirm with user)
- [ ] Step 3: Run test profile (MUST pass)
- [ ] Step 4: Create samplesheet
- [ ] Step 5: Configure & run (confirm genome with user)
- [ ] Step 6: Verify outputsStep 0: Acquire Data (GEO/SRA Only)
Skip this step if user has local FASTQ files.
For public datasets, fetch from GEO/SRA first. See references/geo-sra-acquisition.md for the full workflow.
Quick start:
# 1. Get study info
python scripts/sra_geo_fetch.py info GSE110004
# 2. Download (interactive mode)
python scripts/sra_geo_fetch.py download GSE110004 -o ./fastq -i
# 3. Generate samplesheet
python scripts/sra_geo_fetch.py samplesheet GSE110004 --fastq-dir ./fastq -o samplesheet.csvDECISION POINT: After fetching study info, confirm with user:
Which sample subset to download (if multiple data types)
Suggested genome and pipeline
Then continue to Step 1.
Step 1: Environment Check
Run first. Pipeline will fail without passing environment.
python scripts/check_environment.pyAll critical checks must pass. If any fail, provide fix instructions:
Docker issues
| Problem | Fix |
|---|---|
| Not installed | Install from https://docs.docker.com/get-docker/ |
| Permission denied | sudo usermod -aG docker $USER then re-login |
| Daemon not running | sudo systemctl start docker |
Nextflow issues
| Problem | Fix |
|---|---|
| Not installed | curl -s https://get.nextflow.io | bash && mv nextflow ~/bin/ |
| Version < 23.04 | nextflow self-update |
Java issues
| Problem | Fix |
|---|---|
| Not installed / < 11 | sudo apt install openjdk-11-jdk |
Do not proceed until all checks pass. For HPC/Singularity, see references/troubleshooting.md.
Step 2: Select Pipeline
DECISION POINT: Confirm with user before proceeding.
| Data Type | Pipeline | Version | Goal |
|---|---|---|---|
| RNA-seq | rnaseq | 3.22.2 | Gene expression |
| WGS/WES | sarek | 3.7.1 | Variant calling |
| ATAC-seq | atacseq | 2.1.2 | Chromatin accessibility |
Auto-detect from data:
python scripts/detect_data_type.py /path/to/dataFor pipeline-specific details:
Step 3: Run Test Profile
Validates environment with small data. MUST pass before real data.
nextflow run nf-core/<pipeline> -r <version> -profile test,docker --outdir test_output| Pipeline | Command |
|---|---|
| rnaseq | nextflow run nf-core/rnaseq -r 3.22.2 -profile test,docker --outdir test_rnaseq |
| sarek | nextflow run nf-core/sarek -r 3.7.1 -profile test,docker --outdir test_sarek |
| atacseq | nextflow run nf-core/atacseq -r 2.1.2 -profile test,docker --outdir test_atacseq |
Verify:
ls test_output/multiqc/multiqc_report.html
grep "Pipeline completed successfully" .nextflow.logIf test fails, see references/troubleshooting.md.
Step 4: Create Samplesheet
Generate automatically
python scripts/generate_samplesheet.py /path/to/data <pipeline> -o samplesheet.csvThe script:
Discovers FASTQ/BAM/CRAM files
Pairs R1/R2 reads
Infers sample metadata
Validates before writing
For sarek: Script prompts for tumor/normal status if not auto-detected.
Validate existing samplesheet
python scripts/generate_samplesheet.py --validate samplesheet.csv <pipeline>Samplesheet formats
rnaseq:
sample,fastq_1,fastq_2,strandedness
SAMPLE1,/abs/path/R1.fq.gz,/abs/path/R2.fq.gz,autosarek:
patient,sample,lane,fastq_1,fastq_2,status
patient1,tumor,L001,/abs/path/tumor_R1.fq.gz,/abs/path/tumor_R2.fq.gz,1
patient1,normal,L001,/abs/path/normal_R1.fq.gz,/abs/path/normal_R2.fq.gz,0atacseq:
sample,fastq_1,fastq_2,replicate
CONTROL,/abs/path/ctrl_R1.fq.gz,/abs/path/ctrl_R2.fq.gz,1Step 5: Configure & Run
5a. Check genome availability
python scripts/manage_genomes.py check <genome>
# If not installed:
python scripts/manage_genomes.py download <genome>Common genomes: GRCh38 (human), GRCh37 (legacy), GRCm39 (mouse), R64-1-1 (yeast), BDGP6 (fly)
5b. Decision points
DECISION POINT: Confirm with user:
Genome: Which reference to use
Pipeline-specific options:
rnaseq: aligner (star_salmon recommended, hisat2 for low memory)
sarek: tools (haplotypecaller for germline, mutect2 for somatic)
atacseq: read_length (50, 75, 100, or 150)
5c. Run pipeline
nextflow run nf-core/<pipeline> \
-r <version> \
-profile docker \
--input samplesheet.csv \
--outdir results \
--genome <genome> \
-resumeKey flags:
-r: Pin version-profile docker: Use Docker (orsingularityfor HPC)--genome: iGenomes key-resume: Continue from checkpoint
Resource limits (if needed):
--max_cpus 8 --max_memory '32.GB' --max_time '24.h'Step 6: Verify Outputs
Check completion
ls results/multiqc/multiqc_report.html
grep "Pipeline completed successfully" .nextflow.logKey outputs by pipeline
rnaseq:
results/star_salmon/salmon.merged.gene_counts.tsv- Gene countsresults/star_salmon/salmon.merged.gene_tpm.tsv- TPM values
sarek:
results/variant_calling/*/- VCF filesresults/preprocessing/recalibrated/- BAM files
atacseq:
results/macs2/narrowPeak/- Peak callsresults/bwa/mergedLibrary/bigwig/- Coverage tracks
Quick Reference
For common exit codes and fixes, see references/troubleshooting.md.
Resume failed run
nextflow run nf-core/<pipeline> -resumeReferences
references/geo-sra-acquisition.md - Downloading public GEO/SRA data
references/troubleshooting.md - Common issues and fixes
references/installation.md - Environment setup
references/pipelines/rnaseq.md - RNA-seq pipeline details
references/pipelines/sarek.md - Variant calling details
references/pipelines/atacseq.md - ATAC-seq details
Disclaimer
This skill is provided as a prototype example demonstrating how to integrate nf-core bioinformatics pipelines into Claude Code for automated analysis workflows. The current implementation supports three pipelines (rnaseq, sarek, and atacseq), serving as a foundation that enables the community to expand support to the full set of nf-core pipelines.
It is intended for educational and research purposes and should not be considered production-ready without appropriate validation for your specific use case. Users are responsible for ensuring their computing environment meets pipeline requirements and for verifying analysis results.
Anthropic does not guarantee the accuracy of bioinformatics outputs, and users should follow standard practices for validating computational analyses. This integration is not officially endorsed by or affiliated with the nf-core community.
Attribution
When publishing results, cite the appropriate pipeline. Citations are available in each nf-core repository's CITATIONS.md file (e.g., https://github.com/nf-core/rnaseq/blob/3.22.2/CITATIONS.md).
Licenses
nf-core pipelines: MIT License (https://nf-co.re/about)
Nextflow: Apache License, Version 2.0 (https://www.nextflow.io/about-us.html)
NCBI SRA Toolkit: Public Domain (https://github.com/ncbi/sra-tools/blob/master/LICENSE)
Files
- ATTRIBUTION.mdAdded by AutoGineer972 B
- LICENSE.txt10.0 KiB
- SKILL.md8.6 KiB
- references/geo-sra-acquisition.md13.8 KiB
- references/installation.md1.8 KiB
- references/pipelines/atacseq.md4.1 KiB
- references/pipelines/rnaseq.md3.5 KiB
- references/pipelines/sarek.md3.9 KiB
- references/troubleshooting.md3.3 KiB
- scripts/check_environment.pyScript13.8 KiB
- scripts/config/genomes.yaml3.4 KiB
- scripts/config/pipelines/atacseq.yaml5.0 KiB
- scripts/config/pipelines/rnaseq.yaml4.1 KiB
- scripts/config/pipelines/sarek.yaml6.1 KiB
- scripts/detect_data_type.pyScript9.7 KiB
- scripts/generate_samplesheet.pyScript15.1 KiB
- scripts/manage_genomes.pyScript16.3 KiB
- scripts/sra_geo_fetch.pyScript24.4 KiB
- scripts/utils/__init__.pyScript1.7 KiB
- scripts/utils/file_discovery.pyScript5.0 KiB
- scripts/utils/ncbi_utils.pyScript27.8 KiB
- scripts/utils/sample_inference.pyScript7.7 KiB
- scripts/utils/validators.pyScript8.2 KiB
scripts/utils/validators.py
"""
Samplesheet validation utilities.
Validates samplesheet rows against pipeline configuration before writing,
catching errors early with helpful messages.
"""
import os
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, List, Optional
import yaml
@dataclass
class ValidationResult:
"""Result of samplesheet validation."""
valid: bool
errors: List[str] = field(default_factory=list)
warnings: List[str] = field(default_factory=list)
suggestions: List[str] = field(default_factory=list)
def __bool__(self):
return self.valid
def summary(self) -> str:
"""Generate human-readable summary."""
lines = []
if self.errors:
lines.append("Errors:")
for e in self.errors:
lines.append(f" - {e}")
if self.warnings:
lines.append("Warnings:")
for w in self.warnings:
lines.append(f" - {w}")
if self.suggestions:
lines.append("Suggestions:")
for s in self.suggestions:
lines.append(f" - {s}")
return "\n".join(lines)
def load_pipeline_config(pipeline: str) -> Optional[Dict]:
"""Load pipeline configuration from YAML file."""
# Find config directory relative to this file
script_dir = Path(__file__).parent.parent.parent
config_path = script_dir / "config" / "pipelines" / f"{pipeline}.yaml"
if not config_path.exists():
return None
with open(config_path) as f:
return yaml.safe_load(f)
def validate_samplesheet(
rows: List[Dict],
pipeline: str,
config: Optional[Dict] = None
) -> ValidationResult:
"""
Validate samplesheet rows against pipeline requirements.
Args:
rows: List of row dictionaries
pipeline: Pipeline name (e.g., 'rnaseq', 'sarek')
config: Optional pre-loaded config dict
Returns:
ValidationResult with errors, warnings, and suggestions
"""
errors = []
warnings = []
suggestions = []
# Load config if not provided
if config is None:
config = load_pipeline_config(pipeline)
if config is None:
errors.append(f"Unknown pipeline: {pipeline}")
return ValidationResult(valid=False, errors=errors)
columns = config.get("samplesheet", {}).get("columns", [])
required_cols = [c["name"] for c in columns if c.get("required", False)]
if not rows:
errors.append("Samplesheet is empty - no samples found")
return ValidationResult(valid=False, errors=errors)
# Validate each row
for i, row in enumerate(rows):
row_num = i + 2 # Account for header row
# Check required columns
for col_name in required_cols:
col_config = next((c for c in columns if c["name"] == col_name), None)
# Skip columns with conditions that don't apply
if col_config and "condition" in col_config:
# Simple condition check - skip for now
# Full implementation would evaluate conditions
pass
if col_name not in row or row[col_name] is None or row[col_name] == "":
# Check if there's a default
if col_config and "default" in col_config:
continue
errors.append(f"Row {row_num}: Missing required column '{col_name}'")
# Validate path columns exist
for col_name in ["fastq_1", "fastq_2", "bam", "bai"]:
if col_name in row and row[col_name]:
path = row[col_name]
if not os.path.exists(path):
errors.append(f"Row {row_num}: File not found: {path}")
elif not os.path.isfile(path):
errors.append(f"Row {row_num}: Not a file: {path}")
# Validate enum values
for col_config in columns:
col_name = col_config["name"]
if col_name in row and row[col_name] and "allowed" in col_config:
value = row[col_name]
allowed = col_config["allowed"]
if value not in allowed:
errors.append(
f"Row {row_num}: Invalid value '{value}' for '{col_name}'. "
f"Allowed: {allowed}"
)
# Check R1/R2 pairing consistency
r1 = row.get("fastq_1", "")
r2 = row.get("fastq_2", "")
if r1 and not r2:
warnings.append(f"Row {row_num}: Single-end data (no R2 file)")
elif r2 and not r1:
errors.append(f"Row {row_num}: R2 present but R1 missing")
# Check for duplicate samples
sample_col = "sample" if "sample" in rows[0] else "patient"
if sample_col in rows[0]:
samples = [r.get(sample_col, "") for r in rows]
duplicates = [s for s in set(samples) if samples.count(s) > 1]
if duplicates:
warnings.append(f"Duplicate sample names: {duplicates}")
suggestions.append(
"Duplicates may be intentional (multi-lane sequencing). "
"Verify sample grouping is correct."
)
# Pipeline-specific validation
if pipeline == "sarek":
_validate_sarek_specific(rows, errors, warnings, suggestions)
elif pipeline == "atacseq":
_validate_atacseq_specific(rows, errors, warnings, suggestions)
return ValidationResult(
valid=len(errors) == 0,
errors=errors,
warnings=warnings,
suggestions=suggestions
)
def _validate_sarek_specific(
rows: List[Dict],
errors: List[str],
warnings: List[str],
suggestions: List[str]
):
"""Sarek-specific validation for tumor/normal pairing."""
# Group by patient
patients = {}
for row in rows:
patient = row.get("patient", "")
status = row.get("status")
if patient not in patients:
patients[patient] = {"tumor": 0, "normal": 0, "unknown": 0}
if status == 1:
patients[patient]["tumor"] += 1
elif status == 0:
patients[patient]["normal"] += 1
else:
patients[patient]["unknown"] += 1
# Check pairing
for patient, counts in patients.items():
if counts["tumor"] > 0 and counts["normal"] == 0:
warnings.append(
f"Patient '{patient}': Tumor sample(s) without matched normal. "
"Somatic calling works best with paired tumor-normal."
)
suggestions.append(
f"For patient '{patient}': Add a normal sample or use tumor-only mode."
)
if counts["unknown"] > 0:
warnings.append(
f"Patient '{patient}': {counts['unknown']} sample(s) with unknown status. "
"Set status column to 0 (normal) or 1 (tumor)."
)
def _validate_atacseq_specific(
rows: List[Dict],
errors: List[str],
warnings: List[str],
suggestions: List[str]
):
"""ATAC-seq specific validation for replicates."""
# Group by sample (condition)
samples = {}
for row in rows:
sample = row.get("sample", "")
replicate = row.get("replicate", 1)
if sample not in samples:
samples[sample] = []
samples[sample].append(replicate)
# Check replicates
for sample, reps in samples.items():
if len(reps) < 2:
warnings.append(
f"Sample '{sample}': Only {len(reps)} replicate(s). "
"Consensus peaks require 2+ replicates."
)
# Check for duplicate replicate numbers
if len(reps) != len(set(reps)):
errors.append(
f"Sample '{sample}': Duplicate replicate numbers detected. "
"Each replicate must have a unique number."
)
# Check all samples have R2 (ATAC-seq requires paired-end)
for i, row in enumerate(rows):
if not row.get("fastq_2"):
errors.append(
f"Row {i+2}: ATAC-seq requires paired-end data. R2 file missing."
)
def validate_file_exists(path: str) -> bool:
"""Check if file exists and is accessible."""
return os.path.isfile(path) and os.access(path, os.R_OK)
def validate_absolute_path(path: str) -> bool:
"""Check if path is absolute."""
return os.path.isabs(path)
Requirements and compatibility
Written for: Claude Code, Claude apps
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs network access, Needs Python
Security
What our scanner noticed· Medium risk
- Instructions that use the network
- Downloads piped into a shell
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Anthropic
- Publisher
- Anthropic (Official)
- Source
- anthropics/knowledge-work-plugins · bio-research/skills/nextflow-development · commit e050c2e
- Licence
- Apache License 2.0 (redistribution allowed)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Anthropic or Anthropic.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nextflow-development.zip