# pandasaurus_cxg
STATUS: early Beta
A library for retrieving and leveraging the semantic context of ontology annotation in [CxG standard](https://github.com/chanzuckerberg/single-cell-curation/blob/main/schema/3.0.0/schema.md) [AnnData files](https://anndata.readthedocs.io/en/latest/).
Slide summarising intended functionality

## Installation
Available on [PyPi](https://pypi.org/project/pandasaurus-cxg)
$ 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.
```python
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"])
```
```python
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.
```python
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)
## 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

程序员Chino的日记
- 粉丝: 4237
最新资源
- 年终总结汇报工作报告——IOS星空背景商务动画PPT模版图文可任意编辑替换.pptx
- 通信电路绪论通信电路课件01.ppt
- 基于PLC的全自动洗衣机控制毕业设计.pdf
- 施工单位项目管理人员到岗及履职情况.doc
- 国家开放大学电大专科《网络系统管理与维护》多项选择题题库及答案.docx
- 嵌入式系统开发与应用课程设计.docx
- 规范执业行为有序开展医疗工作西城区卫生服务网网站首.pptx
- 营业用房装修改造项目管理实施方案.doc
- 智慧城市建设规划方案(新).docx
- 基于单片机的太阳能热水器控制系统的设计说明.doc
- 基于AES加密算法的在线答疑小程序(系统)
- 项目管理师练习题200道.doc
- (2025)国家开放大学《金融基础》形考作业与答案.docx
- (2025)国家开放大学《形势与政策大作业》试题与答案.docx
- 神州数码软件有限公司简介金融.pdf
- (2025)国家育婴师职业技能考试题库(附含答案).docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


