Infers lactate signaling in spatial transcriptomics data with distance-weighted communication scores. Supports both direct (HCAR1) and indirect (proton-sensing GPCRs) pathways with spatial context.
inferSpatialLactateSignaling(
object,
max_distance = 200,
distance_decay = "gaussian",
sigma = 50,
include_direct = TRUE,
include_indirect = TRUE,
method = "combined",
comm_method = "geometric",
aggregate_by = "cell_type",
min_production = 0,
min_sensing = 0,
normalize = TRUE,
verbose = TRUE
)A spatial scMetaLink object (created with createScMetaLinkFromSpatial)
Numeric. Maximum communication distance in micrometers. Spot pairs beyond this distance are considered non-interacting. Default 200 um.
Character. Distance decay function:
"gaussian": Gaussian decay exp(-d^2/(2*sigma^2)) (default)
"exponential": Exponential decay exp(-d/sigma)
"linear": Linear decay max(0, 1 - d/max_distance)
"none": No distance weighting, use cell type level aggregation
Numeric. Decay parameter for gaussian/exponential (in um). Default 50 um. Literature suggests lactate has medium-range diffusion (~50-80 um).
Logical. Include direct lactate-HCAR1 signaling. Default TRUE.
Logical. Include indirect lactate-H+-GPCR signaling. Default TRUE.
Character. Scoring method: "combined", "mean", or "proportion". Default "combined".
Character. Communication score method: "geometric", "product", "harmonic". Default "geometric".
Character. Aggregation level:
"cell_type": Aggregate by cell type (default)
"spot": Return spot-level scores (memory intensive)
"both": Return both levels
Numeric. Minimum production score threshold. Default 0.
Numeric. Minimum sensing score threshold. Default 0.
Logical. Normalize scores. Default TRUE.
Logical. Print progress messages. Default TRUE.
Updated scMetaLink object with spatial_lactate_signaling results stored in the parameters slot, containing:
Spot-level production scores
Spot-level direct sensing scores
Spot-level indirect sensing scores
Cell type level communication (if aggregate_by includes "cell_type")
Spot level communication (if aggregate_by includes "spot")
Analysis parameters
# \donttest{
data(st_expr)
data(st_meta)
data(st_scalefactors)
# Create spatial object
obj <- createScMetaLinkFromSpatial(
expression_data = st_expr,
spatial_coords = st_meta[, c("x", "y")],
cell_meta = st_meta,
cell_type_column = "cell_type",
scale_factors = st_scalefactors
)
#> Created spatial scMetaLink object with 4284 genes, 1000 spots, 6 cell types
# Run spatial lactate analysis
obj <- inferSpatialLactateSignaling(obj)
#> Inferring spatial lactate signaling...
#> Spots: 1000
#> Cell types: 6
#> Distance decay: gaussian (sigma=50 um, max=200 um)
#> Available lactate genes: 17/17
#> Calculating spot-level expression scores...
#> Calculating spot-level production scores...
#> Calculating spot-level direct sensing scores...
#> Calculating spot-level indirect sensing scores...
#> Computing spatial distance weights...
#> Aggregating by cell type...
#> Done!
#> Spot production scores: 1000 spots
#> Cell type communication: 6 x 6
# Access results
spatial_results <- obj@parameters$spatial_lactate_signaling
# }