STgradient.Rd
Calculates Spearman's coefficients to detect genes showing expression spatial gradients
STgradient(
x = NULL,
samples = NULL,
topgenes = 2000,
annot = NULL,
ref = NULL,
exclude = NULL,
out_rm = F,
limit = NULL,
distsumm = "min",
min_nb = 3,
robust = T,
cores = NULL
)
an STlist with transformed gene expression
the samples on which the test should be executed
the number of high-variance genes to be tested. These genes are selected in descending order of variance as caclulated using Seurat's vst method
the name of a column in @spatial_meta
containing the tissue domain
assigmemnts for each spot or cell. These assignents can be generated using the
STclust
function
one of the tissue domains in the column specified in annot
,
corresponding to the "reference" cluster or domain. Spearman's correlations will
be calculated using spots assigned to domains other than this reference domain
(or domains specified in exclude
).
optional, a cluster/domain to exclude from the analysis
logical (optional), remove gene expression outliers defined by
the interquartile method. This option is only valid when robust=F
limite the analysis to spots/cells with distances to ref
shorther
than the value specified here. Useful when gradients might occur at smaller scales
or when the domain in ref
is scattered through the tissue. Caution must be used
due to difficult interpretation of imposed limits. It is suggested to run analysis
without restricted distances in addition for comparison.
the distance summary metric to use in correlations. One of min
or avg
the minimum number of immediate neighbors a spot or cell has to
have in order to be included in the analysis. This parameter seeks to reduce the
effect of isolated ref
spots on the correlation
logical, wheter to use robus regression (MASS
and sfsmisc
packages)
the number of cores used during parallelization. If NULL (default), the number of cores is defined automatically
a list of data frames with the results of the test
The STgradient
function fits linear models and calculates Spearman coefficients
between the expression of a gene and the minimum or average distance of spots or
cells to a reference tissue domain. In other wordsm the STgradient
function
can be used to investigate if a gene is expressed higher in spots/cells closer to
a specific reference tissue domain, compared to spots/cells farther from the
reference domain (or viceversa as indicated by the Spearman's cofficient).