# HG changeset patch # User testtool # Date 1501519078 14400 # Node ID 31fe37b308367066a86d9511a089de0810ad9e1b # Parent faa0cd8ed36a7338ac8c0113b1b2e23c9faed823 Uploaded diff -r faa0cd8ed36a -r 31fe37b30836 getGSMdata/test-data/getGSMdata.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/getGSMdata/test-data/getGSMdata.R Mon Jul 31 12:37:58 2017 -0400 @@ -0,0 +1,26 @@ +require("rentrez", quietly = TRUE) + +args <- commandArgs(trailingOnly = TRUE) + +GSE = args[1] +GSMTable = args[2] + + + +search1 <- entrez_search(db = "gds", term = GSE, retmax = 1) + +rec2 <- entrez_summary(db = "gds", + id = search1$ids, + version = "2.0") + +extract <- extract_from_esummary(rec2,rownames(summary(rec2))) + +samples <- extract$samples +colnames(samples)[which(names(samples) == "accession")] <- "ID" +colnames(samples)[which(names(samples) == "title")] <- "Phenotype" + +samples$Phenotype<-gsub("\\s", "",samples$Phenotype) + +write.table(samples, GSMTable, row.names = FALSE,quote=FALSE,sep="\t") + +