An Eager Avocado

Eager Avocado

I give myself very good advice, but I very seldom follow it.

SAMSeq Demo

,

Two-class

set.seed(100)
mu <- matrix(100, 1000, 20)
mu[1:100, 11:20] <- 200
mu <- scale(mu, center=FALSE, scale=runif(20, 0.5, 1.5))
x <- matrix(rpois(length(mu), mu), 1000, 20)
y <- c(rep(1, 10), rep(2, 10))
 
samfit <- SAMseq(x, y, resp.type = "Two class unpaired") 
## Estimating sequencing depths...
## Resampling to get new data matrices...
## perm= 1
## perm= 2
## perm= 3
## perm= 4
## perm= 5
## perm= 6
## perm= 7
## perm= 8
## perm= 9
## perm= 10
## perm= 11
## perm= 12
## perm= 13
## perm= 14
## perm= 15
## perm= 16
## perm= 17
## perm= 18
## perm= 19
## perm= 20
## perm= 21
## perm= 22
## perm= 23
## perm= 24
## perm= 25
## perm= 26
## perm= 27
## perm= 28
## perm= 29
## perm= 30
## perm= 31
## perm= 32
## perm= 33
## perm= 34
## perm= 35
## perm= 36
## perm= 37
## perm= 38
## perm= 39
## perm= 40
## perm= 41
## perm= 42
## perm= 43
## perm= 44
## perm= 45
## perm= 46
## perm= 47
## perm= 48
## perm= 49
## perm= 50
## perm= 51
## perm= 52
## perm= 53
## perm= 54
## perm= 55
## perm= 56
## perm= 57
## perm= 58
## perm= 59
## perm= 60
## perm= 61
## perm= 62
## perm= 63
## perm= 64
## perm= 65
## perm= 66
## perm= 67
## perm= 68
## perm= 69
## perm= 70
## perm= 71
## perm= 72
## perm= 73
## perm= 74
## perm= 75
## perm= 76
## perm= 77
## perm= 78
## perm= 79
## perm= 80
## perm= 81
## perm= 82
## perm= 83
## perm= 84
## perm= 85
## perm= 86
## perm= 87
## perm= 88
## perm= 89
## perm= 90
## perm= 91
## perm= 92
## perm= 93
## perm= 94
## perm= 95
## perm= 96
## perm= 97
## perm= 98
## perm= 99
## perm= 100
## Number of thresholds chosen (all possible thresholds) = 118
## Getting all the cutoffs for the thresholds...
## Getting number of false positives in the permutation...
# examine significant gene list
print(samfit)
## Call:
## SAMseq(x = x, y = y, resp.type = "Two class unpaired")
## 
## Genes up
##        Gene ID Gene Name Score(d) Fold Change q-value(%)
##   [1,] g1      1         50       1.919       0         
##   [2,] g2      2         50       2.059       0         
##   [3,] g3      3         50       1.99        0         
##   [4,] g4      4         50       1.859       0         
##   [5,] g5      5         50       2.035       0         
##   [6,] g6      6         50       2.005       0         
##   [7,] g7      7         50       1.879       0         
##   [8,] g8      8         50       1.986       0         
##   [9,] g9      9         50       1.854       0         
##  [10,] g10     10        50       2.022       0         
##  [11,] g11     11        50       1.947       0         
##  [12,] g12     12        50       1.863       0         
##  [13,] g13     13        50       1.988       0         
##  [14,] g14     14        50       2.196       0         
##  [15,] g16     16        50       1.975       0         
##  [16,] g17     17        50       2.2         0         
##  [17,] g18     18        50       1.994       0         
##  [18,] g19     19        50       2.096       0         
##  [19,] g20     20        50       1.81        0         
##  [20,] g21     21        50       1.889       0         
##  [21,] g22     22        50       2.044       0         
##  [22,] g23     23        50       1.992       0         
##  [23,] g24     24        50       1.874       0         
##  [24,] g25     25        50       2.019       0         
##  [25,] g26     26        50       1.893       0         
##  [26,] g27     27        50       2.032       0         
##  [27,] g28     28        50       1.898       0         
##  [28,] g29     29        50       2.073       0         
##  [29,] g30     30        50       1.884       0         
##  [30,] g31     31        50       2.005       0         
##  [31,] g32     32        50       1.986       0         
##  [32,] g33     33        50       1.936       0         
##  [33,] g34     34        50       1.973       0         
##  [34,] g35     35        50       2.139       0         
##  [35,] g36     36        50       2.125       0         
##  [36,] g37     37        50       1.97        0         
##  [37,] g38     38        50       2.098       0         
##  [38,] g39     39        50       2.04        0         
##  [39,] g40     40        50       1.9         0         
##  [40,] g41     41        50       1.866       0         
##  [41,] g42     42        50       2.039       0         
##  [42,] g43     43        50       2.058       0         
##  [43,] g44     44        50       2.069       0         
##  [44,] g45     45        50       1.949       0         
##  [45,] g46     46        50       1.884       0         
##  [46,] g47     47        50       1.991       0         
##  [47,] g48     48        50       1.895       0         
##  [48,] g49     49        50       2.03        0         
##  [49,] g50     50        50       1.985       0         
##  [50,] g51     51        50       1.991       0         
##  [51,] g52     52        50       1.827       0         
##  [52,] g53     53        50       1.906       0         
##  [53,] g54     54        50       1.989       0         
##  [54,] g55     55        50       1.89        0         
##  [55,] g56     56        50       1.862       0         
##  [56,] g57     57        50       1.984       0         
##  [57,] g58     58        50       2.007       0         
##  [58,] g59     59        50       1.972       0         
##  [59,] g60     60        50       1.88        0         
##  [60,] g61     61        50       1.958       0         
##  [61,] g62     62        50       1.918       0         
##  [62,] g63     63        50       2.038       0         
##  [63,] g64     64        50       1.822       0         
##  [64,] g65     65        50       1.98        0         
##  [65,] g66     66        50       2.08        0         
##  [66,] g67     67        50       2.133       0         
##  [67,] g68     68        50       1.917       0         
##  [68,] g69     69        50       2.137       0         
##  [69,] g70     70        50       1.934       0         
##  [70,] g71     71        50       2.075       0         
##  [71,] g72     72        50       2.043       0         
##  [72,] g73     73        50       2.126       0         
##  [73,] g74     74        50       1.914       0         
##  [74,] g75     75        50       2.107       0         
##  [75,] g76     76        50       1.989       0         
##  [76,] g77     77        50       1.902       0         
##  [77,] g78     78        50       1.915       0         
##  [78,] g79     79        50       2.09        0         
##  [79,] g80     80        50       2.081       0         
##  [80,] g81     81        50       1.866       0         
##  [81,] g82     82        50       1.841       0         
##  [82,] g83     83        50       2.032       0         
##  [83,] g84     84        50       1.85        0         
##  [84,] g85     85        50       2.057       0         
##  [85,] g86     86        50       2.042       0         
##  [86,] g89     89        50       2.069       0         
##  [87,] g90     90        50       2.026       0         
##  [88,] g91     91        50       1.97        0         
##  [89,] g92     92        50       2.114       0         
##  [90,] g94     94        50       1.967       0         
##  [91,] g95     95        50       2.113       0         
##  [92,] g96     96        50       2.131       0         
##  [93,] g97     97        50       2.045       0         
##  [94,] g98     98        50       2.007       0         
##  [95,] g99     99        50       1.922       0         
##  [96,] g100    100       50       1.92        0         
##  [97,] g15     15        49.95    1.977       0         
##  [98,] g87     87        49.95    1.956       0         
##  [99,] g88     88        49.95    2.035       0         
## [100,] g93     93        49.95    1.985       0         
## [101,] g676    676       29.6     1.126       0         
## [102,] g307    307       23.45    1.082       3.584     
## [103,] g432    432       23       1.102       4.437     
## [104,] g881    881       21.65    1.113       7.031     
## [105,] g532    532       21.2     1.103       8.27      
## [106,] g152    152       19.95    1.128       11.959    
## [107,] g648    648       19.9     1.076       11.959    
## [108,] g287    287       19.8     1.081       12.694    
## [109,] g516    516       19.3     1.052       14.125    
## [110,] g281    281       19.25    1.076       14.125    
## [111,] g566    566       19.15    1.107       14.822    
## [112,] g803    803       18.95    1.088       15.505    
## [113,] g358    358       18.55    1.064       16.986    
## [114,] g813    813       18.45    1.092       17.041    
## [115,] g559    559       18.4     1.096       17.041    
## [116,] g772    772       18.4     1.169       17.041    
## [117,] g260    260       18.35    1.113       17.041    
## [118,] g792    792       18.25    1.018       17.041    
## [119,] g199    199       18.1     1.079       18.434    
## [120,] g571    571       17.8     1.092       19.042    
## [121,] g637    637       17.6     1.083       20.395    
## 
## Genes down
## NULL
# plot results
plot(samfit)

