comparison getGSMdata/test-data/getGSMdata.R @ 35:31fe37b30836 draft

Uploaded
author testtool
date Mon, 31 Jul 2017 12:37:58 -0400
parents
children
comparison
equal deleted inserted replaced
34:faa0cd8ed36a 35:31fe37b30836
1 require("rentrez", quietly = TRUE)
2
3 args <- commandArgs(trailingOnly = TRUE)
4
5 GSE = args[1]
6 GSMTable = args[2]
7
8
9
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
22 samples$Phenotype<-gsub("\\s", "",samples$Phenotype)
23
24 write.table(samples, GSMTable, row.names = FALSE,quote=FALSE,sep="\t")
25
26