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, orsra-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
-
Resolve the GEO FTP base path for the accession:
- For
GSEnnnnnwhere 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 withnnn.
- For
-
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" -
Download supplementary files (if
--type supplementaryorboth):wget -r -nH --cut-dirs=5 -np -nd \ -P "$OUTDIR/$ACC/supplementary/" \ "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/suppl/"Apply
--filterpattern if provided. -
Download series matrix (if
--type matrixorboth):wget -r -nH --cut-dirs=5 -np -nd \ -P "$OUTDIR/$ACC/matrix/" \ "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/matrix/" -
Download SOFT file (if
--soft):wget -P "$OUTDIR/$ACC/soft/" \ "https://ftp.ncbi.nlm.nih.gov/geo/series/$PREFIX/$ACC/soft/" -
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.txtand instruct the user to rundownload-srawith this file. -
Report: files downloaded, total size, destination paths. For
sra-listmode, display the SRR list and the recommendeddownload-sracommand.
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--softrequested) sra_accessions.txtunder<outdir>/<GSE>/(when--type sra-listrequested, one SRR per line)download_manifest.tsvlisting:accession,file,size_bytes,url,local_path- Recommended
download-sracommand 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-srawith thesra_accessions.txtoutput 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
nnnsuffix calculation - no supplementary files present (some series only have series matrix and SRA links)
- wget following symlinks into unintended directories; use
--no-parentflag - series matrix is split across multiple files (one per platform); all will be downloaded automatically
- FTP path resolution failure because the GSE numeric prefix is computed incorrectly; double-check the
Scan to join WeChat group