Package 'spatialDESeq'

Title: Spatial Differential Expression via Spatial Autoregressive GLMs
Description: A robust, parallelized statistical framework optimized for identifying spatially differential expression in high-throughput spatial transcriptomics datasets. The package extends standard negative binomial generalized linear models (GLMs) by incorporating continuous physical tissue spot coordinates as distance-weighted local smoothing covariates. This configuration models spatial context seamlessly without relying on pre-annotated categorical tissue clusters. The underlying distance matrix evaluations and coordinate smoothing routines are accelerated natively via an optimized C++ Armadillo matrix engine to guarantee computational efficiency. Built to integrate natively into the Bioconductor ecosystem, the package operates directly on SpatialExperiment containers, incorporates robust library-size normalization scaling factor offsets, calculates adjusted p-values for multi-gene profiles, and supplies an interactive Shiny-based point-and-click visualization dashboard tool for downstream exploratory data analysis.
Authors: Sahal Paladan [aut, cre]
Maintainer: Sahal Paladan <[email protected]>
License: MIT + file LICENSE
Version: 0.99.2
Built: 2026-09-23 11:30:28 UTC
Source: https://github.com/BiocStaging/spatialDESeq

Help Index


Generate Mock Spatial Transcriptomics Data

Description

Generate Mock Spatial Transcriptomics Data

Usage

make_mock_spatial()

Value

A SpatialExperiment object with synthetic counts and coordinates.

Examples

se <- make_mock_spatial()

Plot Spatial Differential Expression Results

Description

Plot Spatial Differential Expression Results

Usage

plotSpatialDESeq(se, gene_id, metric = c("expression", "spatial_effect"))

Arguments

se

An analyzed SpatialExperiment object.

gene_id

Character. Gene target to visualize.

metric

Character. Choose "expression" or "spatial_effect".

Value

A ggplot2 object.

Examples

se <- make_mock_spatial()
analyzed <- spatialDESeq(se, design = ~ condition, radius = 2.5)
plotSpatialDESeq(analyzed, gene_id = "Gene1", metric = "expression")

Generate Volcano Plot for Spatial Differential Expression

Description

Generate Volcano Plot for Spatial Differential Expression

Usage

plotVolcano(se, alpha = 0.05, effect_cutoff = 0.5)

Arguments

se

An analyzed SpatialExperiment object.

alpha

Numeric. Significance value cutoff.

effect_cutoff

Numeric. Threshold for effect markings.

Value

A ggplot2 object.

Examples

se <- make_mock_spatial()
analyzed <- spatialDESeq(se, design = ~ condition, radius = 2.5)
plotVolcano(analyzed)

Compute Row-Normalized Spatial Weights

Description

Compute Row-Normalized Spatial Weights

Usage

rcpp_spatial_weights(coords, radius)

Arguments

coords

Numeric matrix of physical spots coordinates.

radius

Distance radius.

Value

Matrix of physical distance weights.

Examples

coords <- matrix(runif(20), ncol = 2)
rcpp_spatial_weights(coords, radius = 0.5)

Launch Interactive Spatial Data Explorer

Description

Launch Interactive Spatial Data Explorer

Usage

runExplorer(se)

Arguments

se

An analyzed SpatialExperiment object.

Value

Opens an interactive Shiny dashboard page in the web browser. None returned.

Examples

## Not run: 
se <- make_mock_spatial()
analyzed <- spatialDESeq(se, design = ~ condition, radius = 2.5)
runExplorer(analyzed)

## End(Not run)

Multithreaded Spatial Differential Expression Analysis

Description

Multithreaded Spatial Differential Expression Analysis

Usage

spatialDESeq(se, design, radius = 2.5, BPPARAM = BiocParallel::bpparam())

Arguments

se

A SpatialExperiment object.

design

A formula specifying experimental variables (e.g., ~ condition).

radius

Numeric. Distance radius for local spatial neighbors.

BPPARAM

A BiocParallelParam object defining core backend allocation.

Value

A SpatialExperiment object with analysis results appended to rowData.

Examples

se <- make_mock_spatial()
analyzed <- spatialDESeq(se, design = ~ condition, radius = 2.5)