Perform scale method on data
scale_method.Rd
This function is a modified version of the function ScalingMethods from the package DiffCorr, but it allows for missing values for Power and Range scaling
Usage
scale_method(
data,
methods = c("auto", "range", "pareto", "vast", "level", "power")
)
Arguments
- data
a data matrix or data frame object where each row is a biomolecule and each column each sample or replicate
- methods
a string character specifying the pre-treatment method and can be "auto", "range", "pareto", "vast", "level", or "power"
Value
a data matrix or data frame object (depending on what was the input) that has undergone pre-treatment method
Examples
library(malbacR)
data(pmart_amide)
malbacR:::scale_method(pmart_amide$e_data[,-1])
#> 15 22 29 37 56 84 99
#> QC1 0.3229682 2.039122 0.5416895 -0.2909551 -0.4249079 0.6246719 -0.1193757
#> A2 0.3848103 1.789011 -0.7172372 -0.5379632 1.1602029 -0.1137703 -0.2489140
#> 109 121 127 132 135 148 169
#> QC1 -0.4070221 7.26589357 2.402938 0.8449770 -1.626069 2.814834 1.216316
#> A2 -0.4061881 -0.07845704 1.882921 0.5735986 -1.875006 1.934295 2.921914
#> 219 247 270 273 281 287 291
#> QC1 0.8107065 -0.73298279 -0.1493601 0.6196262 -1.452175 -0.5046256 -0.5483448
#> A2 0.3362388 -0.09323999 -1.3690062 0.4164327 -0.525970 -1.3456402 -1.8404359
#> 309 316 320 330 349 355 361
#> QC1 -0.4438088 -1.704723 2.716954 -0.4942052 -0.5066308 1.546147 -0.3399787
#> A2 -0.3108929 -1.083401 1.881935 -0.2298145 -0.5025743 1.518262 -1.0212615
#> 369 393 418 421 423 436 441
#> QC1 -0.6318109 -0.8442313 0.2578461 0.466109 -0.2762663 -0.6476965 -0.8784945
#> A2 -0.9354024 -0.8262577 -0.5604893 2.148440 0.1003030 -1.3133996 -0.6905645
#> 455 462 465 470 474 485 492
#> QC1 1.505111 0.8881880 2.791305 6.332545 0.33600052 -0.8749981 -1.343969
#> A2 -1.802509 0.6613682 2.119549 1.341552 0.06300673 -0.9008047 -1.252021
#> 500 501 504 514 526 532 533
#> QC1 0.9718567 -0.8770814 -0.171526715 2.762716 -0.05282987 -0.1790219 1.159030
#> A2 1.0352084 0.6434513 0.002514825 -0.646898 -0.27552314 -0.5642992 1.292827
#> 536 557 570 597 598 610 648
#> QC1 -0.3050493 -1.3706692 0.4742124 1.493864 0.8581414 -0.9919277 -0.7704648
#> A2 -0.4483967 -0.6457875 -0.5271703 2.187279 0.9847246 -1.0232581 -0.7275805
#> 664 676 717 719 724 729 731
#> QC1 -2.518490 -0.1365824 0.3703581 0.6389016 -0.7397672 -0.841564 1.910001
#> A2 -1.551547 -0.1298700 3.1340271 0.5454089 1.1240181 -1.027025 1.596704
#> 733 751 753 785 797 818 846
#> QC1 0.05086182 1.1980879 -0.4647608 0.4138424 -1.559799 2.148230 -1.607207
#> A2 0.08741350 -0.6582574 -0.3247130 1.2136635 2.443568 1.773451 -2.104583
#> 858 867 878 894 912 934 966
#> QC1 0.0006943363 -0.3864710 -1.638346 -0.9931159 1.254218 -2.121476 1.123933
#> A2 -0.4763108021 -0.4749282 -1.232968 -0.9858730 2.378998 -1.764747 1.839594
#> 983 989 990 1017 1059 1069 1073
#> QC1 -1.8472887 -1.2924703 -0.2073141 -0.9887641 0.5110391 2.597119 -0.13805641
#> A2 -0.9428239 -0.2220234 0.3307383 -0.7269120 0.7131207 1.703223 -0.05449312
#> 1101 1115 1128 1129 1134 1139 1148
#> QC1 -0.885500 -1.344678 -1.074713 -0.83786949 -1.0422868 0.7775182 -0.4069299
#> A2 -1.659768 -1.248840 0.236856 -0.09597577 -0.6156985 0.6524808 -0.4418681
#> 1154 1167 1172 1190 1191 1200 1218
#> QC1 -0.3701281 -0.2196705 3.823404 0.3982628 0.01914087 -0.6764996 -0.2548228
#> A2 -0.3572635 -0.2291937 1.391218 0.5723571 2.99737244 -0.7286500 0.1595146
#> 1221 1222 1242 1253 1265 1266 1301
#> QC1 -0.2010860 -0.9166023 1.4245873 1.946883 -1.0985897 0.77609539 -0.2647108
#> A2 -0.9303581 0.7118552 0.9824527 1.845230 0.4709444 -0.08945707 1.4471450
#> 1317 1328 1340 1354 1360 1381 1421
#> QC1 2.131135 -0.8987753 0.4506765 0.5840192 1.668178 -0.4944618 1.9128642
#> A2 2.158729 -1.4360070 -0.5859816 1.2135787 -1.514329 0.4311298 0.3768337
#> 1446 1452 1459 1463 1474 1491 1498
#> QC1 -0.0666253 -0.03254151 1.0285008 -0.8993476 -1.043287 -0.8125421 -1.038639
#> A2 8.4439360 -0.18034888 -0.3286192 -0.9652367 -1.079629 -0.8978624 -1.024350
#> 1522 1530 1533 1544 1572 1580 1596
#> QC1 -0.5584622 -1.2164485 -0.1435166 -1.811060 -1.715875 -0.6734884 -1.0478010
#> A2 -0.6552943 -0.4986076 -0.5197581 -1.548322 -1.089689 -1.0155446 -0.2777571
#> 1611 1639 1659 1668 1696 1706 1749
#> QC1 0.2017795 1.998447 -1.21174 -1.090229 0.3579287 -0.27319415 -1.014598
#> A2 0.4666333 1.325422 1.44618 -1.387270 0.5767126 0.01645352 -1.048734
#> 1760 1766 1783 1790 1791 1799 1813
#> QC1 NA -0.3507569 NA 0.50879272 0.6118634 -1.147893 -2.0294972
#> A2 -1.45392 -0.7995521 -1.953447 0.09843346 1.8228334 -1.423385 0.5661737
#> 1820 1822 1833 1838 1839 1841
#> QC1 -0.2579466 -0.43649939 -1.0353521 -0.04796472 0.3128500 -0.1476402
#> A2 0.6550549 0.01165884 -0.9814099 -0.09109838 0.2289883 -0.5240471
#> 1858 1895 1926 1937 1942 1948 1949
#> QC1 -1.508615 0.7463626 -0.5911566 -1.066744 2.476701 -0.05337846 5.282281
#> A2 -1.370758 3.4638570 8.1672924 -1.171206 2.850727 0.03491282 1.748605
#> 1956 1957 1966 1993 2012 2016 2017
#> QC1 0.2919371 -1.1933378 -0.1514888 1.917367 -0.8390290 0.06953321 0.2287501
#> A2 0.4312282 -0.9647548 -0.4029938 1.577971 -0.9298502 -1.42009050 -0.4942613
#> 2018 2033 2043 2053 2079 2087 2110
#> QC1 1.406807 1.2150616 -0.8667929 4.721850 1.879914 0.2354504 -1.1786656
#> A2 1.694162 0.2148333 -0.5849065 5.609762 1.089469 2.0362889 -0.4190543
#> 2117 2137 2152 2153 2156 2159 2167
#> QC1 3.5679087 0.9844032 2.8459373 3.881284 0.08943937 -1.354479 -0.1765036
#> A2 -0.4979736 0.5815631 0.7755201 3.834716 -0.15226168 -1.476076 1.5010750
#> 2177 2178 2181 2189 2221 2265 2281
#> QC1 -1.961450 -0.4242284 -0.9210079 -0.1238923 -1.1194561 0.9206461 -0.06287945
#> A2 -1.337225 1.5952558 2.1787758 -0.3860040 -0.8748334 2.0760923 -0.31193615
#> 2283 2300 2312 2319 2330 2347
#> QC1 -0.5256353 -0.4784610 2.239788 0.1279351 -0.6482807 -0.0004549571
#> A2 -0.4462968 -0.6145242 1.601194 -0.3680631 -0.6638287 0.2047474516
#> 2378 2426 2432 2461 2482 2483
#> QC1 -1.398966 0.04543608 0.0821855 -0.4057521 -0.2756552 -0.1460246
#> A2 1.217059 -0.45681303 -0.3124342 -0.2120331 -0.3252404 -0.1358085
#> 2492 2496 2499 2513 2542 2543 2578
#> QC1 0.2868124 -0.05520765 2.131537 1.092425 0.8649437 0.4104692 0.2301155
#> A2 -0.4196691 -0.14537074 2.008041 1.559027 0.8999781 -0.1288641 -0.9285980
#> 2580 2587 2597 2624 2625 2643 2652
#> QC1 -0.6342846 -0.1646116 1.5016299 1.820248 1.7443680 -0.1263227 -0.9686116
#> A2 1.4502288 -1.1627801 -0.3130219 1.540914 0.7296079 -0.1296125 1.1308632
#> 2722 2752 2762 2778 2802 2809 2813
#> QC1 0.4697995 -0.03760808 -0.5596366 -0.2216327 -0.01151044 0.4730039 0.6181459
#> A2 2.1795036 -0.82688937 -0.5696002 -0.2314278 -0.08762674 0.8753116 0.1092516
#> 2815 2822 2833 2840 2841 2849 2858
#> QC1 0.2249734 0.08113629 1.3214537 NA 2.247206 0.08901589 1.5202546
#> A2 -0.5147757 -0.35473420 0.9602435 -1.333747 2.195236 1.97461872 0.6553892
#> 2866 2884 2900 2904 2922 2964 2966
#> QC1 0.8071131 0.3646936 -0.8466055 -1.447615 1.0156619 -0.1416918 0.01454369
#> A2 -1.1956257 1.3641351 -0.8700725 -1.657174 0.2086692 -0.7748639 -0.28188031
#> 2984 3042 3045 3068 3070 3101 3123
#> QC1 1.1691323 0.2493340 -0.1349900 1.4028382 1.074128 2.341279 -1.473643
#> A2 0.3269442 -0.2707809 0.2798821 -0.4683148 4.234880 3.352743 -1.140687
#> 3144 3153 3175 3189 3193 3200 3210
#> QC1 0.01795814 3.889027 -0.16363420 1.153958 0.138181279 0.5644392 -0.4826531
#> A2 -0.06604458 1.678270 0.03925917 2.173988 0.009709383 -0.5016708 -0.5674923
#> 3217 3255 3286 3292 3306 3333 3354
#> QC1 1.814625 0.08218264 -0.1239421 0.2410561 0.8758002 2.3721163 0.9866673
#> A2 1.382926 0.13137291 -0.5324178 -0.2542958 -0.1490332 0.6365696 7.3058422
#> 3366 3372 3379 3388 3418 3421 3428
#> QC1 0.2119950 -0.322939 1.209216 -1.989747 1.380077 -0.9974613 -0.6557717
#> A2 -0.1811672 2.435758 1.769505 -2.200547 1.233205 -0.9786089 -0.6329632
#> 3476 3486 3505 3506 3514 3523 3525
#> QC1 0.5103245 -0.7110464 0.04026592 2.06519790 1.007226 0.58205723 -0.1660213
#> A2 0.3408504 -0.7494622 -0.20711083 0.05389075 1.595197 0.03362029 -0.3624595
#> 3551 3552 3556 3565 3580 3586 3598
#> QC1 0.5540938 -0.1766867 2.284091 0.6650919 2.252718 -0.8874526 1.2578895
#> A2 1.1867155 -0.1097271 1.152482 6.8221616 2.478513 -0.9171725 0.2177638
#> 3616 3662 3682 3686 3700 3702 3747
#> QC1 0.3783782 1.683040 4.886775 0.6257618 0.6216017 2.1876939 -1.355732
#> A2 0.5238541 1.508106 1.183950 0.8149599 0.4562689 0.6555605 -1.379146
#> 3760 3774 3788 3789 3796 3805 3821
#> QC1 2.620169 -0.1999991 -1.070527 -0.1681277 0.7723554 0.05962799 1.2728837
#> A2 2.233399 0.2452229 -2.253001 2.1249120 5.1673038 0.26224374 0.3783261
#> 3822 3863 3869 3910 3912 3913 3914
#> QC1 1.492819 0.6953948 -0.4209908 3.0949124 -0.5126350 -1.0217488 1.410837
#> A2 1.056740 0.6140603 1.2699738 0.3790122 0.7465466 -0.7155032 4.819087
#> 3917 3937 3940 3979 3990 3992 3997
#> QC1 0.8987375 0.946810 3.358204 0.5092770 -0.4890815 0.869913 2.050539
#> A2 -0.3188727 1.887637 3.173129 0.1009206 -0.6181150 3.038354 4.429505
#> 4012 4049 4050 4059 4063 4065 4072
#> QC1 0.06792905 0.8682990 0.6721838 -1.180484 0.1149080 0.1536492 1.822470
#> A2 1.73774599 -0.2781689 0.3668957 -1.224969 0.2139603 0.2769246 0.291147
#> 4075 4078 4084 4092 4096 4115 4136
#> QC1 3.940624 0.8665703 -0.8727685 0.2359286 -0.2202633 0.3876823 3.169119
#> A2 3.570080 -0.4955195 -1.0120296 -0.2912330 0.2619541 -0.6775204 2.823946
#> 4141 4147 4156 4158 4182 4204 4207
#> QC1 0.0891138 0.5260106 -0.2633316 -0.8770854 0.1974880 0.6380425 1.878380
#> A2 0.7391925 0.5005985 -0.9416963 2.0278553 0.7269865 1.1485207 1.004544
#> 4208 4211 4212 4222 4225 4236 4246
#> QC1 1.1828505 -0.6014792 -1.193135 -1.299793 0.8161236 1.322777 NA
#> A2 0.1092468 1.7843736 NA 2.158752 2.6902395 2.514504 -1.895317
#> 4254 4257 4277 4281 4318 4343 4344
#> QC1 1.1934710 -0.30153772 0.6716656 0.8919319 0.04044242 1.622659 -0.3250718
#> A2 0.5443636 0.03038567 1.6181402 -0.9720204 -0.40741946 1.587569 -0.3963790
#> 4356 4387 4396 4401 4405 4425 4430
#> QC1 -0.8241689 -1.888953 0.2782336 1.4457995 -0.5119215 3.169740 -0.0997416
#> A2 -0.7672410 -1.763008 3.5498799 -0.6860611 NA 1.139023 -0.3824962
#> 4436 4439 4454 4455 4477 4486 4499
#> QC1 0.8319791 -0.9834766 1.541786 0.3653004 0.8338971 -0.3432415 -0.6505222
#> A2 1.3898612 NA 1.420687 0.1821327 2.0120770 -0.8498334 1.0310338
#> 4503 4504 4508 4567 4589 4590 4633
#> QC1 1.773708 3.277079 0.3119125 -0.3484117 -0.05680038 -0.1428746 -1.47768
#> A2 1.667212 1.973516 -0.1131127 -1.0506233 -0.63711990 -0.1904569 -1.80992
#> 4650 4664 4666 4669 4672 4686 4707
#> QC1 4.6542537 1.0925235 1.562244 1.3268656 0.4629785 0.5043292 0.2097399
#> A2 0.9533283 0.2361067 1.612026 -0.3807206 0.5872060 -0.6275836 -1.2390377
#> 4729 4730 4749 4771 4775 4782 4839
#> QC1 -0.08022234 -0.01566779 0.0324556 0.3103484 1.102279 -0.5758984 0.8590488
#> A2 0.72323114 -0.02735483 1.1850853 -0.3534710 1.685462 -0.7853965 -0.7733356
#> 4846 4879 4907 4934 4939 4948 4978
#> QC1 0.7184647 0.2290017 -0.9803596 NA 1.4468658 -0.3317513 -0.7365562
#> A2 -0.2869199 -0.2409351 -0.8325763 -0.3533132 0.1190894 -0.4418995 -0.8576025
#> 5026 5036 5040 5046 5048 5051 5057
#> QC1 0.2900596 0.7417247 5.080520 -0.02233983 1.0771108 0.3003371 1.443322
#> A2 -0.7118871 -0.2934502 4.900818 -0.73681945 -0.7380219 -0.2492167 1.500859
#> 5071 5077 5084 5092 5094 5098 5121
#> QC1 1.217559 -0.8899357 0.07745685 0.3598251 -1.293481 -0.6620963 2.0084869
#> A2 1.598339 -0.6035911 -0.26022648 -0.9867064 -1.098942 -0.5468573 0.8001717
#> 5123 5136 5147 5148 5160 5161 5163
#> QC1 0.9381693 -1.977082 0.9280542 -1.105133 0.1981178 -0.2229897 -1.320652
#> A2 -0.9863614 -1.876760 -0.6168047 -1.091758 0.3934824 0.5460640 -1.390486
#> 5171 5191 5199 5203 5253 5259 5261
#> QC1 1.560664 -1.181754 0.06860532 0.1752711 -1.600379 1.5848514 -0.1630228
#> A2 1.284286 -1.046057 -0.43986623 -0.9178197 -1.811966 0.2124182 -0.2848913
#> 5288 5300 5307 5353 5388 5390 5391
#> QC1 0.8966790 4.3894499 0.7577284 1.5316162 -0.9526031 -0.6145415 0.949059
#> A2 0.9018006 -0.2364019 -0.4250365 -0.8335681 -1.4221144 -0.3135274 0.524678
#> 5400 5410 5416 5447 5458 5474 5488
#> QC1 -0.5389659 0.5595134 -0.5537571 -0.04092517 -0.9774064 2.095749 2.703781
#> A2 -0.5337890 0.4066782 -0.5346455 -0.69020856 1.2110178 2.107913 2.120569
#> 5491 5504 5510 5522 5543 5577
#> QC1 -0.8845051 -0.4396685 -0.9880017 0.1821659 0.06951474 1.05041336
#> A2 -1.0103163 -0.2920614 -0.3753821 0.8115854 -0.30424504 0.06401632
#> 5591 5592 5603 5612 5630 5632 5645
#> QC1 -0.3014421 1.5849050 -0.6064398 1.2261955 -0.9230935 -1.096218 0.1593672
#> A2 -0.5705839 -0.6853488 -0.4468399 -0.3702126 -1.2301226 -1.300713 -0.4749869
#> 5663 5666 5673 5685 5694 5704
#> QC1 -0.1314736 0.2220685 0.8193501 0.4004754 -0.2130524 -0.2984379
#> A2 -0.5342674 2.3027214 -0.3787304 0.4121886 -0.2692119 -0.2151330
#> 5711 5724 5729 5736 5738 5742 5744
#> QC1 -0.736165200 -0.4831316 0.06784327 0.5702397 -0.1082101 1.251203 -0.8231985
#> A2 -0.009005807 -0.1950374 NA 0.5724355 1.0469926 0.160697 -0.6951920
#> 5748 5763 5772 5781 5788 5793
#> QC1 -1.201468 0.6713714 0.1075849 0.2162503 NA 0.55097249
#> A2 -1.324874 -0.4383112 -0.5557482 -0.6136150 -1.250865 -0.08384785
#> 5795 5831 5838 5854 5862 5880
#> QC1 0.05933862 -0.3959536 1.221806 0.02323118 0.2783523 -1.599752
#> A2 -0.12770810 -0.6142750 1.192980 -0.26937251 -0.4484397 -1.591364
#> 5897 5914 5922 5932 5936 5939 5953
#> QC1 -1.11825931 -0.7626555 -1.075943 1.218446 0.3088961 -1.589822 -0.1807972
#> A2 0.08554798 -1.6052968 -1.176397 1.077666 -0.4362423 2.065458 -1.0660418
#> 5987 6003 6017 6035 6037 6070
#> QC1 0.08795929 -0.3001496 -0.559801212 -0.9883227 -1.43859603 -1.7634525
#> A2 0.15313578 4.6856932 0.009662141 -1.1944562 -0.06786623 0.3029827
#> 6083 6091 6126 6134 6138 6157 6161
#> QC1 0.5695997 0.4974936 -0.4523079 -0.6054852 -1.328694 -0.3026783 -0.2801805
#> A2 -0.5667095 -0.7012031 0.7305252 2.4859685 0.661883 0.3018789 2.2891246
#> 6175 6177 6184 6217 6245 6250 6256
#> QC1 -1.18771685 0.7798946 0.2059781 -1.458809 0.3230023 1.15649054 0.03746006
#> A2 -0.02297007 0.3516030 1.4960929 1.406602 -0.4440383 -0.07457964 1.87475662
#> 6273 6275 6276 6282 6290 6295 6308
#> QC1 0.4164460 -0.02243076 -1.095013 0.6199173 -1.256220 NA -0.8550319
#> A2 0.2868591 -1.00045147 1.588439 0.1249956 -1.251146 NA -0.9180902
#> 6319 6325 6326 6337 6338 6365 6374
#> QC1 -1.268433 -0.4710624 2.417461 1.120287 0.9574018 0.3952302 -0.5685113
#> A2 -1.261247 -0.3581215 2.643974 1.167909 1.0559612 0.2906608 -0.7612349
#> 6375 6415 6426 6440
#> QC1 -0.5719582 1.000770 0.320075 1.017147
#> A2 -0.6197121 1.230673 -0.386257 1.053366
#> [ reached 'max' / getOption("max.print") -- omitted 640 rows ]