convert/from_spaceranger_hd_to_spatialdata
spaceranger
visium_hd
segmentation
spatialdata
Description
Converts the output from 10X Genomics Space Ranger for Visium HD into a
SpatialData object.
By default it reads the segmented cells (per-cell count matrix and cell
boundary polygons) that Space Ranger 4.x writes to segmented_outputs/. Set--mode bins to instead read a binned output (binned_outputs/square_<N>um/)
at the bin size given by --bin_size. In both cases the loaded table is
renamed to "table" so that downstream components stay technology-agnostic.
Arguments
Name | Type & Properties | Description |
|---|---|---|
--input -i | file required | Input folder containing the output from a Space Ranger run for Visium HD and a `*_feature_slice.h5` file. Must contain a `segmented_outputs/` directory for `--mode segmented_cells`, or `binned_outputs/` for `--mode bins`. |
--output -o | file required output | Zarr directory where the SpatialData object will be stored. |
--mode | string | Which output to load into the table: `segmented_cells` (per-cell counts and cell boundary polygons from `segmented_outputs/`) or `bins` (binned counts from `binned_outputs/square_<bin_size>um/`). |
--bin_size | integer | Bin size in microns to load when `--mode bins`. Visium HD captures data at 2 µm and aggregates it into 8 µm and 16 µm square bins. |
--output_type | string | Which count matrix to load: `filtered` (barcodes under tissue only) or `raw` (all barcodes). Applies to both the segmented-cell and binned matrices. |
--output_layer | string | If provided, the count matrix is also stored as a named layer (`table.layers[output_layer]`) in addition to `.X`. |
--dataset_id | string | Identifier used to name the spatial elements (shapes and images) in the SpatialData object. If not provided, it is inferred from the `*_feature_slice.h5` file name in the input directory. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
output: "$id.$key.output.zarr"
mode: [ "segmented_cells" ]
bin_size: [ 8 ]
output_type: [ "filtered" ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline_spatial.git \
-revision v0.6.0 \
-main-script target/nextflow/convert/from_spaceranger_hd_to_spatialdata/main.nf \
-params-file params.yaml Relationships
Used by
1 relationships
Current component
convert/from_spaceranger_hd_to_spatialdataopenpipeline_spatial v0.6.0
Uses
0 relationships
No component dependencies found.