Skip to main content

PyPI-Server Unit tests

pyexpressionatlas

A Python client for searching and downloading gene expression datasets from EMBL-EBI Expression Atlas, providing full compatibility with the R Bioconductor package.

[!NOTE] This package is a fork of expression-atlas to use BiocPy data structures.

Install

To get started, install the package from PyPI

pip install pyexpressionatlas

Get Started

Expression Atlas is a comprehensive resource of gene and protein expression data across species and biological conditions. This Python package provides programmatic access to:

  • Search: Query thousands of curated RNA-seq and microarray experiments
  • Download: Retrieve experiment data with automatic format handling
  • Analyze: Work with R-compatible data structures in Python

Basic Usage

from pyexpressionatlas import ExpressionAtlasClient

# Initialize client (optionally specify a custom cache directory)
client = ExpressionAtlasClient(cache_dir="~/.cache/my_custom_cache")

# Search for experiments
results = client.search_experiments(
    properties=["cancer", "breast"],
    species="homo sapiens"
)
print(results)
BiocFrame with 208 rows and 4 columns
        Accession      Species                    Type                   Title
            <list>       <list>                  <list>                  <list>
[0]  E-MTAB-8198          None                    None Functional effect of...
[1]  E-MTAB-8532          None                    None DNA microarray studi...
[2] E-GEOD-43306          None                    None Translating transcri...
            ...          ...                     ...                     ...
[205]   E-MTAB-779        None                    None OncomiRs like let-7 ...
[206]  E-TABM-1118        None                    None Transcrption profili...
[207]   E-TABM-601        None                    None Transcription profil...

Fetch Full Metadata

The initial search is optimized for speed and does not fetch full metadata. To retrieve complete details (including Species and Type), use fetch_experiment_metadata:

# Fetch full metadata for specific experiments
metadata = client.fetch_experiment_metadata(["E-MTAB-8198", "E-MTAB-8532"])
print(metadata)
BiocFrame with 2 rows and 4 columns
        Accession      Species                    Type                   Title
           <list>       <list>                  <list>                  <list>
[0]   E-MTAB-8198 Homo sapiens Cell line - High-thr... Functional effect of...
[1]   E-MTAB-8532 Homo sapiens Human - One-color mi... DNA microarray studi...

Download RNA-seq Data

# Download a single experiment
exp = client.get_experiment("E-MTAB-1625")

# Access RNA-seq data (SummarizedExperiment)
rnaseq = exp["rnaseq"]
counts = rnaseq.assay("counts")  # numpy array: genes × samples

print(f"Shape: {counts.shape[0]} genes × {counts.shape[1]} samples")
# Shape: 58735 genes × 24 samples

# Sample metadata (BiocFrame)
sample_info = rnaseq.get_column_data()
print(sample_info.get_column_names())
# ['cell line', 'compound', 'developmental stage', 'disease', 'dose', 'genotype', 'organism', 'organism part']

# Gene annotations (BiocFrame)
gene_info = rnaseq.get_row_data()
print(gene_info.shape)
# (58735, 1)

print(rnaseq)
class: SummarizedExperiment
dimensions: (58735, 24)
assays(1): ['counts']
row_data columns(1): ['Gene Name']
row_names(58735): ['ENSG00000000003', 'ENSG00000000005', 'ENSG00000000419', ..., 'ENSG00000285992', 'ENSG00000285993', 'ENSG00000285994']
column_data columns(8): ['cell line', 'compound', 'developmental stage', 'disease', 'dose', 'genotype', 'organism', 'organism part']
column_names(24): ['ERR3456453', 'ERR3456442', 'ERR3456443', ..., 'ERR3456450', 'ERR3456459', 'ERR3456444']
metadata(2): accession source

Batch Downloads

# Download multiple experiments
accessions = results.get_column("Accession")[:10]
experiments = client.get_experiments(accessions)

# Access individual experiments
for acc, exp in experiments.items():
    if exp is not None:
        print(f"{acc}: {exp['rnaseq'].shape if 'rnaseq' in exp else 'microarray'}")

Caching Mechanism

To optimize performance and reduce load on the FTP servers, all data downloads are automatically cached locally using pyBiocFileCache.

  • By default, the cache is stored at ~/.cache/expressionatlas_bfc.
  • You can customize this location when initializing the client by passing the cache_dir argument: client = ExpressionAtlasClient(cache_dir="/path/to/custom/cache").

Direct RData / rda Support

The client automatically downloads and parses both .rds and .Rdata / .rda files directly without relying on a cloud converter service:

  • Tries downloading and parsing .rds file using rds2py.read_rds.
  • If the .rds file is not available, falls back to direct download and loading of the .Rdata file using rds2py.read_rda.

Note

This project has been set up using BiocSetup and PyScaffold.

Release files for pyexpressionatlas 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyexpressionatlas 0.0.1
File Size Uploaded
pyexpressionatlas-0.0.1.tar.gz 39.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyexpressionatlas 0.0.1
File Interpreter ABI Platform
pyexpressionatlas-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 56.7 kB

Release files / pyexpressionatlas-0.0.1.tar.gz

Download URL pyexpressionatlas-0.0.1.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b0bb829d6ec576ff4c3dc12917bf98da7e40d9b3ef8ccb8145d81255cbfca66
BLAKE2b-256 checksum
How to use checksums
1c950ff5c4073dbdb0e95e11b4b784f9d77cab2d7f8b15f833569bbba33ccf14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / pyexpressionatlas-0.0.1-py3-none-any.whl

Download URL pyexpressionatlas-0.0.1-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f52ef21321b2f1fb8d9793b72043781a305c13a0c7c4b410ba1b12d78f15992
BLAKE2b-256 checksum
How to use checksums
6e62aa1d5602ed99e88f6420321c9746132bd573bf862334d6610be08b5a09fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page