Last data update: 2014.03.03

R: Function to do mlr normalizatiopn on a matrix of replicates
mlrrepR Documentation

Function to do mlr normalizatiopn on a matrix of replicates

Description

Calculate all pairwise ratios, log-transform them, find the least variable replicate.

Usage

mlrrep(mat)

Arguments

mat

Data matrix with replicates as columns

Value

mat.norm

Normalized data matrix; matrix assumed positive

wdmat

Square matrix of half peak widths for each ratio of replicates of size ncol(mat)

nfmat

Square matrix of normalization factors for each ratio of replicates of size ncol(mat)

idx

Index of replicate to be used as denominator yielding smallest widths

See Also

mlr, mlrGroup

Examples

# Example using the iris data
mlrrep(iris[,-5])

# random data
mat = exp(matrix(rnorm(1000),ncol=4))
res = mlrrep(mat) 
layout(matrix(1:2, nrow=1))
boxplot(log(res$mat.norm))
boxplot(log(mat))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(SwathXtend)
Loading required package: e1071
Loading required package: openxlsx
Loading required package: VennDiagram
Loading required package: grid
Loading required package: futile.logger
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/SwathXtend/mlrrep.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mlrrep
> ### Title: Function to do mlr normalizatiopn on a matrix of replicates
> ### Aliases: mlrrep
> 
> ### ** Examples
> 
> # Example using the iris data
> mlrrep(iris[,-5])
$mat.norm
    Sepal.Length Sepal.Width Petal.Length Petal.Width
