trim_outlier: Trim outlier out by Robust PCA

Description Usage Arguments Value Author(s) References See Also Examples

Description

Trim outlier out based on the orthogonal and score distances computed by robust principal components analysis (PCA). After log-transformation, like ordinary PCA, the values are scaled, but using robust statistics such as median instead of mean and MAD instead SD. Please note this function is applied to each binder batch separately and omits the data of the samples having any NA first.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
trim_outlier(X, ...)

## S4 method for signature 'matrix'
trim_outlier(
  X,
  ...,
  alpha = 0.9,
  cutoff.od.P = 0.025,
  cutoff.sd.P = 0.025,
  coord = c("o&s", "o", "s", "os"),
  plotit = FALSE,
  main = "",
  kmax = 10
)

## S4 method for signature 'BAf'
trim_outlier(
  X,
  ...,
  by_s = NULL,
  alpha = 0.9,
  cutoff.od.P = 0.025,
  cutoff.sd.P = 0.025,
  coord = c("o&s", "o", "s", "os"),
  plotit = FALSE,
  kmax = 10
)

Arguments

X

a matrix or a BAf-class object

...

in order to encourage to use all parameter names

alpha, kmax

the parameter for rrcov::PcaHubert

cutoff.od.P, cutoff.sd.P

the probability threshold for the orthogonal and score distances

coord

the distance coordinates to be used in outlier classification. "o&s" indicates the points beyond the cutoffs on both coordinates are labelled as outliers. In other options, the points over any cutoff on any coordinates are marked as outliers.

plotit

if plots were wanted

main

title of plot

by_s

Robust PCA per sample set divided by this. If it is a character, then the column named as it in @sinfo wil be used for stratification. When a factor vector is given, then it is used as it is in dividing into groups. If it is NULL as the default, there will be no stratification.

Value

The BAf object after outlier removal

Author(s)

Mun-Gwan Hong <mun-gwan.hong@scilifelab.se>

References

Hubert, M., Rousseeuw, P. J., Branden, K. V., (2005) ROBPCA: A New Approach to Robust Principal Component Analysis. Technometrics 47, 64-79

See Also

apply_per_group

Examples

1
2
3
data(sba)
B <- trim_outlier(sba, applyBy= "plate", plotit = FALSE)
summary(B)

Rundmus/BAf-R_package documentation built on May 18, 2020, 12:59 p.m.