Skip to content

Why a file format

An AnnData lives in memory, so peak memory scales with the number of cells. A cytome file lives on disk, and PIASO reads it in chunks — peak memory is set by the batch size instead.

The calls are nearly identical:

import cytome, piaso
cytome.from_10x_h5("filtered_feature_bc_matrix.h5", "sample.cytome")
ds = cytome.open("sample.cytome")
piaso.pp.calculateCellMetrics(ds, modality="RNA")
piaso.tl.infog(ds, modality="RNA", n_top_genes=3000, save_layer=True)
piaso.tl.runSVD(ds, modality="RNA", layer="infog", n_components=50, key_added="X_svd")

Results are written back onto the file, so reopening gives them all back with no recomputation and no export step.

AnnDatacytome
Matrix locationmemorydisk, read in chunks
Peak memoryscales with cellsset by batch size
Good forup to ~10⁵ cells10⁶+ cells, repeated analyses
Resultsin the objectpersisted on the file

For a 10k-cell dataset either is fine and AnnData is simpler. The cytome path is what lets the same code run when the dataset is a hundred times larger.