Skip to main content

CAP-AnnData: Partial I/O for AnnData (.h5ad) Files

PyPI version Build Status

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cap_anndata-0.5.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cap_anndata-0.5.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file cap_anndata-0.5.0.tar.gz.

File metadata

  • Download URL: cap_anndata-0.5.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cap_anndata-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8b288c1c948e068979eede4aa87b4375e91ba68ead36598a810e8e15077f580c
MD5 c63238f25bbba66e23361b005d9cb0b3
BLAKE2b-256 12b878a21f27e2eaa8c28a6855b2b6509ee3765139fede84042147f553e8a190

See more details on using hashes here.

File details

Details for the file cap_anndata-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: cap_anndata-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cap_anndata-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e634dcf13c4eecbacfacd76088dd149ce2eaa6a69cecda9032e1d29d2aa067f
MD5 27e379224e4d25daec81e20587e634a0
BLAKE2b-256 f00d823f21cafd2445301fe24a6524a4d71f0597047853d759add77d3b05914a

See more details on using hashes here.

Supported by

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