annotate getMETAdata/getMETAdata.R @ 73:63f1a36323dc draft default tip

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