feature_annotation/xenium_spatial_statistics
Description
Calculate various spatial statistics from Xenium data including cell morphology
ratios, position-based features, local density metrics, and global spatial patterns.
This component expects a MuData object with a pre-computed spatial neighborhood graph
in .obsp.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input | file required | A MuData file containing spatial transcriptomics data and a pre-computed spatial neighborhood graph in `.obsp`. |
--modality | string required | The name of the modality to use from the MuData object. This specifies which AnnData object contains the spatial data. |
--obsm_spatial_coordinates | string | The key in `.obsm` where spatial coordinates are stored. Expected shape is (n_cells, 2) for 2D coordinates. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output | file output | The output MuData file with calculated spatial statistics. Per-cell metrics are stored in `.obs` and global statistics in `.uns`. |
--output_prefix | string | Prefix to add to all generated column names in `.obs`. |
Parameters
Name | Type & Properties | Description |
|---|---|---|
--density_bandwidth | double | Bandwidth parameter for Gaussian kernel density estimation in spatial units (typically microns). Larger values create smoother density estimates. |
--calculate_ripley_l | boolean | Whether to calculate Ripley's L statistic. Warning: This is an O(N^2) operation and can be very slow for large datasets (>5000 cells). |
--n_subsample_ripley | integer | Number of cells to subsample for Ripley's L calculation. If -1, use all cells. Recommended to keep this below 5000 for performance. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
obsm_spatial_coordinates: [ "spatial" ]
output: "$id.$key.output"
output_prefix: [ "spatial_" ]
density_bandwidth: [ 50 ]
calculate_ripley_l: [ false ]
n_subsample_ripley: [ -1 ]
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/feature_annotation/xenium_spatial_statistics/main.nf \
-params-file params.yaml Relationships
Used by
0 relationships
No components use this component.
Current component
feature_annotation/xenium_spatial_statisticsopenpipeline_spatial v0.7.0
Uses
0 relationships
No component dependencies found.