Command line#
Installing rctd-py adds an rctd command with three subcommands:
rctd info # versions, GPU availability (--json for machines)
rctd validate spatial.h5ad reference.h5ad # fast input checks, no GPU needed
rctd run spatial.h5ad reference.h5ad # deconvolve (default: doublet mode)
rctd run spatial.h5ad reference.h5ad \
--mode doublet --output results.h5ad --device cuda \
--batch-size 5000 --umi-min 20 --cell-type-col cell_type
rctd run spatial.h5ad reference.h5ad --json --quiet # JSON summary for pipelines
Both positional arguments accept a .h5ad file, an AnnData Zarr store or a SpatialData Zarr
store. In a spatial SpatialData store with several tables, name one with --table (or point at
store.zarr/tables/<name>); --table applies to the spatial input only, so a multi-table
reference store takes the store.zarr/tables/<name> path. Results are always written as .h5ad; the input is never modified.
Output#
Results are written into a copy of the spatial input, by default <spatial_stem>_rctd.h5ad.
Slot |
Content |
Modes |
|---|---|---|
|
cell type weights (N x K) |
all |
|
highest weight in |
all |
|
singlet / doublet_certain / doublet_uncertain / reject |
doublet |
|
primary and secondary type |
doublet |
|
type only certain at class level ( |
doublet |
|
class of each type |
doublet with |
|
doublet weights (N x 2) |
doublet |
|
convergence flag |
full |
|
number of types per pixel |
multi |
|
selected types and their weights |
multi |
|
run metadata |
all |
Pixels that were not fitted get NaN weights and "filtered" labels: total UMI outside
--umi-min / --umi-max, or fewer than counts_MIN (10) counts on the bulk gene list.
Reference#
rctd#
rctd-py: GPU-accelerated cell type deconvolution for spatial transcriptomics.
.. program:: rctd .. rubric:: Usage
.. code-block:: shell
rctd [OPTIONS] COMMAND [ARGS]...
.. rubric:: Options
.. option:: –version
Show the version and exit.
info#
Show version, device, and environment information.
.. program:: rctd info .. rubric:: Usage
.. code-block:: shell
rctd info [OPTIONS]
.. rubric:: Options
.. option:: –json
Output as JSON.
run#
Run RCTD deconvolution on spatial transcriptomics data.
.. program:: rctd run .. rubric:: Usage
.. code-block:: shell
rctd run [OPTIONS] SPATIAL REFERENCE
.. rubric:: Options
.. option:: –table