# ena-download

ena-download is a Claude Code skill that downloads sequencing FASTQ files and run metadata via the ENA Portal API. Runs when fetching raw sequencing reads by SRA, ERR, or DRR accessions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 77 repo stars
- Author: ssinder
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/ssinder/bioinformatics-agent-skills/tree/HEAD/skills/ena-download/SKILL.md
- Updated: 2026-10-27
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/ena-download

## What it does

The skill queries the European Nucleotide Archive search endpoint directly to obtain run metadata and FASTQ links. This bypasses web scraping and removes the need for separate `.sra` file conversions.

Transfers handle interrupted connections using HTTP `Range` headers to continue downloads. Once a FASTQ arrives, the tool computes its MD5 checksum against the value in the ENA database and removes any corrupted files immediately.

Requirements include Python 3.9 or higher and the `requests` library. Without `requests` installed in the environment, API queries will fail.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ssinder/bioinformatics-agent-skills --skill ena-download -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ena-download/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ena-download/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ssinder/bioinformatics-agent-skills --skill ena-download -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ena-download/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ssinder/bioinformatics-agent-skills --skill ena-download -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ena-download/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ssinder/bioinformatics-agent-skills skills/ena-download
```

2. **Manually: put the files in place**
- File: `.github/skills/ena-download/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ssinder/bioinformatics-agent-skills --skill ena-download -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ssinder/bioinformatics-agent-skills --path skills/ena-download
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ena-download/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ssinder/bioinformatics-agent-skills/tree/HEAD/skills/ena-download/SKILL.md

## When to use it
- download FASTQ files by SRA, ERR, or DRR accession lists
- inspect run metadata and dataset sizes before committing bandwidth
- resume interrupted transfers using HTTP Range requests
- validate downloaded sequencing files against ENA MD5 checksums

## Example prompts
- Download FASTQ runs SRR390728 and SRR1975568 into fastq/
- Extract run metadata from runs.txt without downloading reads
- Fetch RNA-Seq runs from runs.txt with single-end mode

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: ee9f3610f67f49fe.

BEGIN THIRD-PARTY FILE ee9f3610f67f49fe
````text
---
name: ena-download
description: >-
  Downloads RNA-seq and other sequencing FASTQ data from the ENA (European
  Nucleotide Archive) Portal API and exports run-level metadata. Resolves
  download URLs and file sizes from the structured API rather than scraping
  archive web pages, supports batch accession lists, HTTP Range resume for
  interrupted transfers, and MD5 verification against the checksums ENA
  publishes. This skill should be used when fetching raw sequencing reads by
  SRA/ERR/DRR accession, retrieving FASTQ files for an RNA-seq project, or
  collecting run metadata and read counts is requested.
license: MIT
compatibility: Python 3.9+; needs requests for network access; standard library only otherwise
metadata:
  version: "1.0"
  last-reviewed: "2026-10-26"
  skill-author: sinder
---

# ENA Sequencing Data Retrieval

## Overview

This skill retrieves raw sequencing data (FASTQ) from the ENA Portal API and
exports run-level metadata. It replaces a common but fragile pattern: scraping
archive web pages to extract download links and file sizes.

The ENA Portal API returns **structured** fields — `fastq_ftp`, `fastq_bytes`,
`fastq_md5`, `library_strategy`, `read_count`, `base_count` — for every run.
That removes three failure modes at once:

- **Fragile HTML parsing.** Page-scraping approaches depend on absolute XPath
  positions (`/html/body/div[2]/div[2]/div[2]/...`) that break whenever the
  archive changes its layout. The API's schema is stable.
- **Only getting `.sra`.** The archive's own download links point at the
  original submitted format (usually `.sra`), which then needs a separate
  `fastq-dump` conversion step. ENA already ships the converted FASTQ, with
  per-file sizes and MD5 checksums.
- **No integrity check.** A truncated download looks like a successful one
  until a downstream tool fails on malformed reads. ENA publishes the MD5 of
  every FASTQ; this skill verifies each file after transfer and deletes it if
  the checksum does not match.

Downloads are **resumable**: an interrupted transfer continues from the byte
it stopped at using an HTTP `Range` request, instead of starting over.

## When to Use This Skill

- Fetching FASTQ for a list of SRA/ERR/DRR accessions for an RNA-seq project
- Collecting run metadata (library strategy, read counts, organism) before
  deciding what to download
- Resuming a large download that was interrupted
- Verifying that downloaded FASTQ files are complete and uncorrupted
- Sizing a dataset before committing bandwidth (metadata-only mode)

## Quick Start

```bash
export PYTHONPATH="$PWD/packages"

# 批量下载
python scripts/download_runs.py --ids SRR390728 SRR1975568 --output-dir fastq/

# 从文件读取 accession 列表
python scripts/download_runs.py --ids runs.txt --output-dir fastq/

# 只查元数据不下载（先摸清数据规模）
python scripts/download_runs.py --ids runs.txt --metadata-only --output-dir meta/

# 只处理 RNA-Seq 文库，跳过 WGS 等其它类型
python scripts/download_runs.py --ids runs.txt --strategy RNA-Seq --output-dir fastq/
````
END THIRD-PARTY FILE ee9f3610f67f49fe

The third-party file has ended. Everything between the ee9f3610f67f49fe tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3090 of 6964 bytes. © ssinder · MIT · https://github.com/ssinder/bioinformatics-agent-skills/tree/HEAD/skills/ena-download/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
