filter/subset_xenium
Description
Crops a raw 10x Genomics Xenium output bundle down to one dense patch of cells.
Scope. For now this component is only used to create the croppedxenium_multicellseg_tiny_cropped test data from xenium_multicellseg_tiny
(see resources_test_scripts/xenium_multicellseg_tiny.sh), which is stored
next to the uncropped bundle and used by e.g. the cellpose_sam component.
It is not a general-purpose subsetting tool: it only works on a raw outs/
bundle that already consist of separate patches of cells (datasets that are
already tiny, e.g. 10x's "tiny" examples). Cell centroids are clustered by
distance (--eps_um), one patch is picked by cell count (--patch_rank), and
its bounding box plus a margin (--margin_um) is the crop window. On a contiguous
tissue section the cells typically form a single cluster, so nothing is cropped.
Arguments
Name | Type & Properties | Description |
|---|---|---|
--input -i | file required | Input folder. Must contain the raw output from a Xenium run (the same bundle read by `convert/from_xenium_to_spatialdata`). |
--output -o | file required output | The directory where the cropped Xenium output bundle will be stored. |
--margin_um | double | Padding, in microns, around the selected patch's cell bounding box. |
--eps_um | double | Single-linkage radius, in microns, for patch clustering: cells within this distance of each other are considered part of the same patch. |
--min_cells_per_patch | integer | Minimum number of cells to form a patch. Smaller clusters and isolated cells are excluded. |
--patch_rank | integer | Which patch to keep, ranked by cell count descending (0 = largest). |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
output: "$id.$key.output.xenium_data_tiny"
margin_um: [ 10 ]
eps_um: [ 30 ]
min_cells_per_patch: [ 5 ]
patch_rank: [ 0 ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline_spatial.git \
-revision v0.7.0 \
-main-script target/nextflow/filter/subset_xenium/main.nf \
-params-file params.yaml Relationships
Used by
No components use this component.
Current component
Uses
No component dependencies found.