medianScaling.Rd
Median centering and scaling of an input numeric matrix
medianScaling(mat, scale = FALSE, grps = NULL, reorder = FALSE, assay = NULL)
a matrix with rows correspond to phosphosites and columns correspond to samples.
a boolean flag indicating whether to scale the samples.
a string or factor specifying the grouping (replciates).
To reorder the columns by group (grps
).
By default (reorder=FALSE
), original column order is maintained.
an assay to be selected if mat
is a PhosphoExperiment
object.
A median scaled matrix
data('phospho.cells.Ins.sample')
grps = gsub('_[0-9]{1}', '', colnames(phospho.cells.Ins))
phospho.cells.Ins.filtered <- selectGrps(phospho.cells.Ins, grps, 0.5, n=1)
set.seed(123)
phospho.cells.Ins.impute <-
scImpute(phospho.cells.Ins.filtered,
0.5,
grps)[,colnames(phospho.cells.Ins.filtered)]
set.seed(123)
phospho.cells.Ins.impute[,seq(5)] <- ptImpute(
phospho.cells.Ins.impute[,seq(6,10)],
phospho.cells.Ins.impute[,seq(5)], percent1 = 0.6,
percent2 = 0, paired = FALSE)
#> idx1: 34
phospho.cells.Ins.ms <-
medianScaling(phospho.cells.Ins.impute, scale = FALSE)