annotate getMETAdata/getMETAdata.R @ 71:81b5c08c21e1 draft

Uploaded
author testtool
date Mon, 14 Aug 2017 09:44:57 -0400
parents
children cb14dbc2fd60
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
71
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
1 require("data.table", quietly = TRUE)
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
2 require("GEOquery", quietly = TRUE)
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
3
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
4
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
5 options(warn = -1)
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
6 options("download.file.method"="wget")
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
7 args <- commandArgs(trailingOnly = TRUE)
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
8 GSMTable = args[1]
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
9 MetaTable = args[2]
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
10
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
11 TAB = fread(GSMTable)
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
12
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
13
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
14 if (is.null(TAB)) {
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
15 stop("Must specify input files")
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
16 } else {
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
17 options(download.file.method.GEOquery = "wget")
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
18
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
19
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
20 GEODataTable <- getGEO(TAB$ID[1], getGPL = FALSE)
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
21 MetaData <- data.frame(Meta(GEODataTable))
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
22
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
23 write.table(MetaData, MetaTable, row.names = FALSE, sep = "\t")
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
24 }
81b5c08c21e1 Uploaded
testtool
parents:
diff changeset
25