Skip to content

Does .view$as_HDF5AnnData(file = subset_file_path) copy all data to the memory before writing to the disk? #433

Open

Description

@PedroMilanezAlmeida

Topic Area

Reading/writing H5AD files

Your Question

I have a large h5ad file read as HDF5AnnData.

I subset and reordered it and now I have a AnnDataView.

I want to write to a new file.

Pseudocode:

# access h5ad keeping data on disk
h5ad <- 
  anndataR::read_h5ad(
    path = file_path,
    as = "HDF5AnnData")

# some subetting and reordering creating AnnDataView
h5ad <- h5ad[reord_subsetting_cells_vec,reord_subsetting_genes_vec]

h5ad <- 
  h5ad$as_HDF5AnnData(file = subset_file_path)

My question is, how memory efficient is the h5ad$as_HDF5AnnData(file = subset_file_path) operation? Does it happen in chunks? Do all data get copied to memory first and then get written to the disk?

Any help would be much appreciated.

Activity

  1. added
    question
    triage
    on Mar 6, 2026
  2. added
    h5ad
    and removed
    triage
    on Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    h5adquestion

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions