Skip to main content

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.

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.4.0.tar.gz (16.2 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.4.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cap_anndata-0.4.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.14

File hashes

Hashes for cap_anndata-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ef4c517d641b5920da1fedbc62dd639b28ca8b66a3fa442139100ca897b4f8ca
MD5 b1d730adc5c3595ece6bdee30ed64202
BLAKE2b-256 97b904a2e5f4df55c262cc9bd6d17322c59ddfa753f3b27399567981a6a012fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cap_anndata-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.14

File hashes

Hashes for cap_anndata-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d19a90ee1f6fd78b85026372a40440146f65b182c617068b0658f4ba398fb7b
MD5 94dd939f56de393daefd79ec025cafde
BLAKE2b-256 3d7ee990439555a65da5a95e4244ca0bd78db65434255e61f925e8716f63d908

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