Skip to main content

Access Bioconductors experimenthub resources

Project description

PyPI-Server Unit tests

experimenthub

ExperimentHub provides an interface to access and manage data from the Bioconductor ExperimentHub service directly in Python.

It is designed to work within the BiocPy ecosystem, converting R data objects (like SingleCellExperiment or SummarizedExperiment) into their Python equivalents (e.g., SummarizedExperiment) using rds2py.

[!NOTE]

This is an experimental package. It may not work with all RDS files from ExperimentHub. Currently, this package filters ExperimentHub resources to provide access to:

  • File Formats: .rds
  • R Classes: SingleCellExperiment, SummarizedExperiment, RangedSummarizedExperiment, GRanges etc

Files are converted to their respective BiocPy representations or common Python formats.

Install

To get started, install the package from PyPI

pip install experimenthub

Usage

Initialize the Registry

The registry manages the local cache of ExperimentHub metadata and resources. On the first run, it downloads the metadata database.

from experimenthub import ExperimentHubRegistry

# Initialize the registry (downloads metadata if needed)
eh = ExperimentHubRegistry()

Searching for Resources

ExperimentHub contains thousands of datasets. Use the search() method to find resources by title, description, or species.

# Search for mouse-related datasets
results = eh.search("mus musculus")

# Print the first few matches
for record in results[:5]:
    print(f"{record.ehub_id}: {record.title}")
# Output:
# EH1041: Brain scRNA-seq data, sample ...,
# EH1042: Brain scRNA-seq data, gene ...,
# ...

Inspecting Metadata

You can retrieve detailed metadata for a specific ID.

record = eh.get_record("EH4663")

print(f"Title: {record.title}")
print(f"Species: {record.species}")
print(f"Genome: {record.genome}")
print(f"Description: {record.description}")
print(f"R Class: {record.preparer_dataclass}")

## Output:
# Title: Lohoff biorXiv spatial coordinates (sample 2)
# Species: Mus musculus
# Genome: mm10
# Description: Cell spatial coordinates for sample 2 for the E8.5 seqFISH dataset from biorXiv
# R Class: character

Loading Data

The load() method handles the download, caching, and loading of the dataset.

If the resource is an R data file (.rds) containing a supported Bioconductor object (e.g., SingleCellExperiment), it is automatically read and converted to an equivalent python object using rds2py.

# Load a data.frame as an BiocFrame object
data = eh.load("EH4663")

print(data)
# BiocFrame with 8425 rows and 3 columns
#                                           x                   y             z
#                                 <FloatList>         <FloatList> <IntegerList>
#  embryo1_Pos0_cell10_z5  0.7084368794499625 -2.7071263060540645             5
# embryo1_Pos0_cell100_z5  0.9763043488304248  -2.517971233335359             5
# embryo1_Pos0_cell101_z5  0.9749347757408557 -2.6739635081030855             5
#                                         ...                 ...           ...
# embryo1_Pos28_cell97_z5 -1.3992279805347039  3.1761928631722824             5
# embryo1_Pos28_cell98_z5  -1.389353519722718  3.1349508225406666             5
# embryo1_Pos28_cell99_z5  -1.394992277928857  2.5812717935734355             5

Note

This project has been set up using BiocSetup and PyScaffold.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

experimenthub-0.0.1.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

experimenthub-0.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file experimenthub-0.0.1.tar.gz.

File metadata

  • Download URL: experimenthub-0.0.1.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for experimenthub-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bca75705a6b80c7c868674d1d550f705e22e9e7f6e0f8b0c606f33d9f38da139
MD5 a3d5133f348a956abee949d2cc5ea1bb
BLAKE2b-256 2226a2491647951f3263c37e6c8181b51cd5448cac4de1b2b9f8538989364ebd

See more details on using hashes here.

Provenance

The following attestation bundles were made for experimenthub-0.0.1.tar.gz:

Publisher: publish-pypi.yml on BiocPy/experimenthub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file experimenthub-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: experimenthub-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for experimenthub-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 266eb548e9b84226bdcd2a7e9b229be8f62b024081a25555d966189fd66aa9a1
MD5 997d98a90af2b35d545133cae8e47a49
BLAKE2b-256 9d16cba6ffcc70d4786618e50396d36035fe35bba0490bda07679962b06315ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for experimenthub-0.0.1-py3-none-any.whl:

Publisher: publish-pypi.yml on BiocPy/experimenthub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page