GEOparse is a Python library designed to access, parse, and handle data from the Gene Expression Omnibus (GEO) database. It simplifies the programmatic retrieval of GEO Series (GSE), GEO DataSets (GDS), and GEO Sample (GSM) entries, providing easy access to metadata and expression tables. The current version is 2.0.4, and releases are made on an as-needed basis, typically for bug fixes or feature enhancements.
pip install geoparseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to download and parse a GEO Series (GSE) entry, access its metadata, and iterate through its associated GEO Samples (GSMs) to view their data tables. It uses 'GSE1' for a minimal example.
Adjust your code to expect a single object from `get_GEO`. Access associated GSMs via the returned object's `.gsms` attribute (e.g., `gse.gsms`).
Consider downloading files to disk using `destdir`, processing data in chunks if possible, or filtering data early. Ensure sufficient disk space and memory before attempting to parse extremely large datasets.
Implement robust error handling (e.g., `try-except` blocks for `requests.exceptions.ConnectionError`), check your internet connection, verify the GEO accession ID on the NCBI GEO website, and consider implementing retry logic for downloads.
Update your code to match the 2.x API. Instead of `gse, gsms = GEOparse.get_GEO(...)` and then `gse.name`, simply use `gse = GEOparse.get_GEO(...)` and then `gse.name`. Access individual samples via `gse.gsms`.
Check your internet connection and proxy settings. Temporarily disable any firewalls or VPNs that might interfere. Try running the download again. If the issue persists, the GEO server might be experiencing temporary problems; try again later.
Not all metadata fields are present for every entry. Use the `.get()` method for dictionary access with a default value to prevent `KeyError`: `gsm.metadata.get('some_metadata_field_name', 'N/A')`.