medianScaling: Median centering and scaling

Description Usage Arguments Value Examples

View source: R/toolBox.R

Description

Median centering and scaling of an input numeric matrix

Usage

1

Arguments

mat

a matrix with rows correspond to phosphosites and columns correspond to samples.

scale

a boolean flag indicating whether to scale the samples.

grps

a string or factor specifying the grouping (replciates).

reorder

whehther to reorder by factor.

Value

A median scaled matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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[,1:5] <- ptImpute(phospho.cells.Ins.impute[,6:10],
    phospho.cells.Ins.impute[,1:5], percent1 = 0.6,
    percent2 = 0, paired = FALSE)

phospho.cells.Ins.ms <-
    medianScaling(phospho.cells.Ins.impute, scale = FALSE)

PengyiYang/PhosR documentation built on June 21, 2020, 8:37 a.m.