annotate getMETAdata/getMETAdata.R @ 38:608ab56a90d0 draft

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