source("http://bioconductor.org/biocLite.R")
## Bioconductor version 3.4 (BiocInstaller 1.24.0), ?biocLite for help
## A new version of Bioconductor is available after installing the most
##   recent version of R; see http://bioconductor.org/install
biocLite()
## BioC_mirror: https://bioconductor.org
## Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.3 (2017-03-06).
## installation path not writeable, unable to update packages: boot, cluster,
##   foreign, lattice, MASS, Matrix, mgcv
## Old packages: 'amap', 'aplpack', 'backports', 'BH', 'bindr', 'bindrcpp',
##   'bit', 'blob', 'broom', 'car', 'caTools', 'checkmate', 'circlize',
##   'coin', 'cowplot', 'crayon', 'curl', 'data.table', 'DBI', 'dendextend',
##   'devtools', 'digest', 'dplyr', 'e1071', 'evaluate', 'Formula', 'fpc',
##   'gdtools', 'GetoptLong', 'GGally', 'ggiraph', 'ggplot2', 'ggpubr',
##   'ggrepel', 'ggsci', 'ggsignif', 'ggthemes', 'git2r', 'GlobalOptions',
##   'glue', 'gridExtra', 'gsubfn', 'gtools', 'hexbin', 'highr', 'Hmisc',
##   'hms', 'htmlTable', 'htmlwidgets', 'httpuv', 'httr', 'iC10',
##   'iC10TrainingData', 'ipred', 'ISLR', 'kernlab', 'knitr', 'lava',
##   'lazyeval', 'lme4', 'mclust', 'modeltools', 'moonBook', 'multcomp',
##   'munsell', 'mvtnorm', 'mycor', 'officer', 'openssl', 'packrat', 'party',
##   'pheatmap', 'pkgconfig', 'PKI', 'plogr', 'plotly', 'polspline',
##   'prodlim', 'progress', 'psych', 'purrr', 'quantreg', 'R.oo', 'R.utils',
##   'randomForest', 'rattle', 'Rcpp', 'RcppEigen', 'RCurl', 'reshape',
##   'reshape2', 'rjson', 'rlang', 'rmarkdown', 'rmeta', 'rms', 'robustbase',
##   'rpart', 'rpart.plot', 'rprojroot', 'rsconnect', 'RSQLite',
##   'rstudioapi', 'rvg', 'sandwich', 'scales', 'shape', 'shiny',
##   'sourcetools', 'stringi', 'stringr', 'survival', 'survminer',
##   'survMisc', 'testthat', 'TH.data', 'tibble', 'tidyr', 'trimcluster',
##   'viridis', 'viridisLite', 'withr', 'XML', 'xml2', 'yaml', 'zoo',
##   'ztable'
biocLite("affy")
## BioC_mirror: https://bioconductor.org
## Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.3 (2017-03-06).
## Installing package(s) 'affy'
## package 'affy' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\shi-lab\AppData\Local\Temp\Rtmpa2c0dF\downloaded_packages
## installation path not writeable, unable to update packages: boot, cluster,
##   foreign, lattice, MASS, Matrix, mgcv
## Old packages: 'amap', 'aplpack', 'backports', 'BH', 'bindr', 'bindrcpp',
##   'bit', 'blob', 'broom', 'car', 'caTools', 'checkmate', 'circlize',
##   'coin', 'cowplot', 'crayon', 'curl', 'data.table', 'DBI', 'dendextend',
##   'devtools', 'digest', 'dplyr', 'e1071', 'evaluate', 'Formula', 'fpc',
##   'gdtools', 'GetoptLong', 'GGally', 'ggiraph', 'ggplot2', 'ggpubr',
##   'ggrepel', 'ggsci', 'ggsignif', 'ggthemes', 'git2r', 'GlobalOptions',
##   'glue', 'gridExtra', 'gsubfn', 'gtools', 'hexbin', 'highr', 'Hmisc',
##   'hms', 'htmlTable', 'htmlwidgets', 'httpuv', 'httr', 'iC10',
##   'iC10TrainingData', 'ipred', 'ISLR', 'kernlab', 'knitr', 'lava',
##   'lazyeval', 'lme4', 'mclust', 'modeltools', 'moonBook', 'multcomp',
##   'munsell', 'mvtnorm', 'mycor', 'officer', 'openssl', 'packrat', 'party',
##   'pheatmap', 'pkgconfig', 'PKI', 'plogr', 'plotly', 'polspline',
##   'prodlim', 'progress', 'psych', 'purrr', 'quantreg', 'R.oo', 'R.utils',
##   'randomForest', 'rattle', 'Rcpp', 'RcppEigen', 'RCurl', 'reshape',
##   'reshape2', 'rjson', 'rlang', 'rmarkdown', 'rmeta', 'rms', 'robustbase',
##   'rpart', 'rpart.plot', 'rprojroot', 'rsconnect', 'RSQLite',
##   'rstudioapi', 'rvg', 'sandwich', 'scales', 'shape', 'shiny',
##   'sourcetools', 'stringi', 'stringr', 'survival', 'survminer',
##   'survMisc', 'testthat', 'TH.data', 'tibble', 'tidyr', 'trimcluster',
##   'viridis', 'viridisLite', 'withr', 'XML', 'xml2', 'yaml', 'zoo',
##   'ztable'
library("affy")
## Loading required package: BiocGenerics
## Loading required package: parallel
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
## 
##     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
##     clusterExport, clusterMap, parApply, parCapply, parLapply,
##     parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, cbind, colnames,
##     do.call, duplicated, eval, evalq, Filter, Find, get, grep,
##     grepl, intersect, is.unsorted, lapply, lengths, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff,
##     sort, table, tapply, union, unique, unsplit, which, which.max,
##     which.min
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
KRAS = ReadAffy(filenames = "5500024034290101707047.F09.CEL", "5500024052603032009483.A12.CEL", "5500024052603032009483.G06.CEL", "5500024032848101507998.B10.CEL", "5500024052861011409506.D01.CEL", "5500024032848101507998.E11.CEL", "5500024031722092907496.H12.CEL", "5500024034290101707047.A05.CEL", "5500024032848101507000.G06.CEL", "5500024031722092907496.H06.CEL", "5500024034290101707047.C03.CEL")
KRAS_r = rma(KRAS)
## Warning: replacing previous import 'AnnotationDbi::tail' by 'utils::tail'
## when loading 'hthgu133acdf'
## Warning: replacing previous import 'AnnotationDbi::head' by 'utils::head'
## when loading 'hthgu133acdf'
## 
## Background correcting
## Normalizing
## Calculating Expression
KRAS_mat = exprs(KRAS_r)
head(KRAS_mat)
##           5500024034290101707047.F09.CEL 5500024052603032009483.A12.CEL
## 1007_s_at                       7.364389                       9.503870
## 1053_at                         7.295093                       7.651981
## 117_at                          4.465322                       4.397856
## 121_at                          8.204941                       7.261401
## 1255_g_at                       4.031449                       4.204490
## 1294_at                         6.632214                       4.514837
##           5500024052603032009483.G06.CEL 5500024032848101507998.B10.CEL
## 1007_s_at                       8.909625                       8.827681
## 1053_at                         6.559581                       7.839967
## 117_at                          4.437510                       4.931139
## 121_at                          6.706644                       5.486878
## 1255_g_at                       4.270122                       4.104300
## 1294_at                         4.518926                       5.064516
##           5500024052861011409506.D01.CEL 5500024032848101507998.E11.CEL
## 1007_s_at                       9.149653                       8.723754
## 1053_at                         7.021968                       7.718094
## 117_at                          4.609267                       4.595297
## 121_at                          6.010056                       5.505689
## 1255_g_at                       4.047717                       4.104997
## 1294_at                         4.600201                       6.482290
##           5500024031722092907496.H12.CEL 5500024034290101707047.A05.CEL
## 1007_s_at                       9.036108                       9.894642
## 1053_at                         7.189334                       7.033029
## 117_at                          4.578792                       4.622559
## 121_at                          6.381950                       5.794937
## 1255_g_at                       4.016189                       3.953581
## 1294_at                         5.221429                       4.645681
##           5500024032848101507000.G06.CEL 5500024031722092907496.H06.CEL
## 1007_s_at                      10.921478                      10.188224
## 1053_at                         6.448116                       7.092481
## 117_at                          5.050050                       4.314094
## 121_at                          5.633458                       6.070841
## 1255_g_at                       4.091887                       4.057362
## 1294_at                         4.505513                       4.540576
##           5500024034290101707047.C03.CEL
## 1007_s_at                       9.690698
## 1053_at                         6.211782
## 117_at                          6.181307
## 121_at                          5.593667
## 1255_g_at                       3.973924
## 1294_at                         4.868878
biocLite("hthgu133a.db")
## BioC_mirror: https://bioconductor.org
## Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.3 (2017-03-06).
## Installing package(s) 'hthgu133a.db'
## installing the source package 'hthgu133a.db'
## installation path not writeable, unable to update packages: boot, cluster,
##   foreign, lattice, MASS, Matrix, mgcv
## Old packages: 'amap', 'aplpack', 'backports', 'BH', 'bindr', 'bindrcpp',
##   'bit', 'blob', 'broom', 'car', 'caTools', 'checkmate', 'circlize',
##   'coin', 'cowplot', 'crayon', 'curl', 'data.table', 'DBI', 'dendextend',
##   'devtools', 'digest', 'dplyr', 'e1071', 'evaluate', 'Formula', 'fpc',
##   'gdtools', 'GetoptLong', 'GGally', 'ggiraph', 'ggplot2', 'ggpubr',
##   'ggrepel', 'ggsci', 'ggsignif', 'ggthemes', 'git2r', 'GlobalOptions',
##   'glue', 'gridExtra', 'gsubfn', 'gtools', 'hexbin', 'highr', 'Hmisc',
##   'hms', 'htmlTable', 'htmlwidgets', 'httpuv', 'httr', 'iC10',
##   'iC10TrainingData', 'ipred', 'ISLR', 'kernlab', 'knitr', 'lava',
##   'lazyeval', 'lme4', 'mclust', 'modeltools', 'moonBook', 'multcomp',
##   'munsell', 'mvtnorm', 'mycor', 'officer', 'openssl', 'packrat', 'party',
##   'pheatmap', 'pkgconfig', 'PKI', 'plogr', 'plotly', 'polspline',
##   'prodlim', 'progress', 'psych', 'purrr', 'quantreg', 'R.oo', 'R.utils',
##   'randomForest', 'rattle', 'Rcpp', 'RcppEigen', 'RCurl', 'reshape',
##   'reshape2', 'rjson', 'rlang', 'rmarkdown', 'rmeta', 'rms', 'robustbase',
##   'rpart', 'rpart.plot', 'rprojroot', 'rsconnect', 'RSQLite',
##   'rstudioapi', 'rvg', 'sandwich', 'scales', 'shape', 'shiny',
##   'sourcetools', 'stringi', 'stringr', 'survival', 'survminer',
##   'survMisc', 'testthat', 'TH.data', 'tibble', 'tidyr', 'trimcluster',
##   'viridis', 'viridisLite', 'withr', 'XML', 'xml2', 'yaml', 'zoo',
##   'ztable'
library("hthgu133a.db")
## Loading required package: AnnotationDbi
## Loading required package: stats4
## Loading required package: IRanges
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:base':
## 
##     colMeans, colSums, expand.grid, rowMeans, rowSums
## Loading required package: org.Hs.eg.db
## 
## Warning in rsqlite_fetch(res@ptr, n = n): Don't need to call dbFetch() for
## statements, only for queries
## 
match_data = as.list(hthgu133aALIAS2PROBE)
match_data = match_data[!is.na(match_data)]
head(match_data)
## $A1B
## [1] "208608_s_at" "214708_at"   "215431_at"  
## 
## $A2MD
## [1] "217757_at"
## 
## $CPAMD5
## [1] "217757_at"
## 
## $FWP007
## [1] "217757_at"
## 
## $`S863-7`
## [1] "217757_at"
## 
## $A2M
## [1] "217757_at"
length(match_data)
## [1] 47013
names(match_data)[1]
## [1] "A1B"
names(match_data)[2]
## [1] "A2MD"
match_data[[1]]
## [1] "208608_s_at" "214708_at"   "215431_at"
omat = do.call(rbind, lapply(1:length(match_data), function(i) if (length(match_data[[i]]) != 1) {cbind(names(match_data)[1], match_data[[i]] ) } else { c(names(match_data)[i], match_data[[i]])}))

head(omat)
##      [,1]     [,2]         
## [1,] "A1B"    "208608_s_at"
## [2,] "A1B"    "214708_at"  
## [3,] "A1B"    "215431_at"  
## [4,] "A2MD"   "217757_at"  
## [5,] "CPAMD5" "217757_at"  
## [6,] "FWP007" "217757_at"
reference