Alterlab geo

From AlterLab-IEU/AlterLab-Academic-Skills · View interactive version

Alterlab geo is an AI agent skill from the GitHub repository AlterLab-IEU/AlterLab-Academic-Skills. Access NCBI GEO (Gene Expression Omnibus) for gene expression and functional genomics data — search and download microarray and RNA-seq datasets by GSE, GSM, GPL, or GDS accession and retrieve SOFT, MINiML, and series matrix files. Use when locating public expression datasets, fetching processed exp

How to use this skill

Skill file

GEO Database

Overview

The Gene Expression Omnibus (GEO) is NCBI's public repository for high-throughput gene expression and functional genomics data. It holds hundreds of thousands of studies (Series) and millions of samples from both array-based and sequence-based experiments. For current totals see the GEO browser at https://www.ncbi.nlm.nih.gov/geo/.

When to Use This Skill

Use this skill when searching for gene expression datasets, retrieving experimental data, downloading raw and processed files, querying expression profiles, or integrating GEO data into computational analysis workflows.

Does NOT Trigger

| Scenario | Use Instead |

|----------|-------------|

| Raw FASTQ reads by SRA/ENA run accession | alterlab-ena |

| Reference normal-tissue expression (median TPM, eQTLs) | alterlab-gtex |

| Harmonized single-cell expression across studies (CELLxGENE Census) | alterlab-cellxgene |

| Running differential expression on a count matrix you already have | alterlab-pydeseq2 |

| Tumor mutations / copy number in cancer cohorts | alterlab-cbioportal |

Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-ena) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.

Core Workflow

  1. Search for relevant studies (E-utilities / Bio.Entrez) → see references/searching.md.
  2. Retrieve a series with GEOparse: GEOparse.get_GEO(geo="GSE...", destdir="./data") → see references/geoparse_usage.md.
  3. Extract the expression matrix via gse.pivot_samples('VALUE') (genes × samples).
  4. Analyze — QC, differential expression, clustering, meta-analysis → see references/expression_analysis.md.

For bulk downloads, skip GEOparse and pull files directly over FTP → see references/data_access.md.

GEO Data Organization

GEO organizes data hierarchically using different accession types:

Largest organizational unit. Holds experimental design, samples, study info.

(e.g. GSM987654). Linked to platforms and series.

Affymetrix Human Genome U133 Plus 2.0 Array). Shared across experiments.

processed for differential analysis. Ideal for quick comparative analyses, but

the curated GDS set is legacy and no longer growing — most recent studies exist

only as GSE Series, so prefer GSE for new work.

queryable by gene name, cross-referenced to Entrez Gene.

Access Methods (routing)

metadata, extract expression matrices, supplementary files, filter samples.

→ references/geoparse_usage.md

gds, geoprofiles. Always set Entrez.email. → references/searching.md

and supplementary files; no rate limits. → references/data_access.md

https://www.ncbi.nlm.nih.gov/geo/geo2r/?acc=GSExxxxx; generates reproducible

R scripts. Useful for exploratory analysis before downloading.

Installation and Setup

No install step: run Python through uv run, which resolves the packages for that run

(this skill's tools allow uv, not a bare python):

uv run --python ">=3.11" --with GEOparse python get_series.py      # GEOparse (pulls pandas, numpy)
uv run --python ">=3.11" --with GEOparse --with biopython --with scipy --with statsmodels python analysis.py
#   add --with scikit-learn / --with matplotlib / --with seaborn as the script needs them

Configure NCBI E-utilities access. No key or account is needed: NCBI asks every

client to identify itself with a contact email, and an optional API key only raises

the rate limit from 3 to 10 requests/second:

import os
from Bio import Entrez

Entrez.email = "your.email@example.com"   # contact email NCBI asks for (no account)
Entrez.api_key = os.environ.get("NCBI_API_KEY")  # optional; None = keyless, 3 req/s

Key Concepts

metadata and data tables. Easily parsed by GEOparse.

access and data exchange.

genes/probes as rows). Fastest format for getting expression data.

submissions.

check platform and processing methods.

biological interpretation.

Common Use Cases

across studies, identify DEGs, run meta-analyses.

response biomarkers, build sensitivity models.

patient subgroup/stage comparisons, expression–outcome correlation.

cohorts, integrate with clinical data.

Rate Limiting and Best Practices

delays: time.sleep(0.34) (no key) or time.sleep(0.1) (with key).

directories).

batch metadata, FTP for direct/bulk file pulls. Cache locally; always set

Entrez.email with Biopython.

Important Notes

platform annotation and processing methods, verify metadata and design, watch

for batch effects, and consider reprocessing raw data.

CEL) can be very large. Plan disk space; download incrementally.

database (Barrett et al. 2013, Nucleic Acids Research). Check per-dataset

usage restrictions and follow NCBI guidelines.

mapping); values may be raw/normalized/log-transformed (check metadata); sample

metadata is inconsistently formatted; older submissions may lack series matrix

files; platform annotations may be outdated.

Reference Index

queries, search→summary→fetch workflow, batch metadata).

supplementary files, sample filtering, caching.

accession-to-path rule.

correlation/clustering, batch processing, cross-study meta-analysis.

endpoints, SOFT/MINiML format docs, FTP directory structure, normalization

pipelines, platform quirks, and error-handling troubleshooting.

Additional Resources

Scripts

scripts/query_geo.py — runnable helper for GEO DataSets via NCBI E-utilities (no key; NCBI_API_KEY lifts the rate limit). Has a PEP 723 inline-dependency header, so uv run installs requests automatically:

uv run scripts/query_geo.py search "breast cancer AND Homo sapiens[ORGN]" --retmax 5
uv run scripts/query_geo.py summary 200000001,200000002
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.