Skip to content

Instantly share code, notes, and snippets.

@neilfws
Created January 8, 2010 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilfws/271861 to your computer and use it in GitHub Desktop.
Save neilfws/271861 to your computer and use it in GitHub Desktop.
# install GEOmetadb
source("http://bioconductor.org/biocLite.R")
biocLite("GEOmetadb")
library(GEOmetadb)
# connect to database
getSQLiteFile()
con <- dbConnect(SQLite(), "GEOmetadb.sqlite")
# count samples per GDS
gds.count <- dbGetQuery(con, "select gds,sample_count from gds")
gds.count[1:5,]
# first 5 results
gds sample_count
1 GDS5 5
2 GDS6 29
3 GDS10 28
4 GDS12 8
5 GDS15 6
# count samples per GSE
gse <- dbGetQuery(con, "select series_id from gsm")
gse.count <- as.data.frame(table(gse$series_id))
gse.count[1:10,]
# first 10 results
Var1 Freq
1 GSE1 38
2 GSE10 4
3 GSE100 4
4 GSE10000 29
5 GSE10001 12
6 GSE10002 8
7 GSE10003 4
8 GSE10004,GSE10114 3
9 GSE10005 48
10 GSE10006 75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment