Skip to main content

pandasaurus_cxg

STATUS: early Beta

A library for retrieving and leveraging the semantic context of ontology annotation in CxG standard AnnData files.

Slide summarising intended functionality image

Installation

Available on PyPi

$ pip3 install pandasaurus_cxg

Detailed installation guide for pygraphviz issue

During package installation, sometimes the pygraphviz package installation is failing on macOS due to Graphviz may be installed in a location that is not on the default search path. In this case, it may be necessary to manually specify the path to the graphviz include and/or library directories. To do that use following instructions and install pygraphviz manually.

brew install graphviz
export CFLAGS="-I$(brew --prefix graphviz)/include"
export LDFLAGS="-L$(brew --prefix graphviz)/lib"
pip install pygraphviz

Usage

The AnndataEnricher and AnndataAnalyzer classes can be used both individually and in conjunction with the AnndataEnrichmentAnalyzer wrapper class. The AnndataEnrichmentAnalyzer class serves as a convenient way to leverage the functionalities of both AnndataEnricher and AnndataAnalyzer.

Using AnndataEnricher and AnndataAnalyzer Individually

You can use the AnndataEnricher and AnndataAnalyzer classes separately to perform specific tasks on your data. For instance, AnndataEnricher facilitates data enrichment, while AnndataAnalyzer provides various analysis tools for Anndata objects.

from pandasaurus_cxg.anndata_enricher import AnndataEnricher
ade = AnndataEnricher.from_file_path("test/data/modified_human_kidney.h5ad")
ade.simple_enrichment()
ade.minimal_slim_enrichment(["blood_and_immune_upper_slim"])
from pandasaurus_cxg.anndata_analyzer import AnndataAnalyzer
ada = AnndataAnalyzer.from_file_path("./immune_example.h5ad", author_cell_type_list = ['subclass.full', 'subclass.l3', 'subclass.l2', 'subclass.l1', 'class', 'author_cell_type'])
ada.co_annotation_report()

Using AnndataEnrichmentAnalyzer Wrapper

The AnndataEnrichmentAnalyzer class wraps the functionality of both AnndataEnricher and AnndataAnalyzer, offering a seamless way to perform enrichment and analysis in one go.

from pandasaurus_cxg.enrichment_analysis import AnndataEnrichmentAnalyzer
from pandasaurus_cxg.graph_generator.graph_generator import GraphGenerator
aea = AnndataEnrichmentAnalyzer("test/data/modified_human_kidney.h5ad")
aea.contextual_slim_enrichment()
aea.co_annotation_report()
gg = GraphGenerator(aea)
gg.generate_rdf_graph()
gg.set_label_adding_priority(["class", "cell_type", "subclass.l1", "subclass.l1", "subclass.full", "subclass.l2", "subclass.l3"])
gg.add_label_to_terms()
gg.enrich_rdf_graph()
gg.save_rdf_graph(file_name="kidney_new", _format="ttl")

More examples and detailed explanation can be found in jupyter notebook given in Snippets

Snippets

https://github.com/INCATools/pandasaurus_cxg/blob/main/walkthrough.ipynb

Library Documentation

https://incatools.github.io/pandasaurus_cxg/

Roadmap

https://github.com/INCATools/pandasaurus_cxg/blob/main/ROADMAP.md

Metadata

Release files for pandasaurus-cxg 0.2.9

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

Source distribution (sdist)

Source distribution for pandasaurus-cxg 0.2.9
File Size Uploaded Provenance Actions
pandasaurus_cxg-0.2.9.tar.gz 24.7 kB Without provenance Details for pandasaurus_cxg-0.2.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pandasaurus-cxg 0.2.9
File Interpreter ABI Platform Actions
pandasaurus_cxg-0.2.9-py3-none-any.whl Python 3 none any Details for pandasaurus_cxg-0.2.9-py3-none-any.whl

Total release size: 55.1 kB

Release files / pandasaurus_cxg-0.2.9.tar.gz

Download URL pandasaurus_cxg-0.2.9.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ecba99b06fbfeee1bceed3d791a57832211470ecc05f90837610b922873ed7ea
BLAKE2b-256 checksum
How to use checksums
14c536df9f3a1567f694c0c5d69125cd1cdfbd7ff412f6d3f28f8a3026145f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pandasaurus_cxg-0.2.9-py3-none-any.whl

Download URL pandasaurus_cxg-0.2.9-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f87e7c5b4a4215eb3303297a1e19368fc8e577bad9b78d7fb24aa12efcb9c2b3
BLAKE2b-256 checksum
How to use checksums
118acaa03bc1d7f216a8fb8e9d51e678d34215e4fddf4f7208087237f16da2e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pandasaurus-cxg 0.2.9

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.

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