1            5.1    7.500400     1.794579   0.7717703
2            4.9    6.428914     1.794579   0.7717703
3            4.7    6.857508     1.666395   0.7717703
4            4.6    6.643211     1.922763   0.7717703
5            5.0    7.714697     1.794579   0.7717703
6            5.4    8.357588     2.179131   1.5435407
7            4.6    7.286103     1.794579   1.1576555
8            5.0    7.286103     1.922763   0.7717703
9            4.4    6.214617     1.794579   0.7717703
10           4.9    6.643211     1.922763   0.3858852
11           5.4    7.928994     1.922763   0.7717703
12           4.8    7.286103     2.050947   0.7717703
13           4.8    6.428914     1.794579   0.3858852
14           4.3    6.428914     1.410026   0.3858852
15           5.8    8.571885     1.538210   0.7717703
16           5.7    9.429074     1.922763   1.5435407
17           5.4    8.357588     1.666395   1.5435407
18           5.1    7.500400     1.794579   1.1576555
19           5.7    8.143291     2.179131   1.1576555
20           5.1    8.143291     1.922763   1.1576555
21           5.4    7.286103     2.179131   0.7717703
22           5.1    7.928994     1.922763   1.5435407
23           4.6    7.714697     1.281842   0.7717703
24           5.1    7.071805     2.179131   1.9294258
25           4.8    7.286103     2.435500   0.7717703
26           5.0    6.428914     2.050947   0.7717703
27           5.0    7.286103     2.050947   1.5435407
28           5.2    7.500400     1.922763   0.7717703
29           5.2    7.286103     1.794579   0.7717703
30           4.7    6.857508     2.050947   0.7717703
31           4.8    6.643211     2.050947   0.7717703
32           5.4    7.286103     1.922763   1.5435407
33           5.2    8.786182     1.922763   0.3858852
34           5.5    9.000480     1.794579   0.7717703
35           4.9    6.643211     1.922763   0.7717703
36           5.0    6.857508     1.538210   0.7717703
37           5.5    7.500400     1.666395   0.7717703
38           4.9    7.714697     1.794579   0.3858852
39           4.4    6.428914     1.666395   0.7717703
40           5.1    7.286103     1.922763   0.7717703
41           5.0    7.500400     1.666395   1.1576555
42           4.5    4.928834     1.666395   1.1576555
43           4.4    6.857508     1.666395   0.7717703
44           5.0    7.500400     2.050947   2.3153110
45           5.1    8.143291     2.435500   1.5435407
46           4.8    6.428914     1.794579   1.1576555
47           5.1    8.143291     2.050947   0.7717703
48           4.6    6.857508     1.794579   0.7717703
49           5.3    7.928994     1.922763   0.7717703
50           5.0    7.071805     1.794579   0.7717703
51           7.0    6.857508     6.024657   5.4023924
52           6.4    6.857508     5.768289   5.7882775
53           6.9    6.643211     6.281025   5.7882775
54           5.5    4.928834     5.127368   5.0165072
55           6.5    6.000320     5.896473   5.7882775
56           5.7    6.000320     5.768289   5.0165072
57           6.3    7.071805     6.024657   6.1741627
58           4.9    5.143131     4.230078   3.8588517
59           6.6    6.214617     5.896473   5.0165072
60           5.2    5.786023     4.999184   5.4023924
61           5.0    4.285943     4.486447   3.8588517
62           5.9    6.428914     5.383736   5.7882775
63           6.0    4.714537     5.127368   3.8588517
64           6.1    6.214617     6.024657   5.4023924
65           5.6    6.214617     4.614631   5.0165072
66           6.7    6.643211     5.640105   5.4023924
67           5.6    6.428914     5.768289   5.7882775
68           5.8    5.786023     5.255552   3.8588517
69           6.2    4.714537     5.768289   5.7882775
70           5.6    5.357428     4.999184   4.2447369
71           5.9    6.857508     6.152841   6.9459331
72           6.1    6.000320     5.127368   5.0165072
73           6.3    5.357428     6.281025   5.7882775
74           6.1    6.000320     6.024657   4.6306220
75           6.4    6.214617     5.511920   5.0165072
76           6.6    6.428914     5.640105   5.4023924
77           6.8    6.000320     6.152841   5.4023924
78           6.7    6.428914     6.409210   6.5600479
79           6.0    6.214617     5.768289   5.7882775
80           5.7    5.571725     4.486447   3.8588517
81           5.5    5.143131     4.870999   4.2447369
82           5.5    5.143131     4.742815   3.8588517
83           5.8    5.786023     4.999184   4.6306220
84           6.0    5.786023     6.537394   6.1741627
85           5.4    6.428914     5.768289   5.7882775
86           6.0    7.286103     5.768289   6.1741627
87           6.7    6.643211     6.024657   5.7882775
88           6.3    4.928834     5.640105   5.0165072
89           5.6    6.428914     5.255552   5.0165072
90           5.5    5.357428     5.127368   5.0165072
91           5.5    5.571725     5.640105   4.6306220
92           6.1    6.428914     5.896473   5.4023924
93           5.8    5.571725     5.127368   4.6306220
94           5.0    4.928834     4.230078   3.8588517
95           5.6    5.786023     5.383736   5.0165072
96           5.7    6.428914     5.383736   4.6306220
97           5.7    6.214617     5.383736   5.0165072
98           6.2    6.214617     5.511920   5.0165072
99           5.1    5.357428     3.845526   4.2447369
100          5.7    6.000320     5.255552   5.0165072
101          6.3    7.071805     7.691052   9.6471292
102          5.8    5.786023     6.537394   7.3318182
103          7.1    6.428914     7.562867   8.1035886
104          6.3    6.214617     7.178315   6.9459331
105          6.5    6.428914     7.434683   8.4894737
106          7.6    6.428914     8.460157   8.1035886
107          4.9    5.357428     5.768289   6.5600479
108          7.3    6.214617     8.075604   6.9459331
109          6.7    5.357428     7.434683   6.9459331
110          7.2    7.714697     7.819236   9.6471292
111          6.5    6.857508     6.537394   7.7177034
112          6.4    5.786023     6.793762   7.3318182
113          6.8    6.428914     7.050131   8.1035886
114          5.7    5.357428     6.409210   7.7177034
115          5.8    6.000320     6.537394   9.2612441
116          6.4    6.857508     6.793762   8.8753589
117          6.5    6.428914     7.050131   6.9459331
118          7.7    8.143291     8.588341   8.4894737
119          7.7    5.571725     8.844709   8.8753589
120          6.0    4.714537     6.409210   5.7882775
121          6.9    6.857508     7.306499   8.8753589
122          5.6    6.000320     6.281025   7.7177034
123          7.7    6.000320     8.588341   7.7177034
124          6.3    5.786023     6.281025   6.9459331
125          6.7    7.071805     7.306499   8.1035886
126          7.2    6.857508     7.691052   6.9459331
127          6.2    6.000320     6.152841   6.9459331
128          6.1    6.428914     6.281025   6.9459331
129          6.4    6.000320     7.178315   8.1035886
130          7.2    6.428914     7.434683   6.1741627
131          7.4    6.000320     7.819236   7.3318182
132          7.9    8.143291     8.203788   7.7177034
133          6.4    6.000320     7.178315   8.4894737
134          6.3    6.000320     6.537394   5.7882775
135          6.1    5.571725     7.178315   5.4023924
136          7.7    6.428914     7.819236   8.8753589
137          6.3    7.286103     7.178315   9.2612441
138          6.4    6.643211     7.050131   6.9459331
139          6.0    6.428914     6.152841   6.9459331
140          6.9    6.643211     6.921946   8.1035886
141          6.7    6.643211     7.178315   9.2612441
142          6.9    6.643211     6.537394   8.8753589
143          5.8    5.786023     6.537394   7.3318182
144          6.8    6.857508     7.562867   8.8753589
145          6.7    7.071805     7.306499   9.6471292
146          6.7    6.428914     6.665578   8.8753589
147          6.3    5.357428     6.409210   7.3318182
148          6.5    6.428914     6.665578   7.7177034
149          6.2    7.286103     6.921946   8.8753589
150          5.9    6.428914     6.537394   6.9459331

$wdmat
          [,1]      [,2]      [,3]      [,4]
[1,] 0.0000000 0.5657951 0.4501242 0.8644326
[2,] 0.5657951 0.0000000 1.6905328 0.9786221
[3,] 0.4501242 1.6905328 0.0000000 0.4929750
[4,] 0.8644326 0.9786221 0.4929750 0.0000000

$nfmat
           [,1]       [,2]       [,3]      [,4]
[1,]  0.0000000  0.7621933  0.2482981 1.3503697
[2,] -0.7621933  0.0000000 -0.5244526 0.5669215
[3,] -0.2482981  0.5244526  0.0000000 1.1292695
[4,] -1.3503697 -0.5669215 -1.1292695 0.0000000

$idx
[1] 1

> 
> # random data
> mat = exp(matrix(rnorm(1000),ncol=4))
> res = mlrrep(mat) 
> layout(matrix(1:2, nrow=1))
> boxplot(log(res$mat.norm))
> boxplot(log(mat))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>