joinWithVariables.Rd
Joins data.frames of the SPATA2
objects observations with additional
variables, such as molecular data, signatures, and meta features.
joinWithVariables(
object,
variables,
spata_df = getCoordsDf(object),
smooth = FALSE,
smooth_span = NULL,
normalize = NULL,
uniform_variables = "keep",
verbose = NULL,
...
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character vector. The names of the data variables of interest.
Logical. If TRUE, a loess fit is used to smooth the values.
Numeric value. Controls the degree of smoothing.
Given to argument span
of stats::loess()
.
Logical. If set to TRUE values will be scaled to 0-1.
Hint: Variables that are uniformly expressed can not be scaled and are discarded.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
Used to absorb deprecated arguments or functions.
A data frame containing spatial data joined with additional variables.
This function joins spatial data from spata_df
with additional variables specified in 'variables'.
It retrieves molecular data, signatures, and meta features from the provided object and adds them to the spatial data frame.
Additionally, it can perform smoothing and normalization on numeric variables if desired. The 'uniform' parameter determines
how variables with uniform values are handled.
This function replaces the old joinWith()
, joinWithGenes()
, joinWithFeatures()
functions!
getVarTypeList()
, getMolTypeList()
, getSignatureTypeList()
, getMetaDf()
# Join spatial data with molecular and/or meta features
library(SPATA2)
object <- loadExampleObject("UKFT275", process = TRUE, meta = TRUE)
coords_df <- getCoordsDf(object)
joined_data <- joinWithVariables(object, spata_df = coords_df, variables = c("GFAP", "bayes_space", "HM_HYXPOXIA"))