R/batchCorrection.R
findBestK.Rd
Testing multiple K for RUV4 batch correction to find the best K.
findBestK(
spe,
maxK = 10,
factor_of_int,
factor_batch,
NCGs,
point_size = 3,
line_col = "black",
point_col = "black",
text_size = 13
)
A Spatial Experiment object.
Integer. The max k to test, will test k from 1 to maxK, by default is 10.
Column name(s) to indicate the factors of interest. This is required for the RUV4 method.
Column name to indicate the batch.
Negative control genes. This is required for the RUV4 method.
Numeric. Plotting parameter.
Character. Plotting parameter.
Character. Plotting parameter.
Numeric. Plotting parameter.
A ggplot object.
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`
findBestK(spe,
factor_of_int = c("disease_status"),
factor_batch = "SlideName", NCGs = S4Vectors::metadata(spe)$NCGs
)