## Not run:
# ## In this example, we construct a database from
# ## samples stored in NCBI GEO on the GPL1261 platform.
# ## The output would then be used as the database
# ## to input into the ChIPXpress function.
#
# ## Load required libraries
# library(bigmemory)
# library(biganalytics)
# library(GEOquery)
# library(affy)
# library(frma)
#
# library(mouse4302frmavecs)
# ## GPL1261 corresponds to the mouse430 2.0 array (required by frma)
# ## If your database is from a different platform, you will
# ## need to download the corresponding frmavecs package.
#
# SaveDir <- tempdir()
# ## Make sure the save directory is empty and created.
#
# DB <- buildDatabase(GPL_id='GPL1261',SaveDir=SaveDir)
# ## This will take up to 2 weeks to finish since
# ## it processes all GPL1261 samples currently
# ## stored in NCBI GEO (over 29000 samples).
#
# ## Alternatively, the user can also specify by GSM ids.
# GSM_ids <- c("GSM24056","GSM24058","GSM24060","GSM24061",
# "GSM94856","GSM94857","GSM94858","GSM94859")
# DB <- buildDatabase(GSMfiles=GSM_ids,SaveDir=SaveDir)
# ## This will only take approximately 5 minutes
# ## since only 8 GPL1261 samples are specified.
# ## Note, the database will need to include at least
# ## 2 samples in which the TF is above the mean TF expression
# ## to calculate a correlation estimate as required by the
# ## ChIPXpress algorithm. The more samples the better!!
#
# ## Annotates database by converting rowIDs from probeIDs into
# ## Entrez GeneIDs. Feel free to use any annotation method
# ## that is most convenient.
# library(mouse4302.db)
# EntrezID <- mget(as.character(rownames(DB)),mouse4302ENTREZID)
# rownames(DB) <- as.character(EntrezID)
#
# ## Clean Database - cleans database into format required by ChIPXpress
# cleanDB <- cleanDatabase(DB,SaveFile="newDB_GPL1261.bigmemory",
# SavePath=SaveDir)
#
# head(cleanDB) ## Final database ready for direct input into ChIPXpress
#
# ## To load the saved database in new R sessions, simply attach using
# ## the saved description file of the big.matrix as follows:
# cleanDB <- attach.big.matrix("newDB_GPL1261.bigmemory.desc",path=SaveDir)
# head(cleanDB)
#
# ## End(Not run)
Run the code above in your browser using DataLab