Skip to content

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

@PedroMilanezAlmeida

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedtriageNew issues yet to be checked by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions