annotate getGSMdata/getGSMdata.R @ 32:0051ff360c64 draft

Uploaded
author testtool
date Mon, 31 Jul 2017 11:49:16 -0400
parents ac5415190777
children ca4d7b65a2da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
1 args <- commandArgs(trailingOnly = TRUE)
26
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
2
8
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
3 GSE = args[1]
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
4 GSMTable = args[2]
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
5
26
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
6
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
7
8
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
8 search1 <- entrez_search(db = "gds", term = GSE, retmax = 1)
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
9
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
10 rec2 <- entrez_summary(db = "gds",
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
11 id = search1$ids,
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
12 version = "2.0")
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
13
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
14 extract <- extract_from_esummary(rec2,rownames(summary(rec2)))
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
15
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
16 samples <- extract$samples
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
17 colnames(samples)[which(names(samples) == "accession")] <- "ID"
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
18 colnames(samples)[which(names(samples) == "title")] <- "Phenotype"
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
19
26
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
20 samples$Phenotype<-gsub("\\s", "",samples$Phenotype)
8
5e1d49abfc99 Uploaded
testtool
parents:
diff changeset
21
26
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
22 write.table(samples, GSMTable, row.names = FALSE,quote=FALSE,sep="\t")
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
23
ac5415190777 Uploaded
testtool
parents: 8
diff changeset
24