agentleFS
Scientific-ToolingScientific-Tooling/structured-intelligence/skills/download-geo/SKILL.md

download-geo

Skill4 starsChanged 12 days agoMITView on GitHub

Download supplementary data files, series matrices, and raw FASTQ links from NCBI GEO for a given GSE series or GSM sample accession.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write the SRR list to $OUTDIR/$ACC/sra_accessions.txt and instruct the user to run download-sra with this file.

    line 74
  2. Distinctive:

    no supplementary files present (some series only have series matrix and SRA links)

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Download GEO

Use When

  • A user wants to download supplementary files (count matrices, CEL files, processed tables) for a GEO series (GSE) or sample (GSM).
  • A user wants to download the series matrix file(s) for a GSE, which contain sample metadata and normalized expression values.
  • A user wants to discover and fetch raw FASTQ files linked to a GEO series (which are stored in SRA and require download-sra).
  • A user wants to bulk-download all supplementary files for a set of GSE accessions.
  • A user wants to organize downloaded GEO files by sample or by file type.

Inputs

  • Required:
    • one or more GEO accessions: GSE (series) or GSM (sample)
  • Optional:
    • --type — what to download: supplementary (default), matrix, both, or sra-list
    • --outdir DIR — output directory (default: geo_downloads)
    • --filter PATTERN — glob pattern to select supplementary files (e.g., "*_counts.txt.gz", "*.CEL.gz")
    • --no-decompress — keep files compressed (default: leave as-is, do not auto-decompress)
    • --soft — also download the full SOFT metadata file for the series
    • --dry-run — list files that would be downloaded without fetching them

Workflow

  1. Resolve the GEO FTP base path for the accession:
    • For GSEnnnnn where nnn is the numeric part:
      ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSEnnn/GSEnnnnn/
    • For GSEnnnnnnn (7-digit, prefix = GSEnnnnnn):
      ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSEnnnnnnn/GSEnnnnnnn/
    • Helper: PREFIX="${ACC%???}nnn" — replace last 3 digits with nnn.
  2. List available files:
    curl -s "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/" 2>/dev/null
    # Or via NCBI GEO query API:
    curl -s "https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=$ACC&targ=self&form=text&view=brief"
  3. Download supplementary files (if --type supplementary or both):
    wget -r -nH --cut-dirs=5 -np -nd \
      -P "$OUTDIR/$ACC/supplementary/" \
      "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/suppl/"
    Apply --filter pattern if provided.
  4. Download series matrix (if --type matrix or both):
    wget -r -nH --cut-dirs=5 -np -nd \
      -P "$OUTDIR/$ACC/matrix/" \
      "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/matrix/"
  5. Download SOFT file (if --soft):
    wget -P "$OUTDIR/$ACC/soft/" \
      "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/soft/"
  6. Extract SRA run accessions for raw FASTQ (if --type sra-list):
    esearch -db gds -query "$ACC[Accession]" | elink -target sra | \
      efetch -format runinfo | awk -F',' 'NR>1 && $1!="" {print $1}'
    Write the SRR list to $OUTDIR/$ACC/sra_accessions.txt and instruct the user to run download-sra with this file.
  7. Report: files downloaded, total size, destination paths. For sra-list mode, display the SRR list and the recommended download-sra command.

Output Contract

  • Supplementary files under <outdir>/<GSE>/supplementary/
  • Series matrix files under <outdir>/<GSE>/matrix/ (plain text, gzip-compressed)
  • SOFT file under <outdir>/<GSE>/soft/ (when --soft requested)
  • sra_accessions.txt under <outdir>/<GSE>/ (when --type sra-list requested, one SRR per line)
  • download_manifest.tsv listing: accession, file, size_bytes, url, local_path
  • Recommended download-sra command when raw FASTQ is needed

Limits

  • GEO FTP is accessible without authentication; no credentials are needed for public data.
  • Supplementary files are whatever the submitter uploaded; format and content vary widely (CSV, TSV, CEL, H5AD, RDS, etc.).
  • Series matrix files contain processed/normalized data, not raw counts. Raw counts, if available, are usually in supplementary files or in SRA.
  • Raw sequencing data (FASTQ) is stored in SRA, not on the GEO FTP. Use download-sra with the sra_accessions.txt output of this skill to download raw reads.
  • Some large GSE series have hundreds of supplementary files totalling many GB; always dry-run first to inspect file sizes.
  • GEO does not provide MD5 checksums for supplementary files; integrity verification is not possible for supplementary downloads.
  • Common failure cases:
    • FTP path resolution failure because the GSE numeric prefix is computed incorrectly; double-check the nnn suffix calculation
    • no supplementary files present (some series only have series matrix and SRA links)
    • wget following symlinks into unintended directories; use --no-parent flag
    • series matrix is split across multiple files (one per platform); all will be downloaded automatically

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.