Skip to main content

Generated Genetic Expression Evaluator (GGE): Comprehensive evaluation of generated gene expression data. Computes metrics between real and generated datasets with support for condition matching, train/test splits, and publication-quality visualizations.

Project description

GGE: Generated Genetic Expression Evaluator

PyPI version Python 3.8+ License: MIT Tests

Comprehensive evaluation of generated gene expression data against real datasets.

GGE is a modular, object-oriented Python framework for computing metrics between real and generated gene expression datasets stored in AnnData (h5ad) format. It supports condition-based matching, train/test splits, and generates publication-quality visualizations.

Features

Metrics

All metrics are computed per-gene (returning a vector) and aggregated:

Metric Description Direction
Pearson Correlation Linear correlation between expression profiles Higher is better
Spearman Correlation Rank correlation (robust to outliers) Higher is better
Wasserstein-1 Earth Mover's Distance (L1) Lower is better
Wasserstein-2 Quadratic optimal transport Lower is better
MMD Maximum Mean Discrepancy (kernel-based) Lower is better
Energy Distance Statistical potential energy Lower is better

Visualizations

  • Boxplots & Violin plots: Metric distributions across conditions
  • Radar plots: Multi-metric comparison
  • Scatter plots: Real vs generated expression
  • Embedding plots: PCA/UMAP of real vs generated data
  • Heatmaps: Per-gene metric values

Key Features

  • ✅ Condition-based matching (perturbation, cell type, etc.)
  • ✅ Train/test split support
  • ✅ Per-gene and aggregate metrics
  • ✅ Modular, extensible architecture
  • ✅ Command-line interface
  • ✅ Publication-quality visualizations

Installation

Using pip

pip install gge-eval

Development installation

pip install -e .

With GPU support (faster distance metrics)

pip install "gge-eval[gpu]"

Quick Start

Python API

from gge import evaluate

# Run evaluation
results = evaluate(
    real_path="real_data.h5ad",
    generated_path="generated_data.h5ad",
    condition_columns=["perturbation", "cell_type"],
    split_column="split",  # Optional: for train/test
    output_dir="evaluation_output/"
)

# Access results
print(results.summary())

# Get metric for specific split
test_results = results.get_split("test")
for condition, cond_result in test_results.conditions.items():
    print(f"{condition}: Pearson={cond_result.get_metric_value('pearson'):.3f}")

Command Line

# Basic usage
gge --real real.h5ad --generated generated.h5ad \
    --conditions perturbation cell_type \
    --output results/

# With split column
gge --real real.h5ad --generated generated.h5ad \
    --conditions perturbation \
    --split-column split \
    --splits test \
    --output results/

# Specify metrics
gge --real real.h5ad --generated generated.h5ad \
    --conditions perturbation \
    --metrics pearson spearman wasserstein_1 mmd \
    --output results/

Expected Data Format

GGE expects AnnData (h5ad) files with:

Required

  • adata.X: Gene expression matrix (samples × genes)
  • adata.var_names: Gene identifiers (must overlap between datasets)
  • adata.obs[condition_columns]: Columns for matching conditions

Optional

  • adata.obs[split_column]: Train/test split indicator

Output Structure

output/
├── summary.json          # Aggregate metrics and metadata
├── results.csv           # Per-condition metrics table
├── per_gene_*.csv        # Per-gene metric values
└── plots/
    ├── boxplot_metrics.png
    ├── violin_metrics.png
    ├── radar_split.png
    ├── scatter_grid.png
    └── embedding_pca.png

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

gge_eval-0.1.1.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

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

gge_eval-0.1.1-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file gge_eval-0.1.1.tar.gz.

File metadata

  • Download URL: gge_eval-0.1.1.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.12.10 Darwin/25.3.0

File hashes

Hashes for gge_eval-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6ba7e733449523dec076327ee09080144b265ec83c24abbcefd85f04063d03d6
MD5 b06fad71a9d5844396b3c8d5112ea181
BLAKE2b-256 8cb0f53202fe9a8698a88cc373a024c14cfc992682a69798f9d99e073f9c7023

See more details on using hashes here.

File details

Details for the file gge_eval-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gge_eval-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 53.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.12.10 Darwin/25.3.0

File hashes

Hashes for gge_eval-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51b3a8721e471c99055670c18dbad0bc87b62324146d2625f0f59f4fc6fd6d74
MD5 8bca017af84d12b95c07de9be2f6e26b
BLAKE2b-256 6679127b62efbcd68b5de30742e4c68994302380bf43cb4d15e51c73a00de0aa

See more details on using hashes here.

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