🧬 PyProbeMapper
PyProbeMapper is a Python SDK and command-line tool designed to map GEO Platform (GPL) probe IDs to gene symbols for differential gene expression analysis within seconds. It leverages data from the HuggingFace Hub, processes mappings with multiple strategies (accession, coordinate, and direct lookup), and saves results locally for downstream bioinformatics pipelines.
It uses GPT-based inference to intelligently select relevant columns for mapping, saving time and handling variability across GEO platforms.
This tool is ideal for researchers and bioinformaticians working with GPL datasets who need accurate and efficient probe-to-gene mappings.
🔍 Features
- ✅ Accurate Probe-to-Gene Mapping for GEO GPL platforms within seconds
- 🤖 GPT-based column inference to automatically select relevant columns, saving time and reducing complexity across diverse GEO platforms
- ⚡ Fast retrieval of existing mappings from a HuggingFace-hosted Zarr dataset
- 🌍 Community-driven mapping: Once a platform is mapped, results are pushed to a central HuggingFace Hub repository (Tinfloz/probe-gene-map), enabling global reuse and collaboration (over 1,000 platforms already mapped!)
- 🧠 Multiple mapping strategies: accession lookup, coordinate lookup, and direct lookup
- 🖥️ Interactive CLI for ease of use
- 💾 Local storage of mappings as JSON files
- 🌐 Push to HuggingFace Hub for sharing and versioning
- 🧩 Easy integration into bioinformatics pipelines or custom scripts
- 📊 Includes a built-in human gene reference dataset (Home_sapiens.GRCh38.genes.tsv)
📦 Installation
Install py_probe_mapper from PyPI using your preferred package manager:
uv pip install py_probe_mapper
Or clone the repository and install locally:
git clone https://github.com/Tinfloz/Probe2GeneMapper
cd Probe2GeneMapper
uv pip install .
🧪 Example (Python SDK)
Use the map_probes function to map probe IDs to gene symbols for one or more GPL platforms:
from py_probe_mapper.sdk import map_probes
# Map probes for GPL570 and GPL96
results = map_probes(
gpl_ids=["GPL570", "GPL96"],
output_dir="./mappings",
force_rebuild=False
)
# Print results
for gpl_id, mappings in results.items():
if isinstance(mappings, dict):
print(f"{gpl_id}: Found {len(mappings)} mappings")
else:
print(f"{gpl_id}: {mappings}")
Output (example):
GPL570: Found 54675 mappings
GPL96: Found 22283 mappings
The mappings are saved as JSON files (e.g., GPL570_mappings.json) in the specified output_dir.
💻 Example (CLI)
Launch the interactive CLI to map probes with a user-friendly interface:
probe-mapper
The CLI will guide you through:
- Enter up to 5 GPL IDs (e.g., GPL570,GPL96)
- Specify the output directory
- Provide optional API URL and key for inference services
- Choose whether to force rebuild existing mappings
- Select a logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
Results are saved as JSON files in the specified directory.
Sample Interaction:
🌟 Welcome to the GPL Probe Mapper CLI! 🌟
🧬 Enter up to 5 GPL platform identifiers (comma-separated, e.g., GPL570,GPL96): GPL570
📂 Enter output directory (default: .): ./mappings
🔗 Enter API URL for inference service (optional, press enter to skip):
🔑 Enter API key for inference service (optional, press enter to skip):
🔄 Force rebuild mappings even if they exist? (default: No): No
📋 Select logging level: INFO
🚀 Starting probe mapping... Please wait! ⏳
🎉 Mapping completed! 🎉
📊 Results:
✅ GPL570: Found 54675 mappings 🧬
🧠 Mapping Strategies
The tool supports three mapping strategies to ensure robust probe-to-gene mappings:
- Accession Lookup: Matches probes using accession numbers.
- Coordinate Lookup: Uses genomic coordinates for precise mapping.
- Direct Lookup: Directly maps probes to gene symbols when available.
Mappings are fetched from a HuggingFace dataset (Tinfloz/probe-gene-map) or built on-demand using metadata from GEO and the included Home_sapiens.GRCh38.genes.tsv reference.
📁 Project Structure
PyProbeMapper/
├── py_probe_mapper/
│ ├── genome_utils/
│ │ └── Home_sapiens.GRCh38.genes.tsv # Human gene reference data
│ ├── coordinate_lookup/
│ │ ├── __init__.py
│ │ └── coordinate_lookup.py
│ ├── accession_lookup/
│ │ ├── __init__.py
│ │ └── accession_lookup.py
│ ├── direct_lookup/
│ │ ├── __init__.py
│ │ └── direct_lookup.py
│ ├── lookup_classifier/
│ │ ├── __init__.py
│ │ └── optimised_lookup_classifier.py
│ ├── metadata_builder/
│ │ ├── __init__.py
│ │ └── build_metadata.py
│ ├── __init__.py
│ ├── cli.py # Interactive CLI
│ └── sdk.py # Core SDK
├── pyproject.toml # Package configuration
├── README.md # This file
🛠️ Requirements
- Python 3.12+
- questionary>=2.0.0
- fsspec>=2023.1.0
- zarr>=2.14.0
- pandas>=1.5.0
- huggingface_hub>=0.17.0
Install dependencies automatically with:
pip install py_probe_mapper
📖 License
AGPL 3.0 License
This project is licensed under the AGPL 3.0 License.
See the LICENSE file for details.
📚 Usage Notes
Data Access: The included Home_sapiens.GRCh38.genes.tsv file is used for coordinate-based mapping
HuggingFace Integration: Mappings are stored in a Zarr dataset on HuggingFace (Tinfloz/probe-gene-map). Set force_rebuild=True to regenerate mappings if needed.
🚀 Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
Please include tests.
📧 Contact
For questions or support, open an issue on the GitHub repository.
Metadata
Release files for py_probe_mapper 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| py_probe_mapper-0.1.0.tar.gz | 1.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_probe_mapper-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.1 MB
Release files / py_probe_mapper-0.1.0.tar.gz
| Download URL | py_probe_mapper-0.1.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5ec916ba8440e0c24072928437dca95476a3359f62916a8f9ac82fc3bd9e64f
|
|
BLAKE2b-256 checksum How to use checksums |
bbfc8b0ba54c9672a955315dfe9f53c63eb2f77103e924753928afcef456b80a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Release files / py_probe_mapper-0.1.0-py3-none-any.whl
| Download URL | py_probe_mapper-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
285d6b68584d44c3e5274cb8b86470819eb935aa2a3c400f0a1698423a8b0948
|
|
BLAKE2b-256 checksum How to use checksums |
f5042e1bd715ec8a1e2ef16ea592473835615eedda29c0f0a4a46aa400d414d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Security for py_probe_mapper 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.