Skip to main content

Ontology enrichment tool for CxG standard AnnData files.

Project description

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

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

pandasaurus_cxg-0.2.1.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

pandasaurus_cxg-0.2.1-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file pandasaurus_cxg-0.2.1.tar.gz.

File metadata

  • Download URL: pandasaurus_cxg-0.2.1.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pandasaurus_cxg-0.2.1.tar.gz
Algorithm Hash digest
SHA256 064795a468037a9ea1aa7b31e2b50d37745aa6fe5f3d8c751469d929153a21d5
MD5 c75c42c1ff686870b6a5ceec45413167
BLAKE2b-256 19a9774f813fbe407a208c0a822c4e3ad9cd9ef9f025be5021b110f216d7abab

See more details on using hashes here.

File details

Details for the file pandasaurus_cxg-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pandasaurus_cxg-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e53fc49d69415dd6b52b5bc3fb5b2961b02cbfc9e98b50e561e0db163240df96
MD5 ece777ffb0f4ef037348ade2b3e4d138
BLAKE2b-256 8392dc638530dd7e388807caf77e87dc9d4104e949eb3ca39aa6c5f596244b06

See more details on using hashes here.

Supported by

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