Batch correction for GeoMX data
A Spatial Experiment object.
The number of unwanted factors to use. Can be 0. This is required for the RUV4 method.
Column name(s) to indicate the factors of interest. This is required for the RUV4 method.
Negative control genes. This is required for the RUV4 method.
Integer to indicate the nth count table in the assay(spe) to be used.
A vector indicating batches. This is required for the Limma method.
A vector indicating the second series of batches. This is specific for the Limma method.
A matrix or vector of numeric covariates to be adjusted for.
A design matrix relating to treatment conditions to be preserved, can be generated using stats::model.matrix
function with all biological factors included.
Can be either RUV4 or Limma, by default is RUV4.
A Spatial Experiment object, containing the ruv4-normalized count and normalization factor.
Gagnon-Bartsch, J. A., Jacob, L., & Speed, T. P. (2013). Removing unwanted variation from high dimensional data with negative controls. Berkeley: Tech Reports from Dep Stat Univ California, 1-112.
Ritchie, M. E., Phipson, B., Wu, D. I., Hu, Y., Law, C. W., Shi, W., & Smyth, G. K. (2015). limma powers differential expression analyses for RNA-sequencing and microarray studies. Nucleic acids research, 43(7), e47-e47.
data("dkd_spe_subset")
spe <- findNCGs(dkd_spe_subset, top_n = 100)
#> New names:
#> • `cv` -> `cv...1`
#> • `cv` -> `cv...2`
#> • `cv` -> `cv...3`
#> • `cv` -> `cv...4`
#> • `cv` -> `cv...5`
#> • `cv` -> `cv...6`
#> • `cv` -> `cv...7`
spe_ruv <- geomxBatchCorrection(spe,
k = 3,
factors = c("disease_status", "region"),
NCGs = S4Vectors::metadata(spe)$NCGs
)