https://github.com/mvinyard/archr-h5ad
Parse ArchR arrow files to anndata h5ad
https://github.com/mvinyard/archr-h5ad
io r-to-python scatac-seq single-cell
Last synced: 4 months ago
JSON representation
Parse ArchR arrow files to anndata h5ad
- Host: GitHub
- URL: https://github.com/mvinyard/archr-h5ad
- Owner: mvinyard
- License: mit
- Created: 2022-05-17T19:35:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T14:42:37.000Z (almost 2 years ago)
- Last Synced: 2025-06-01T20:52:33.856Z (4 months ago)
- Topics: io, r-to-python, scatac-seq, single-cell
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ArchR-h5ad
[](https://pypi.python.org/pypi/ArchR-h5ad/)
[](https://badge.fury.io/py/ArchR-h5ad)
[](https://github.com/psf/black)A lightweight python package to parse **[`.arrow`]()** files produced by [**ArchR**](https://www.archrproject.com) - to [**AnnData**](https://anndata.readthedocs.io/en/stable/).
## Installation
Install the last-released ([**`v0.0.12`**](https://pypi.org/project/ArchR-h5ad/0.0.12/)) distrubution from [PYPI](https://pypi.org/project/ArchR-h5ad/):
```BASH
pip install ArchR_h5ad
```Alternatively, clone the repo to install the development version, locally:
```BASH
git clone https://github.com/mvinyard/ArchR-h5ad.git; cd ArchR_h5adpip install -e .
```## A brief example
As an example, we will use the data from the ArchR [hematopoiesis tutorial](https://www.archrproject.com/articles/Articles/tutorial.html#creating-an-archrproject-1).
### Option 1. Directly read a `.arrow` file to adata
```python
import ArchR_h5adarrow_path = "/home/user/data/scATAC_CD34_BMMC_R1.arrow"
adata = ArchR_h5ad.read_arrow(arrow_path, use_matrix="GeneScoreMatrix")
```Alternatively, one may use the **`"TileMatrix"`** generated by ArchR.
```python
adata = ArchR_h5ad.read_arrow(arrow_path, use_matrix="TileMatrix")
```### Option 2. Instantiate the `Arrow` class.
```python
arrow = ArchR_h5ad.Arrow(arrow_path)
arrow.to_adata()
``````python
import numpy as npnp.array(arrow.__dir__())[
np.array([not i.startswith("__") for i in arrow.__dir__()])
].tolist()
```