| 10 | 1 options("download.file.method.GEOquery"="wget") | 
|  | 2 options(warn = -1) | 
|  | 3 | 
|  | 4 args <- commandArgs(trailingOnly = TRUE) | 
|  | 5 GSMTable = args[1] | 
|  | 6 protocol = args[2] | 
|  | 7 platform = args[3] | 
|  | 8 Data_Table = args[4] | 
|  | 9 | 
|  | 10 TAB = fread(GSMTable) | 
|  | 11 | 
|  | 12 if (is.null(TAB)) { | 
|  | 13   stop("Must specify input files") | 
|  | 14 } else { | 
|  | 15   GEODataTable <- getGEO(TAB$ID[1], getGPL = FALSE) | 
|  | 16   IlmnIDTable <- Table(GEODataTable) | 
|  | 17   MetaData <- data.frame(Meta(GEODataTable)) | 
|  | 18 | 
|  | 19 | 
|  | 20   write.table(MetaData, protocol, row.names = FALSE, sep = "\t") | 
|  | 21 } | 
|  | 22 | 
|  | 23 hm450.hg19 <- getPlatform() | 
|  | 24 | 
|  | 25 IlmnInfo <- | 
|  | 26   data.table( | 
|  | 27     IlmnID = names(hm450.hg19), | 
|  | 28     CHR = as.data.frame(hm450.hg19@seqnames)$value, | 
|  | 29     BP = as.numeric(hm450.hg19@elementMetadata$probeStart) | 
|  | 30   ) | 
|  | 31 | 
|  | 32 | 
|  | 33 write.table(IlmnInfo, platform, row.names = FALSE, sep = "\t") | 
|  | 34 | 
|  | 35 | 
|  | 36 if (length(TAB$ID) > 1) { | 
|  | 37   mysamples <- | 
|  | 38     do.call("data.table", lapply(TAB$ID[-1], function(x) | 
|  | 39       Table(getGEO(x, getGPL = FALSE))[, -1])) | 
|  | 40 | 
|  | 41   gmSet <- data.table(IlmnIDTable[, -1], mysamples) | 
|  | 42 | 
|  | 43 } else { | 
|  | 44   gmSet <- Table(getGEO(TAB$ID, getGPL = FALSE)) | 
|  | 45 } | 
|  | 46 | 
|  | 47 write.table(gmSet, Data_Table, row.names = FALSE,quote=FALSE,sep="\t") | 
|  | 48 |