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