plot of chunk unnamed-chunk-1

Multiclass comparison

set.seed(100)
mu <- matrix(100, 1000, 20)
mu[1:20, 1:5] <- 120
mu[21:50, 6:10] <- 80
mu[51:70, 11:15] <- 150
mu[71:100, 16:20] <- 60
mu <- scale(mu, center=FALSE, scale=runif(20, 0.5, 1.5))
x <- matrix(rpois(length(mu), mu), 1000, 20)
y <- c(rep(1:4, rep(5, 4)))
 
samfit <- SAMseq(x, y, resp.type = "Multiclass") 
## Estimating sequencing depths...
## Resampling to get new data matrices...
## perm= 1
## perm= 2
## perm= 3
## perm= 4
## perm= 5
## perm= 6
## perm= 7
## perm= 8
## perm= 9
## perm= 10
## perm= 11
## perm= 12
## perm= 13
## perm= 14
## perm= 15
## perm= 16
## perm= 17
## perm= 18
## perm= 19
## perm= 20
## perm= 21
## perm= 22
## perm= 23
## perm= 24
## perm= 25
## perm= 26
## perm= 27
## perm= 28
## perm= 29
## perm= 30
## perm= 31
## perm= 32
## perm= 33
## perm= 34
## perm= 35
## perm= 36
## perm= 37
## perm= 38
## perm= 39
## perm= 40
## perm= 41
## perm= 42
## perm= 43
## perm= 44
## perm= 45
## perm= 46
## perm= 47
## perm= 48
## perm= 49
## perm= 50
## perm= 51
## perm= 52
## perm= 53
## perm= 54
## perm= 55
## perm= 56
## perm= 57
## perm= 58
## perm= 59
## perm= 60
## perm= 61
## perm= 62
## perm= 63
## perm= 64
## perm= 65
## perm= 66
## perm= 67
## perm= 68
## perm= 69
## perm= 70
## perm= 71
## perm= 72
## perm= 73
## perm= 74
## perm= 75
## perm= 76
## perm= 77
## perm= 78
## perm= 79
## perm= 80
## perm= 81
## perm= 82
## perm= 83
## perm= 84
## perm= 85
## perm= 86
## perm= 87
## perm= 88
## perm= 89
## perm= 90
## perm= 91
## perm= 92
## perm= 93
## perm= 94
## perm= 95
## perm= 96
## perm= 97
## perm= 98
## perm= 99
## perm= 100
## Number of thresholds chosen (all possible thresholds) = 173
## Getting all the cutoffs for the thresholds...
## Getting number of false positives in the permutation...
# examine significant gene list
print(samfit)
## Call:
## SAMseq(x = x, y = y, resp.type = "Multiclass")
## 
## Genes up
##        Gene ID Gene Name Score(d) contrast-1 contrast-2 contrast-3
##   [1,] g94     94        12.593   0.052      0.917      2.252     
##   [2,] g85     85        12.318   -0.013     1.864      1.37      
##   [3,] g83     83        12.301   0.912      0.327      2.021     
##   [4,] g82     82        12.257   0.519      0.537      2.165     
##   [5,] g88     88        12.225   1.855      1.392      -0.022    
##   [6,] g74     74        12.109   0.711      0.454      2.069     
##   [7,] g78     78        12.095   0.231      1.497      1.51      
##   [8,] g100    100       12.01    1.715      1.065      0.484     
##   [9,] g62     62        11.949   -1.549     -0.493     3.269     
##  [10,] g63     63        11.931   -0.471     -1.239     3.269     
##  [11,] g71     71        11.911   1.174      0.55       1.545     
##  [12,] g72     72        11.91    0.877      0.637      1.754     
##  [13,] g66     66        11.883   -1.824     -0.336     3.251     
##  [14,] g64     64        11.863   -0.594     -0.886     3.273     
##  [15,] g81     81        11.847   1.816      0.729      0.716     
##  [16,] g54     54        11.786   -1.558     -1.213     3.23      
##  [17,] g53     53        11.73    -1.218     -0.336     3.23      
##  [18,] g65     65        11.662   -1.667     -0.441     3.256     
##  [19,] g96     96        11.647   0.301      1.903      0.951     
##  [20,] g2      2         11.634   2.994      -2.064     -1.283    
##  [21,] g21     21        11.633   0.371      -2.68      -0.406    
##  [22,] g80     80        11.614   1.432      1.091      0.742     
##  [23,] g84     84        11.613   0.895      0.663      1.702     
##  [24,] g75     75        11.591   0.86       0.794      1.597     
##  [25,] g67     67        11.59    -1.567     -1.353     3.203     
##  [26,] g55     55        11.588   -0.249     -1.344     3.212     
##  [27,] g51     51        11.581   -1.292     -0.306     3.234     
##  [28,] g89     89        11.561   1.366      0.362      1.401     
##  [29,] g56     56        11.518   -0.559     -1.676     3.243     
##  [30,] g58     58        11.511   -1.772     -0.144     3.151     
##  [31,] g61     61        11.439   -1.449     -1.082     3.256     
##  [32,] g69     69        11.418   -0.956     -0.122     3.055     
##  [33,] g77     77        11.361   0.995      1.829      0.306     
##  [34,] g99     99        11.342   0.838      1.148      1.279     
##  [35,] g90     90        11.218   1.427      0.781      1.043     
##  [36,] g92     92        11.202   1.715      1.231      0.166     
##  [37,] g76     76        11.202   1.685      1.253      0.14      
##  [38,] g98     98        11.174   1.436      1.283      0.463     
##  [39,] g87     87        11.173   1.279      0.755      1.191     
##  [40,] g70     70        11.155   -1.283     -0.829     3.234     
##  [41,] g43     43        11.126   0.196      -3.011     0.799     
##  [42,] g95     95        11.103   1.209      0.895      1.091     
##  [43,] g57     57        11.071   -0.986     -1.1       3.199     
##  [44,] g86     86        11.042   0.899      0.772      1.549     
##  [45,] g52     52        10.983   -0.659     -1.239     3.199     
##  [46,] g59     59        10.889   -0.995     -0.716     3.19      
##  [47,] g73     73        10.731   0.55       1.916      0.572     
##  [48,] g91     91        10.723   1.078      1.253      0.816     
##  [49,] g60     60        10.649   -1.174     -0.493     3.09      
##  [50,] g35     35        10.579   1.026      -3.033     0.323     
##  [51,] g93     93        10.495   0.978      1.462      0.628     
##  [52,] g68     68        10.384   -1.174     -1.51      3.081     
##  [53,] g10     10        10.223   2.92       -0.493     -1.807    
##  [54,] g42     42        10.157   1.292      -3.038     0.834     
##  [55,] g41     41        10.129   0.419      -2.933     0.729     
##  [56,] g38     38        9.735    0.733      -2.95      0.703     
##  [57,] g79     79        9.619    1.017      0.855      1.113     
##  [58,] g19     19        9.209    2.492      -0.022     -2.313    
##  [59,] g47     47        9.11     1.754      -2.732     0.576     
##  [60,] g37     37        8.973    0.877      -2.867     0.825     
##  [61,] g34     34        8.731    1.292      -2.614     0.777     
##  [62,] g30     30        8.471    1.833      -2.418     0.314     
##  [63,] g8      8         8.227    2.64       -0.681     -0.642    
##  [64,] g3      3         8.221    2.719      -1.013     -0.956    
##  [65,] g48     48        8.185    0.951      -2.64      1.213     
##  [66,] g22     22        8.122    1.253      -2.736     0.572     
##  [67,] g49     49        7.979    1.462      -1.898     1.405     
##  [68,] g11     11        7.841    2.505      -0.236     -1.384    
##  [69,] g7      7         7.724    2.379      0.179      -1.724    
##  [70,] g20     20        7.673    2.422      -0.109     -1.715    
##  [71,] g9      9         7.616    2.361      -1.576     -0.755    
##  [72,] g12     12        7.531    2.457      -1.126     -1.104    
##  [73,] g39     39        7.515    0.794      -2.54      0.537     
##  [74,] g28     28        7.485    0.113      -2.352     0.716     
##  [75,] g50     50        7.334    1.384      -2.221     -0.266    
##  [76,] g97     97        7.213    0.196      1.318      0.995     
##  [77,] g40     40        7.128    0.986      -2.435     0.965     
##  [78,] g783    783       7.087    0.065      -2.322     1.436     
##  [79,] g24     24        6.973    0.319      -2.37      0.869     
##  [80,] g14     14        6.955    2.274      -1.091     -1.318    
##  [81,] g27     27        6.91     -0.716     -1.816     0.829     
##  [82,] g4      4         6.882    2.448      -1.017     -0.698    
##  [83,] g36     36        6.755    -0.122     -2.143     1.641     
##  [84,] g161    161       6.685    0.415      0.799      1.126     
##  [85,] g655    655       6.609    -1.641     1.432      -0.89     
##  [86,] g46     46        6.563    0.48       -2.274     0.498     
##  [87,] g1000   1000      6.475    0.589      0.694      -2.278    
##  [88,] g576    576       6.45     -0.965     -1.589     0.917     
##  [89,] g609    609       6.344    -1.335     0.602      -1.148    
##  [90,] g1      1         6.257    2.283      -0.982     -0.938    
##  [91,] g15     15        6.2      2.169      -0.157     -1.501    
##  [92,] g16     16        6.163    2.182      -1.187     0.061     
##  [93,] g5      5         6.091    2.156      -0.733     -0.109    
##  [94,] g976    976       6.062    1.253      -1.506     -0.847    
##  [95,] g6      6         6.027    1.85       0.183      -1.536    
##  [96,] g688    688       6.002    -1.322     -1.026     1.628     
##  [97,] g45     45        5.919    1.143      -2.187     0.816     
##  [98,] g229    229       5.882    -0.371     -0.48      -1.091    
##  [99,] g549    549       5.88     -0.367     1.785      -1.61     
## [100,] g32     32        5.846    0.249      -2.016     0.384     
## [101,] g907    907       5.769    0.301      -1.798     0.306     
##        contrast-4 q-value(%)
##   [1,] -3.221     0         
##   [2,] -3.221     0         
##   [3,] -3.26      0         
##   [4,] -3.221     0         
##   [5,] -3.225     0         
##   [6,] -3.234     0         
##   [7,] -3.238     0         
##   [8,] -3.265     0         
##   [9,] -1.226     0         
##  [10,] -1.558     0         
##  [11,] -3.269     0         
##  [12,] -3.269     0         
##  [13,] -1.091     0         
##  [14,] -1.794     0         
##  [15,] -3.26      0         
##  [16,] -0.458     0         
##  [17,] -1.676     0         
##  [18,] -1.148     0         
##  [19,] -3.155     0         
##  [20,] 0.354      0         
##  [21,] 2.715      0         
##  [22,] -3.265     0         
##  [23,] -3.26      0         
##  [24,] -3.251     0         
##  [25,] -0.284     0         
##  [26,] -1.619     0         
##  [27,] -1.637     0         
##  [28,] -3.129     0         
##  [29,] -1.008     0         
##  [30,] -1.235     0         
##  [31,] -0.724     0         
##  [32,] -1.977     0         
##  [33,] -3.129     0         
##  [34,] -3.265     0         
##  [35,] -3.251     0         
##  [36,] -3.112     0         
##  [37,] -3.077     0         
##  [38,] -3.182     0         
##  [39,] -3.225     0         
##  [40,] -1.122     0         
##  [41,] 2.016      0         
##  [42,] -3.195     0         
##  [43,] -1.113     0         
##  [44,] -3.221     0         
##  [45,] -1.301     0         
##  [46,] -1.48      0         
##  [47,] -3.038     0         
##  [48,] -3.147     0         
##  [49,] -1.423     0         
##  [50,] 1.685      0         
##  [51,] -3.068     0         
##  [52,] -0.397     0         
##  [53,] -0.62      0         
##  [54,] 0.912      0         
##  [55,] 1.785      0         
##  [56,] 1.514      0         
##  [57,] -2.985     0         
##  [58,] -0.157     0         
##  [59,] 0.402      0         
##  [60,] 1.165      0         
##  [61,] 0.546      0         
##  [62,] 0.271      0         
##  [63,] -1.318     0         
##  [64,] -0.751     0         
##  [65,] 0.476      0         
##  [66,] 0.912      0         
##  [67,] -0.969     1.3       
##  [68,] -0.886     1.3       
##  [69,] -0.834     1.922     
##  [70,] -0.598     2.389     
##  [71,] -0.031     2.389     
##  [72,] -0.227     2.389     
##  [73,] 1.209      2.389     
##  [74,] 1.523      2.389     
##  [75,] 1.104      3.489     
##  [76,] -2.51      3.489     
##  [77,] 0.484      4.533     
##  [78,] 0.82       4.533     
##  [79,] 1.183      5.39      
##  [80,] 0.135      5.39      
##  [81,] 1.702      5.39      
##  [82,] -0.733     5.39      
##  [83,] 0.624      6.39      
##  [84,] -2.339     7.367     
##  [85,] 1.1        8.223     
##  [86,] 1.296      8.223     
##  [87,] 0.995      10.045    
##  [88,] 1.637      10.045    
##  [89,] 1.881      10.926    
##  [90,] -0.362     12.769    
##  [91,] -0.511     13.6      
##  [92,] -1.056     14.413    
##  [93,] -1.314     14.733    
##  [94,] 1.1        15.517    
##  [95,] -0.498     15.819    
##  [96,] 0.72       16.575    
##  [97,] 0.227      18.227    
##  [98,] 1.942      18.752    
##  [99,] 0.192      18.752    
## [100,] 1.384      19.448    
## [101,] 1.191      21.006    
## 
## Genes down
## NULL
# plot results
plot(samfit)

plot of chunk unnamed-chunk-2