R version 4.5.0 RC (2025-04-04 r88113 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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(BimodalIndex) > # want to test the bimodal index method > suppressWarnings( RNGversion("3.5.0") ) > set.seed(632984) # for reproducibility > # start by generating a dataset with no bimodality > nGenes <- 500 > nSamples <- 200 > temp <- matrix(rnorm(nGenes*nSamples), nrow=nGenes) > # define the number of samples in the smaller group > fracs <- rep(nSamples*seq(0.1, 0.5, by=0.1), each=20) > # define the spread between the two means, per gene > delta <- rnorm(length(fracs), 3,1) > # now shift the means for the smaller group. This is > # woefully inefficient. > for (i in 1:length(fracs)) { + temp[i, 1:fracs[i]] <- temp[i, 1:fracs[i]] + delta[i] + } > # now we compute the bimodal index > bim <- bimodalIndex(temp) 1 ..... > summary(bim) mu1 mu2 sigma delta Min. :-3.8769 Min. :-0.01898 Min. :0.6081 Min. :0.4438 1st Qu.:-0.6668 1st Qu.: 0.41723 1st Qu.:0.7843 1st Qu.:1.1752 Median :-0.4509 Median : 0.61565 Median :0.8583 Median :1.5987 Mean :-0.4739 Mean : 1.01590 Mean :0.8623 Mean :1.7168 3rd Qu.:-0.2433 3rd Qu.: 0.99431 3rd Qu.:0.9337 3rd Qu.:2.0057 Max. : 0.3995 Max. : 5.20052 Max. :1.1789 Max. :5.0671 pi BI Min. :0.005767 Min. :0.2219 1st Qu.:0.448375 1st Qu.:0.5423 Median :0.514340 Median :0.7104 Mean :0.530201 Mean :0.7762 3rd Qu.:0.621788 3rd Qu.:0.9009 Max. :0.968033 Max. :2.4548 > summary(bim[1:100,]) mu1 mu2 sigma delta Min. :-1.5104038 Min. :0.3115 Min. :0.6903 Min. :0.6021 1st Qu.:-0.1155936 1st Qu.:1.9618 1st Qu.:0.9335 1st Qu.:2.0892 Median : 0.0002403 Median :2.7991 Median :0.9704 Median :2.7512 Mean :-0.0379155 Mean :2.7582 Mean :0.9819 Mean :2.8430 3rd Qu.: 0.0769621 3rd Qu.:3.4754 3rd Qu.:1.0326 3rd Qu.:3.4199 Max. : 0.3995124 Max. :5.2005 Max. :1.1789 Max. :5.0671 pi BI Min. :0.07572 Min. :0.2958 1st Qu.:0.53814 1st Qu.:0.8266 Median :0.66537 Median :1.2231 Mean :0.66320 Mean :1.2342 3rd Qu.:0.79341 3rd Qu.:1.5692 Max. :0.95325 Max. :2.4548 > head(bim) mu1 mu2 sigma delta pi BI 1 0.07635903 2.7829339 1.0924257 2.477583 0.9243274 0.6552552 2 -0.34871269 0.7512452 0.8852165 1.242586 0.5544320 0.6176006 3 -0.10583783 2.2044991 0.9766556 2.365560 0.8405612 0.8659953 4 0.03787646 2.5197614 0.9390361 2.643013 0.9028601 0.7827236 5 0.18473027 3.2921071 1.0257444 3.029387 0.9532519 0.6395001 6 -0.11394594 2.9958387 1.0194171 3.050552 0.9144887 0.8530596 > round(bim[1:100,], digits=6) mu1 mu2 sigma delta pi BI 1 0.076359 2.782934 1.092426 2.477583 0.924327 0.655255 2 -0.348713 0.751245 0.885217 1.242586 0.554432 0.617601 3 -0.105838 2.204499 0.976656 2.365560 0.840561 0.865995 4 0.037876 2.519761 0.939036 2.643013 0.902860 0.782724 5 0.184730 3.292107 1.025744 3.029387 0.953252 0.639500 6 -0.113946 2.995839 1.019417 3.050552 0.914489 0.853060 7 0.004924 2.776242 1.009473 2.745312 0.899931 0.823847 8 0.100832 2.495767 0.907157 2.640045 0.889641 0.827223 9 -0.106663 1.562448 0.927246 1.800074 0.844114 0.652971 10 0.030513 4.682197 0.959156 4.849769 0.897738 1.469442 11 -0.415971 0.721198 0.860605 1.321360 0.506156 0.660630 12 -0.016713 2.620104 1.056544 2.495701 0.903486 0.736968 13 -0.414617 0.999347 0.792102 1.785078 0.677961 0.834092 14 -0.136827 1.063213 0.835076 1.437043 0.746702 0.624970 15 0.104534 4.704105 0.956282 4.809850 0.897908 1.456275 16 -0.101760 3.924495 0.952428 4.227361 0.897868 1.280135 17 0.192551 3.215121 1.077580 2.804960 0.949985 0.611414 18 -0.161484 2.120957 0.933760 2.444354 0.863762 0.838514 19 -0.001389 3.859805 1.126361 3.428026 0.913541 0.963414 20 -0.079254 0.583323 1.100362 0.602144 0.593018 0.295816 21 -0.112147 2.899010 0.885465 3.400652 0.801880 1.355443 22 0.034028 3.366021 0.980819 3.397152 0.785227 1.395091 23 0.015894 5.200516 1.089705 4.757820 0.805868 1.881865 24 0.014981 4.026680 1.041140 3.853180 0.776657 1.604796 25 -0.003418 2.568905 0.932997 2.757054 0.829121 1.037764 26 0.056481 4.368405 0.953579 4.521833 0.792018 1.835249 27 0.049228 2.881156 0.936875 3.022738 0.797197 1.215403 28 -0.188842 1.339616 0.900025 1.698239 0.667917 0.799803 29 0.115920 2.818848 1.058285 2.554065 0.850517 0.910688 30 -0.155108 1.411501 1.082806 1.446805 0.701908 0.661798 31 0.059131 2.921380 0.937239 3.053916 0.798701 1.224532 32 -0.087232 0.904208 0.917655 1.080406 0.614923 0.525740 33 -0.021985 2.388171 1.009438 2.387623 0.763237 1.014968 34 0.036550 2.071052 0.969057 2.099467 0.821632 0.803722 35 0.001870 2.496192 0.912808 2.732581 0.780085 1.131805 36 -0.003983 3.584092 1.076353 3.333547 0.792150 1.352650 37 -0.219397 1.639875 0.933156 1.992456 0.693203 0.918850 38 -0.025764 2.785797 1.069664 2.628452 0.824286 1.000328 39 0.070279 2.087486 0.987542 2.042654 0.939975 0.485196 40 0.162431 3.921279 1.052045 3.572896 0.828542 1.346656 41 0.145426 3.630338 0.929136 3.750702 0.692247 1.731189 42 0.032593 4.076456 0.946202 4.273786 0.702313 1.954151 43 -0.192928 1.684245 0.895911 2.095267 0.601453 1.025841 44 -0.195290 2.329704 0.859847 2.936561 0.646628 1.403726 45 0.005412 3.467676 0.974444 3.553065 0.713015 1.607245 46 -0.185592 3.128309 0.897770 3.691257 0.679508 1.722583 47 0.017980 1.717621 0.981150 1.732294 0.653213 0.824481 48 -0.058166 4.420036 1.099666 4.072331 0.698328 1.869134 49 0.017181 2.790305 1.178949 2.352199 0.662816 1.111998 50 -0.002318 4.509531 0.967825 4.661843 0.697916 2.140538 51 0.052368 4.029239 0.979121 4.061673 0.718361 1.826934 52 -0.198844 2.489787 0.968593 2.775813 0.687830 1.286252 53 -0.075436 1.206945 0.991700 1.293114 0.563290 0.641356 54 0.113633 2.651364 0.947844 2.677371 0.680984 1.247910 55 -0.209241 3.030792 1.012323 3.200594 0.678411 1.494953 56 -0.120536 3.759884 0.976960 3.971936 0.680177 1.852542 57 0.096927 3.103163 0.965687 3.113055 0.714511 1.406003 58 -0.104255 2.881846 0.967276 3.087125 0.669043 1.452670 59 -1.510404 0.311502 0.906871 2.009003 0.075720 0.531481 60 0.219162 5.078947 0.959083 5.067118 0.706340 2.307758 61 -0.171185 1.723770 0.993785 1.906805 0.615728 0.927513 62 0.154723 2.913300 0.959712 2.874381 0.634411 1.384287 63 -0.157668 1.225432 0.858461 1.611139 0.539310 0.803076 64 -0.057320 4.523655 0.918620 4.986803 0.587607 2.454830 65 0.047766 2.473660 0.906689 2.675553 0.630945 1.291085 66 -0.174851 1.970032 0.870980 2.462608 0.562639 1.221603 67 0.021656 2.245191 1.113885 1.996199 0.550351 0.993026 68 0.262827 3.048165 1.023415 2.721612 0.629536 1.314345 69 -0.141203 3.054412 0.935176 3.417128 0.612994 1.664363 70 -0.399866 1.173987 0.690327 2.279865 0.506657 1.139831 71 0.127084 3.284123 1.064698 2.965196 0.598480 1.453556 72 0.047518 3.887699 1.048781 3.661565 0.592206 1.799383 73 -0.095796 2.469731 0.905347 2.833749 0.579230 1.398973 74 -0.590427 0.992758 1.100281 1.438892 0.201640 0.577319 75 -0.005738 1.877604 0.909451 2.070855 0.647279 0.989489 76 0.113719 1.412042 1.178171 1.101982 0.472524 0.550158 77 0.156620 1.084267 0.972806 0.953579 0.493593 0.476750 78 0.078771 4.967618 1.025470 4.767422 0.598782 2.336728 79 -0.169875 2.182773 1.055589 2.228754 0.509974 1.114155 80 0.031030 3.431144 0.960700 3.539205 0.615712 1.721563 81 0.041380 3.383747 0.997841 3.349599 0.495624 1.674735 82 -0.060001 3.444433 1.029726 3.403269 0.479284 1.700173 83 0.005815 3.335819 1.086002 3.066297 0.504261 1.533093 84 -0.183686 1.386331 0.951792 1.649538 0.500702 0.824768 85 0.086408 2.285855 0.947613 2.321040 0.534640 1.157731 86 0.177403 3.164479 0.953311 3.133371 0.515251 1.565957 87 -0.166731 1.937200 1.028695 2.045243 0.373766 0.989494 88 0.138026 4.627230 1.005911 4.462823 0.497777 2.231390 89 -0.044168 3.498754 1.121939 3.157856 0.504337 1.578868 90 0.223650 4.360266 0.978326 4.228262 0.498199 2.114117 91 0.119549 2.807961 1.108051 2.426254 0.503040 1.213104 92 0.252169 3.499824 1.106457 2.935185 0.500235 1.467593 93 0.114705 4.040881 0.984442 3.988226 0.513765 1.993357 94 -0.103855 0.883153 0.969745 1.017802 0.564302 0.504675 95 0.399512 3.083594 1.071495 2.504986 0.584860 1.234322 96 -0.292922 1.631879 0.948903 2.028449 0.461976 1.011287 97 -0.056592 4.335514 0.925277 4.746802 0.504848 2.373289 98 0.126012 2.516177 0.970999 2.461553 0.494441 1.230700 99 0.053255 3.411511 1.008160 3.331075 0.483190 1.664596 100 -0.074998 2.389531 0.933627 2.639734 0.466906 1.316973 > > proc.time() user system elapsed 5.76 0.14 5.85