squidpy/spatial_autocorr
Description
Calculate spatial autocorrelation for genes using Moran's I or Geary's C
on a precomputed spatial neighborhood graph. Allows identification of
spatially variable features.
Requires a spatial connectivities matrix in .obsp, e.g. produced bysquidpy.gr.spatial_neighbors or an equivalent GPU implementation.
The result is written to .uns as a DataFrame: moranI when --mode is
'moran', or gearyC when --mode is 'geary'.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input -i | file required | Input h5mu file. |
--modality | string | Which modality from the input MuData file to process. |
--layer | string | Layer in the modality to use for the autocorrelation analysis. If unset, .X is used. |
--obsp_connectivities | string | In which .obsp slot the spatial connectivities can be found. |
--input_genes | string multiple | Subset of genes (from .var_names) to compute autocorrelation for. If unset, all genes in .var['highly_variable'] (if present) or all genes will be used. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output -o | file required output | Output h5mu file. |
--output_compression | string | Compression format to use for the output AnnData and/or Mudata objects. By default no compression is applied. |
Options
Name | Type & Properties | Description |
|---|---|---|
--mode | string | Spatial autocorrelation statistic to compute. 'moran' for Moran's I, 'geary' for Geary's C. |
--n_perms | integer | Number of permutations for the permutation-based p-value calculation. If unset, only analytical p-values are computed. |
--transformation | boolean | If true, row-normalize the connectivity matrix before computation. |
--two_tailed | boolean_true | If set, compute two-tailed p-values from the permutation test instead of one-tailed. |
--corr_method | string | Multiple-testing correction method to apply to p-values. Any method supported by `statsmodels.stats.multitest.multipletests`, e.g. 'fdr_bh', 'fdr_by', 'bonferroni', 'holm'. Pass an empty string to disable correction. |
--use_sparse | boolean | If true, use a sparse representation of the expression matrix on the GPU. |
GPU memory
Name | Type & Properties | Description |
|---|---|---|
--managed_memory | boolean_true | Allocate GPU memory with RMM managed memory from the start. Managed memory lets data that does not fit in VRAM spill to host RAM, at the cost of speed. By default, the component runs with regular GPU memory and only switches to managed memory, retrying once, if the GPU runs out of memory. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
obsp_connectivities: [ "spatial_connectivities" ]
output: "$id.$key.output"
mode: [ "moran" ]
transformation: [ true ]
corr_method: [ "fdr_bh" ]
use_sparse: [ true ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline_rapids.git \
-revision v0.3.0 \
-main-script target/nextflow/squidpy/spatial_autocorr/main.nf \
-params-file params.yaml Relationships
Used by
0 relationships
No components use this component.
Current component
squidpy/spatial_autocorropenpipeline_rapids v0.3.0
Uses
0 relationships
No component dependencies found.