1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 15 Nov 2023 08:48:20 +0100
Description: This example which should enrich the doc needs scanpy.
While the packaging for scanpy has started it is not finished yet.
Thus the example is excluded here.
FIXME: Just drop this patch once python3-scanpy might be available
--- a/src/anndata/experimental/merge.py
+++ b/src/anndata/experimental/merge.py
@@ -507,37 +507,8 @@ def concat_on_disk(
The following examples highlight the differences this function has.
First, let’s get some “big” datasets with a compatible ``var`` axis:
+ Example removed for the Debian package since scanpy packaging is not finished yet
- >>> import httpx
- >>> import scanpy as sc
- >>> base_url = "https://datasets.cellxgene.cziscience.com"
- >>> def get_cellxgene_data(id_: str):
- ... out_path = sc.settings.datasetdir / f'{id_}.h5ad'
- ... if out_path.exists():
- ... return out_path
- ... file_url = f"{base_url}/{id_}.h5ad"
- ... sc.settings.datasetdir.mkdir(parents=True, exist_ok=True)
- ... out_path.write_bytes(httpx.get(file_url).content)
- ... return out_path
- >>> path_b_cells = get_cellxgene_data('a93eab58-3d82-4b61-8a2f-d7666dcdb7c4')
- >>> path_fetal = get_cellxgene_data('d170ff04-6da0-4156-a719-f8e1bbefbf53')
-
- Now we can concatenate them on-disk:
-
- >>> import anndata as ad
- >>> ad.experimental.concat_on_disk(
- ... dict(b_cells=path_b_cells, fetal=path_fetal),
- ... 'merged.h5ad',
- ... label='dataset',
- ... )
- >>> adata = ad.read_h5ad('merged.h5ad', backed=True)
- >>> adata.X
- CSRDataset: backend hdf5, shape (490, 15585), data_dtype float32
- >>> adata.obs['dataset'].value_counts() # doctest: +SKIP
- dataset
- fetal 344
- b_cells 146
- Name: count, dtype: int64
"""
if len(in_files) == 0:
msg = "No objects to concatenate."
|