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://mp-staging.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/check_environment.py
#!/usr/bin/env python3
"""
Pre-flight environment validation for nf-core pipelines.
Checks Docker, Nextflow, Java, system resources, and network connectivity.
Run this BEFORE attempting any pipeline execution.
Usage:
python check_environment.py
python check_environment.py --json
"""
import json
import os
import shutil
import subprocess
import sys
from dataclasses import dataclass, field, asdict
from typing import List, Optional
@dataclass
class CheckResult:
"""Result of a single environment check."""
name: str
passed: bool
message: str
details: Optional[str] = None
fix: Optional[str] = None
@dataclass
class EnvironmentReport:
"""Complete environment validation report."""
ready: bool
checks: List[CheckResult] = field(default_factory=list)
recommendations: List[str] = field(default_factory=list)
def to_dict(self):
return {
"ready": self.ready,
"checks": [asdict(c) for c in self.checks],
"recommendations": self.recommendations
}
def check_docker() -> CheckResult:
"""Check Docker availability, daemon status, and permissions."""
if not shutil.which("docker"):
return CheckResult(
name="Docker",
passed=False,
message="Docker not found in PATH",
fix="Install Docker: https://docs.docker.com/get-docker/"
)
try:
result = subprocess.run(
["docker", "info"],
capture_output=True,
text=True,
timeout=15
)
if result.returncode != 0:
stderr_lower = result.stderr.lower()
if "permission denied" in stderr_lower:
return CheckResult(
name="Docker",
passed=False,
message="Docker permission denied",
details="Cannot connect to Docker daemon",
fix="sudo usermod -aG docker $USER && newgrp docker"
)
elif "cannot connect" in stderr_lower or "is the docker daemon running" in stderr_lower:
return CheckResult(
name="Docker",
passed=False,
message="Docker daemon not running",
details=result.stderr[:200] if result.stderr else None,
fix="sudo systemctl start docker"
)
else:
return CheckResult(
name="Docker",
passed=False,
message="Docker error",
details=result.stderr[:200] if result.stderr else None,
fix="Check Docker installation and daemon status"
)
return CheckResult(
name="Docker",
passed=True,
message="Docker is available and running"
)
except subprocess.TimeoutExpired:
return CheckResult(
name="Docker",
passed=False,
message="Docker command timed out",
fix="Check Docker daemon status: sudo systemctl status docker"
)
except Exception as e:
return CheckResult(
name="Docker",
passed=False,
message=f"Docker check failed: {str(e)}"
)
def check_nextflow() -> CheckResult:
"""Check Nextflow installation and version (requires >= 23.04)."""
if not shutil.which("nextflow"):
return CheckResult(
name="Nextflow",
passed=False,
message="Nextflow not found in PATH",
fix="curl -s https://get.nextflow.io | bash && mv nextflow ~/bin/ && export PATH=$HOME/bin:$PATH"
)
try:
result = subprocess.run(
["nextflow", "-version"],
capture_output=True,
text=True,
timeout=30
)
output = result.stdout + result.stderr
version_line = output.strip().split('\n')[0] if output else ""
import re
match = re.search(r'(\d+)\.(\d+)\.(\d+)', version_line)
if match:
major, minor, patch = int(match.group(1)), int(match.group(2)), int(match.group(3))
version_str = f"{major}.{minor}.{patch}"
# Require version >= 23.04
if major > 23 or (major == 23 and minor >= 4):
return CheckResult(
name="Nextflow",
passed=True,
message=f"Nextflow {version_str} installed",
details=version_line
)
else:
return CheckResult(
name="Nextflow",
passed=False,
message=f"Nextflow {version_str} is outdated (requires >= 23.04)",
details=version_line,
fix="nextflow self-update"
)
return CheckResult(
name="Nextflow",
passed=True,
message="Nextflow installed (version unknown)",
details=version_line
)
except subprocess.TimeoutExpired:
return CheckResult(
name="Nextflow",
passed=False,
message="Nextflow command timed out",
fix="Check Nextflow installation"
)
except Exception as e:
return CheckResult(
name="Nextflow",
passed=False,
message=f"Nextflow check failed: {str(e)}"
)
def check_java() -> CheckResult:
"""Check Java version (requires >= 11)."""
if not shutil.which("java"):
return CheckResult(
name="Java",
passed=False,
message="Java not found in PATH",
fix="Install Java 11+: sudo apt install openjdk-11-jdk"
)
try:
result = subprocess.run(
["java", "-version"],
capture_output=True,
text=True,
timeout=10
)
# Java version is typically in stderr
output = result.stderr or result.stdout
import re
match = re.search(r'version "(\d+)', output)
if match:
version = int(match.group(1))
version_line = output.strip().split('\n')[0]
if version >= 11:
return CheckResult(
name="Java",
passed=True,
message=f"Java {version} installed",
details=version_line
)
else:
return CheckResult(
name="Java",
passed=False,
message=f"Java {version} is too old (requires >= 11)",
details=version_line,
fix="Install Java 11+: sudo apt install openjdk-11-jdk"
)
return CheckResult(
name="Java",
passed=True,
message="Java installed",
details=output.strip().split('\n')[0] if output else None
)
except Exception as e:
return CheckResult(
name="Java",
passed=False,
message=f"Java check failed: {str(e)}"
)
def check_resources() -> CheckResult:
"""Check system resources (CPU, memory, disk)."""
try:
# CPU cores
cpu_count = os.cpu_count() or 1
# Memory
mem_gb = 0
try:
# Linux: read from /proc/meminfo
with open('/proc/meminfo', 'r') as f:
for line in f:
if line.startswith('MemTotal:'):
mem_kb = int(line.split()[1])
mem_gb = mem_kb / (1024 * 1024)
break
except (FileNotFoundError, PermissionError):
# macOS: use sysctl
try:
result = subprocess.run(
['sysctl', '-n', 'hw.memsize'],
capture_output=True, text=True, timeout=5
)
if result.returncode == 0:
mem_gb = int(result.stdout.strip()) / (1024**3)
except Exception:
pass
# Disk space (current directory)
disk_gb = 0
try:
statvfs = os.statvfs('.')
disk_gb = (statvfs.f_frsize * statvfs.f_bavail) / (1024**3)
except Exception:
pass
details = f"CPUs: {cpu_count}, Memory: {mem_gb:.1f}GB, Disk: {disk_gb:.1f}GB available"
# Check minimums
warnings = []
if cpu_count < 4:
warnings.append(f"Low CPU count ({cpu_count}). Consider --max_cpus {cpu_count}")
if 0 < mem_gb < 8:
warnings.append(f"Low memory ({mem_gb:.1f}GB). Use --max_memory '{int(mem_gb)}GB'")
if 0 < disk_gb < 50:
warnings.append(f"Low disk space ({disk_gb:.1f}GB). Pipelines need ~100GB for human data")
if warnings:
return CheckResult(
name="Resources",
passed=True,
message="Resources available (with warnings)",
details=details,
fix="; ".join(warnings)
)
return CheckResult(
name="Resources",
passed=True,
message="Sufficient resources available",
details=details
)
except Exception as e:
return CheckResult(
name="Resources",
passed=True, # Don't fail on resource check errors
message=f"Could not fully check resources: {str(e)}"
)
def check_network() -> CheckResult:
"""Check network connectivity to Docker Hub and nf-core."""
try:
import urllib.request
# User-Agent header to avoid 403 from sites that block default Python agent
headers = {'User-Agent': 'nf-core-helper/1.0'}
# Try Docker Hub
try:
req = urllib.request.Request("https://hub.docker.com", headers=headers)
urllib.request.urlopen(req, timeout=10)
docker_hub_ok = True
except Exception:
docker_hub_ok = False
# Try nf-core (for pipeline downloads)
try:
req = urllib.request.Request("https://nf-co.re", headers=headers)
urllib.request.urlopen(req, timeout=10)
nfcore_ok = True
except Exception:
nfcore_ok = False
if docker_hub_ok and nfcore_ok:
return CheckResult(
name="Network",
passed=True,
message="Network connectivity OK (Docker Hub & nf-core reachable)"
)
elif docker_hub_ok:
return CheckResult(
name="Network",
passed=True,
message="Docker Hub reachable (nf-core.re not reachable)",
details="Pipeline downloads may still work via GitHub"
)
else:
return CheckResult(
name="Network",
passed=False,
message="Cannot reach Docker Hub",
fix="Check network connection. Containers require Docker Hub access."
)
except Exception as e:
return CheckResult(
name="Network",
passed=False,
message=f"Network check failed: {str(e)}",
fix="Check network connection and proxy settings"
)
def run_all_checks() -> EnvironmentReport:
"""Run all environment checks and return comprehensive report."""
checks = [
check_docker(),
check_nextflow(),
check_java(),
check_resources(),
check_network(),
]
# Critical checks that must pass
critical_checks = ["Docker", "Nextflow", "Java"]
ready = all(c.passed for c in checks if c.name in critical_checks)
# Build recommendations
recommendations = []
for check in checks:
if not check.passed and check.fix:
recommendations.append(f"{check.name}: {check.fix}")
elif check.passed and check.fix: # Warnings
recommendations.append(f"{check.name} (warning): {check.fix}")
return EnvironmentReport(
ready=ready,
checks=checks,
recommendations=recommendations
)
def print_report(report: EnvironmentReport):
"""Print human-readable report to stdout."""
print("\n" + "=" * 50)
print(" nf-core Environment Check")
print("=" * 50 + "\n")
for check in report.checks:
status = "\033[92m[PASS]\033[0m" if check.passed else "\033[91m[FAIL]\033[0m"
print(f"{status} {check.name}: {check.message}")
if check.details:
print(f" {check.details}")
if not check.passed and check.fix:
print(f" \033[93mFix:\033[0m {check.fix}")
elif check.passed and check.fix: # Warning
print(f" \033[93mWarning:\033[0m {check.fix}")
print()
if report.ready:
print("\033[92m✓ Environment is READY for nf-core pipelines.\033[0m")
else:
print("\033[91m✗ Environment is NOT READY. Please address the issues above.\033[0m")
if report.recommendations:
print("\n--- Recommendations ---")
for i, rec in enumerate(report.recommendations, 1):
print(f" {i}. {rec}")
print()
def main():
import argparse
parser = argparse.ArgumentParser(
description="Check environment for nf-core pipeline execution",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
python check_environment.py # Human-readable output
python check_environment.py --json # JSON output for parsing
"""
)
parser.add_argument("--json", action="store_true",
help="Output results as JSON")
args = parser.parse_args()
report = run_all_checks()
if args.json:
print(json.dumps(report.to_dict(), indent=2))
else:
print_report(report)
sys.exit(0 if report.ready else 1)
if __name__ == "__main__":
main()
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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nextflow-development.zip