8
|
1 require("rentrez", quietly = TRUE)
|
|
2
|
|
3 args <- commandArgs(trailingOnly = TRUE)
|
|
4 GSE = args[1]
|
|
5 GSMTable = args[2]
|
|
6
|
|
7 search1 <- entrez_search(db = "gds", term = GSE, retmax = 1)
|
|
8
|
|
9 rec2 <- entrez_summary(db = "gds",
|
|
10 id = search1$ids,
|
|
11 version = "2.0")
|
|
12
|
|
13 extract <- extract_from_esummary(rec2,rownames(summary(rec2)))
|
|
14
|
|
15 samples <- extract$samples
|
|
16 colnames(samples)[which(names(samples) == "accession")] <- "ID"
|
|
17 colnames(samples)[which(names(samples) == "title")] <- "Phenotype"
|
|
18
|
|
19 write.table(samples, GSMTable, row.names = FALSE, sep = "\t",quote = FALSE)
|
|
20
|