Skip to main content

A tool for evalauting single-cell embeddings using graph-based relations

Project description

scgraph-eval

A tool for evaluating single-cell embeddings using graph-based relationships. This package helps analyze the consistency of cell type relationships across different batches in single-cell data.

Features

  • Calculate trimmed means for cell type centroids
  • Compute pairwise distances between cell types
  • Process multiple batches to assess embedding consistency
  • Support for both PCA and custom embeddings
  • Built-in handling for highly variable genes (HVG)

Installation

You can install the package via pip:

pip install scgraph-eval

Usage

Python API

from scgraph import scGraph

# Initialize the graph analyzer
graph = scGraph(
    adata_path="path/to/your/data.h5ad",   # Path to AnnData object
    batch_key="batch",                     # Column name for batch information
    label_key="cell_type",                 # Column name for cell type labels
    trim_rate=0.05,                        # Trim rate for robust mean calculation
    thres_batch=100,                       # Minimum number of cells per batch
    thres_celltype=10                      # Minimum number of cells per cell type
)

# Run the analysis
results = graph.main()

# Save results
results.to_csv("embedding_evaluation_results.csv")

Command Line Interface

scgraph-eval --adata_path path/to/data.h5ad \
             --batch_key batch \
             --label_key cell_type \
             --trim_rate 0.05 \
             --thres_batch 100 \
             --thres_celltype 10 \
             --savename results

Output

The package outputs comparison metrics between different embeddings:

  • Rank-PCA: Spearman correlation with PCA-based relationships
  • Corr-PCA: Pearson correlation with PCA-based relationships
  • Corr-Weighted: Weighted correlation considering distance-based importance

Requirements

  • numpy
  • pandas
  • scanpy
  • tqdm
  • scipy

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

Citation

If you use this package in your research, please cite: [Citation information to be added]

Contact

For questions and feedback:

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

scgraph_eval-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

scgraph_eval-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scgraph_eval-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.20

File hashes

Hashes for scgraph_eval-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fdf54bafe183ed0cfbbfa25fcb83a93729a50da96b7c0ed42ead6725023dbd65
MD5 65b21da0503f95da85f72720cc962684
BLAKE2b-256 72d545b14fc9f338f95bac12f7f8c2539d3796885b26258455d1590497d97fa6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scgraph_eval-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.20

File hashes

Hashes for scgraph_eval-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 337316a99b5751972d14db419032d4e95f47fe12804a3c98d2d8717b740ad5cb
MD5 dd962c1b7da297cccf4e6b9754ba872a
BLAKE2b-256 3e9f5add8005b7fce34899fc15271a4ddc4530985fe91b4b4286ffda9e883604

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