Mercurial > repos > testtool > get_gsm
diff getGSMdata/getGSMdata.R @ 8:5e1d49abfc99 draft
Uploaded
author | testtool |
---|---|
date | Mon, 06 Feb 2017 05:17:56 -0500 |
parents | |
children | ac5415190777 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/getGSMdata/getGSMdata.R Mon Feb 06 05:17:56 2017 -0500 @@ -0,0 +1,20 @@ +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" + +write.table(samples, GSMTable, row.names = FALSE, sep = "\t",quote = FALSE) +