Partial read/write of AnnData (h5ad) files for low-memory operations with large datasets.
Project description
CAP-AnnData: Partial I/O for AnnData (.h5ad) Files
Overview
CAP-AnnData offering functionalities for selective reading and writing of AnnData
file fields without the need for loading entire dataset (or even entire field) into memory.
For example, it allows to read and modify the single obs column taking nothing into memory except the column itself.
Package eager to replicate the original AnnData API as much as possible,
while providing additional features for efficient data manipulation for heavy datasets.
Installation
Install CAP-AnnData via pip:
pip install -U cap-anndata
Basic Example
The example below displayes how to read a single obs column, create new obs column and propagate it to the .h5ad file.
from cap_anndata import read_h5ad
file_path = "your_data.h5ad"
with read_h5ad(file_path=file_path, edit=True) as cap_adata:
print(cap_adata.obs_keys()) # ['a', 'b', 'c']
print(cap_adata.obs) # Empty DataFrame
cap_adata.read_obs(columns=['a'])
print(cap_adata.obs.columns) # ['a']
cap_adata.obs['new_col'] = cap_adata.obs['a']
cap_adata.overwrite(fields=['obs'])
More example can be found in the How-TO file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cap_anndata-0.5.2.tar.gz.
File metadata
- Download URL: cap_anndata-0.5.2.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dff2d52fd9255eebd3c47982d0eb40036e8ff868585a5e688532d3c7cf2b9c79
|
|
| MD5 |
5673bc03087e8c9722a0173b06e1a614
|
|
| BLAKE2b-256 |
6f41f0ca38348b2f5be0c5ceaa524a672327dafa10fa0aaaf9cc4ae56fcd851e
|
File details
Details for the file cap_anndata-0.5.2-py3-none-any.whl.
File metadata
- Download URL: cap_anndata-0.5.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5da884cc3a884c40c64dc105da44ec1969e60b6e5a2fd8b8444b229bb1180b7
|
|
| MD5 |
8cc2705ce16143a0e0eacdf13b418217
|
|
| BLAKE2b-256 |
b13f5f6f3b061fbd6b0af505fa5069f800560a1e656c6ac99aea24ea34e27627
|