Skip to content

Commit

Permalink
updated vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
parashardhapola committed Sep 13, 2022
1 parent 041590d commit 446eeb0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/vignettes/cell_subsampling_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ ds.plot_layout(
---
### 5) Exporting downsampled data

+++

TopACeDo only marks the cells the representative that for downsampling. To create a new subsampled datasets, `SubsetZarr` writer class must be used. This will create a new Zarr file containing only the subset of cells.

```{code-cell} ipython3
writer = scarf.SubsetZarr(
in_zarr='scarf_datasets/tenx_5K_pbmc_rnaseq/data.zarr',
Expand All @@ -124,6 +128,8 @@ writer = scarf.SubsetZarr(
writer.dump()
```

The downsampled dataset can be loaded as a new DataStore

```{code-cell} ipython3
ds2 = scarf.DataStore('scarf_datasets/tenx_5K_pbmc_rnaseq/subset.zarr')
```
Expand All @@ -132,6 +138,8 @@ ds2 = scarf.DataStore('scarf_datasets/tenx_5K_pbmc_rnaseq/subset.zarr')
ds2
```

It is expected the downsampled dataset will be small enough to fit in memory. Here the data is exported to anndata format from where it could easily used to perform any downstream analysis from the [scverse](https://scverse.org/) ecosystem.

```{code-cell} ipython3
adata = ds2.to_anndata()
```
Expand Down

0 comments on commit 446eeb0

Please sign in to comment.