### Install package
> options(CRAN="http://cran.r-project.org/web/packages/pheatmap/index.html")
> install.packages("pheatmap")
### load package
> library("pheatmap")
### create test data
> test = matrix(rnorm(200), 20, 10)
> test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
> test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
> test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
> colnames(test) = paste("Test", 1:10, sep = "")
> rownames(test) = paste("Gene", 1:20, sep = "")
> test
Test1 Test2 Test3 Test4 Test5 Test6
Gene1 4.094563042 0.5118152 3.10794819 0.11530724 4.37440188 1.8208706
Gene2 3.165525958 0.4861343 2.01077665 0.42475515 2.04642307 -0.8124748
Gene3 3.350068122 -0.8894833 2.12521892 -0.43458461 2.01856286 0.8279173
Gene4 2.341112907 0.4989207 2.91888426 -0.31066261 5.20134243 2.0573383
Gene5 3.584767116 -1.2046530 2.74698977 -0.94116805 2.75217776 -2.6408126
Gene6 1.722266398 -0.4301721 3.80128866 0.02044419 1.53352764 0.9571194
Gene7 2.614152288 -0.4240152 2.07078609 0.46134251 2.50889935 -0.6776301
Gene8 3.568465981 1.3325691 3.27583920 0.32196713 2.82704689 -0.1185278
Gene9 3.386676076 0.3117526 2.61956536 0.53293037 2.90917003 0.1692072
Gene10 1.827973838 0.7370344 3.97124321 -0.86280278 3.75723527 -1.2951000
Gene11 0.718950380 1.5265876 1.45180417 1.24589729 -0.13348511 4.2421778
Gene12 0.136613465 2.3805338 -0.70569592 3.39264719 0.33996828 3.0111556
Gene13 0.789485355 2.8861412 0.18036821 0.68221663 0.54595272 2.9918586
Gene14 -0.009749531 2.1494277 -0.47826130 1.98738475 0.37387453 4.6888097
Gene15 0.135775233 4.1414101 -0.03685195 4.62607722 -0.04300592 8.7893104
Gene16 -1.015476494 4.9929087 -0.06025030 6.52567480 -1.44751375 6.5736936
Gene17 0.073249478 6.3746540 1.00209811 5.38703439 -0.37222018 4.7036958
Gene18 -0.248705707 6.4655924 -0.53745114 6.86687352 0.50439243 5.6569122
Gene19 -1.635180585 6.9633944 -1.18922860 6.30714750 1.12623790 5.1265479
Gene20 -2.496715951 6.7437682 0.20202699 5.51681378 0.51118258 6.0868502
Test7 Test8 Test9 Test10
Gene1 3.2082705 -0.252135920 4.07334929 0.25676879
Gene2 3.6316252 0.577416275 3.35881769 -0.35841496
Gene3 3.2642084 -1.022249880 3.44763656 2.46332906
Gene4 1.7020497 0.002380317 3.65231083 -0.38046247
Gene5 1.7405126 0.146917077 2.43244038 -1.33168153
Gene6 2.7014595 -0.828282926 3.10313453 -1.63900197
Gene7 3.5184086 -1.728348557 3.09421638 -0.09611012
Gene8 3.4098541 -2.080157101 3.31102968 0.53797990
Gene9 2.7298143 0.487291556 3.27440641 0.48346523
Gene10 3.5915322 -0.903722160 2.61941526 0.04673203
Gene11 0.1121237 1.393742639 0.86103926 3.25249472
Gene12 1.3066230 0.534810515 1.47966954 0.86055967
Gene13 1.1043705 0.408179522 0.03941142 2.42877283
Gene14 -0.2441030 0.914897168 2.29315259 1.68276389
Gene15 -0.3721801 6.412213257 -0.25592509 6.94889685
Gene16 -0.1953022 5.141293979 0.26004570 5.15348012
Gene17 0.9799351 5.802572706 -0.06684329 5.38533137
Gene18 1.1939022 7.109466106 -1.29502960 4.66880105
Gene19 -1.2199789 6.523312747 0.10249122 5.96981060
Gene20 0.9473031 6.387173538 0.58010652 4.42840771
> pheatmap(test)
> pheatmap(test, cellwidth = 15, cellheight = 12, fontsize = 8, filename = "test.pdf")
# Result
0 コメント:
コメントを投稿