Mercurial > repos > testtool > get_gsm
comparison getGSMdata/getGSMdata.R @ 8:5e1d49abfc99 draft
Uploaded
author | testtool |
---|---|
date | Mon, 06 Feb 2017 05:17:56 -0500 |
parents | |
children | ac5415190777 |
comparison
equal
deleted
inserted
replaced
7:3eb1073638d7 | 8:5e1d49abfc99 |
---|---|
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 |