You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 13f12a0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ A command-line tool for exploring huge AnnData stores (`.h5ad` and `.zarr`) with
8
8
- Auto-detects `.h5ad` files vs `.zarr` directories
9
9
- Chunked processing for dense and sparse matrices (CSR/CSC)
10
10
- Reads every AnnData on-disk layout, from 0.7.x through the current spec, and always writes the current one
11
-
- Converts between HDF5 and Zarr (v2 and v3) in either direction with `adata convert`, and to and from 10x Genomics HDF5 matrices and 10x / STARsolo MTX folders
11
+
- Converts between HDF5 and Zarr (v2 and v3) in either direction with `adata convert`, and to and from 10x Genomics HDF5 matrices and 10x / STARsolo MTX folders, and from CellBender output
12
12
- Rich terminal output with progress indicators, kept on stderr so results pipe cleanly
@@ -56,7 +56,7 @@ Run help at any level (e.g. `adata --help`, `adata export --help`).
56
56
-`subset` – stream and write a filtered copy, selected by obs/var name lists (`--obs`/`--var`) or by expression (`--obs-query`/`--var-query`).
57
57
-`split` – write one store per distinct value of an annotation column, with a CSV manifest.
58
58
-`concat` – concatenate stores along the obs axis, with `--join inner|outer` and merge strategies for var and uns.
59
-
-`convert` – change a store's format: h5ad ↔ Zarr v2/v3, 10x Genomics HDF5 (Cell Ranger's `*_feature_bc_matrix.h5`) and 10x / STARsolo MTX folders in and out, streaming, with the output written beside its destination and moved into place only once complete.
59
+
-`convert` – change a store's format: h5ad ↔ Zarr v2/v3, 10x Genomics HDF5 (Cell Ranger's `*_feature_bc_matrix.h5`) and 10x / STARsolo MTX folders in and out, CellBender output in, streaming, with the output written beside its destination and moved into place only once complete.
60
60
-`recast` – change a matrix's dtype, layout (CSR/CSC/dense) or density, streaming; refuses a lossy cast or a large size increase unless forced. Called `convert` until 0.7.0.
61
61
-`export` – extract data from a store; subcommands: `dataframe` (any dataframe group to CSV), `array` (dense to `.npy`), `sparse` (CSR/CSC to `.mtx`), `dict` (JSON), `image` (PNG). Results go to stdout when no `--output` is given.
62
62
-`import` – write new data into a store at any path; subcommands: `dataframe` (CSV), `array` (`.npy`), `sparse` (`.mtx`), `dict` (JSON), `image` (PNG/JPEG/TIFF).
Formats other than h5ad and Zarr convert to and from AnnData only: to turn a
@@ -196,6 +197,42 @@ is refused, and `--force` writes the names as ids and `Gene Expression` as
196
197
the type. A matrix of floats is written as it is, with a warning. A file
197
198
imported by `convert` exports with its run metadata and tag fields intact.
198
199
200
+
### CellBender
201
+
202
+
The output of CellBender's `remove-background` (`output.h5` and
203
+
`output_filtered.h5`, 0.2 and later) is recognised by its latent variables,
204
+
whatever its name. Its matrix is a 10x one and is read as above; the latents
205
+
are kept, under the names CellBender's own loaders give them, so code written
206
+
against those keeps working:
207
+
208
+
| CellBender | AnnData |
209
+
|---|---|
210
+
| denoised counts |`X`|
211
+
| per-droplet latents (`cell_probability`, `cell_size`, `background_fraction`, `droplet_efficiency`; `latent_*` in 0.2) | obs columns, NaN for droplets CellBender did not analyse |
212
+
| which droplets were analysed |`obs["cellbender_analyzed"]`|
213
+
|`gene_expression_encoding` (`latent_gene_encoding` in 0.2) | obsm, same name |
|`--min-cell-probability`| Keep droplets whose `cell_probability` is at least this; CellBender's own cutoff is 0.5 |
227
+
|`--raw`| Add the raw Cell Ranger matrix CellBender ran on as `layers["cellranger"]`, and the denoised counts as `layers["cellbender"]`, as `load_anndata_from_input_and_output` does |
228
+
229
+
The full `output.h5` keeps every droplet, as `read_10x_h5` would. `--raw`
230
+
matches barcodes, so it works for `output_filtered.h5` too, whose cells
231
+
CellBender orders by count; the raw file must list the same features in the
232
+
same order, and every output barcode, or it is refused. The 10x flags above
233
+
apply as well. `--from 10x-h5` reads a CellBender file as a plain 10x matrix,
234
+
without the latents.
235
+
199
236
### 10x Genomics and STARsolo MTX folders
200
237
201
238
A folder holding `matrix.mtx`, `barcodes.tsv` and `features.tsv` (or
Copy file name to clipboardExpand all lines: docs/TESTING.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ separate jobs.
28
28
|`test_recast.py`|`recast` against scipy: casts, transposes, density changes and every refusal |
29
29
|`test_tenx.py`| 10x HDF5 import and export against Cell Ranger-shaped fixtures (v2, v3, multimodal, probe-based): mapping, filters, round trips, refusals |
30
30
|`test_mtx.py`| 10x / STARsolo MTX folders against hand-written fixtures (Cell Ranger 2 and 3, STARsolo, velocyto, GEO prefixes): mapping, entry orders, refusals that leave nothing, round trips |
31
+
|`test_cellbender.py`| CellBender 0.2 and 0.3+ output, full and filtered: each latent at its barcode, `--min-cell-probability`, `--raw` alignment, refusals |
31
32
|`test_mtx_codec.py`, `test_csr_build.py`| The streaming Matrix Market reader and writer against scipy, and the bucket sort they and `recast` share |
32
33
|`test_external_readers.py`| 10x conversions, HDF5 and MTX, checked by scanpy and PyTables in their own uv environments (`integration`) |
33
34
|`test_performance.py`| Complexity guards -- what an operation costs, not how long it takes (see below) |
@@ -245,6 +246,7 @@ should scale with, scale only that, and hold everything else fixed.
0 commit comments