import anndata as ad
import scanpy as sc

adata = sc.datasets.pbmc3k()

adata

"""
Explanation: Simple benchmarks
Here, we perform simple benchmarks to demonstrate basic performance.
End of explanation
"""


%%time
adata.write('test.h5ad')

%%time
adata = ad.read('test.h5ad')

"""
Explanation: Reading & writing
Let us start by writing & reading anndata's native HDF5 file format: .h5ad:
End of explanation
"""


%%time
adata.write_loom('test.loom')

%%time
adata = ad.read_loom('test.loom')

"""
Explanation: We see that reading and writing is much faster than for loom files. The efficiency gain here is due to explicit storage of the sparse matrix structure.
End of explanation
"""


