neighbors/spatial_neighborhood_graph
Description
Calculates a spatial neighborhood graph based on the spatial coordinates.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input | file required | Input H5MU file |
--modality | string | Which modality from the input MuData file to process. |
--input_obsm_spatial_coords | string | Key in adata.obsm where spatial coordinates are stored |
Spatial Neighbors Calculation
Name | Type & Properties | Description |
|---|---|---|
--coord_type | string | Type of coordinate system. Valid options are: `grid` - grid coordinates. Only relevant for lattice-based layouts (e.g. Visium). Builds a graph assuming a regular grid topology, where neighbors aredefined by grid adjacency rather than distance. `generic` - Generic coordinates. Recommended for imaging-based data. This option is appropriate for irregularly spaced points, such as cell centroids or spot coordinates from imaging-based assays (e.g. Xenium, CosMx). Setting this option avoids grid-assumption artifacts and ensures each node has spatial neighbors as defined by distance. |
--n_spatial_neighbors | integer | Depending on `--coord_type`: `grid` - number of neighboring tiles. `generic` - number of neighborhoods for non-grid data. Only used when `--delaunay False`. |
--delaunay | boolean | Whether to use Delaunay triangulation to determine spatial neighborhood graph. Only used when `--coord_type generic`. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output | file required output | Output H5MU file path. |
--output_compression | string | Compression format to use for the output AnnData and/or Mudata objects. By default no compression is applied. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
input_obsm_spatial_coords: [ "spatial" ]
coord_type: [ "generic" ]
n_spatial_neighbors: [ 6 ]
delaunay: [ false ]
output: "$id.$key.output.h5mu"
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/neighbors/spatial_neighborhood_graph/main.nf \
-params-file params.yaml Relationships
Used by
1 relationships
Current component
neighbors/spatial_neighborhood_graphopenpipeline_spatial v0.6.0
Uses
0 relationships
No component dependencies found.