Learn R Programming

refGenome (version 1.7.7)

saveGenome: Saving and loading refGenome objects

Description

refGenome objects contain all annotation data inside an environment. During saving and loading, the whole content of the environment is loaded and saved. The correct object type is also determined in this way.

Usage

saveGenome(object,filename,useBasedir=TRUE,...)

Arguments

object

refGenome (or derived)

filename

Character. Filename of the R-data-file wich is written.

useBasedir

Logical. When TRUE the output file is written into basedir. Otherwise the directory depicted by dirname(filename) is used.

...

(unused)

Examples

Run this code
# NOT RUN {
##-------------------------------------##
## A) Ensembl genome
##-------------------------------------##
ensfile <- system.file("extdata", "hs.ensembl.62.small.RData", package="refGenome")
ens <- loadGenome(ensfile)
# }
# NOT RUN {
saveGenome(ens, "ens.RData", useBasedir=FALSE)
# }
# NOT RUN {
## B) Ensembl junctions
junc <- getSpliceTable(ens)
# }
# NOT RUN {
saveGenome(junc, "junc.RData", useBasedir=FALSE)
loadGenome("junc.RData")
# }
# NOT RUN {
##-------------------------------------##
## C) Ensembl exons
##-------------------------------------##
enex <- refExons(ens)
# }
# NOT RUN {
saveGenome(enex, "enex.RData", useBasedir=FALSE)
er <- loadGenome("enex.RData")
# }
# NOT RUN {
##-------------------------------------##
## D) UCSC genome:
##-------------------------------------##
ucfile <- system.file("extdata", "hs.ucsc.small.RData", package="refGenome")
uc <- loadGenome(ucfile)
# }
# NOT RUN {
saveGenome(uc, "uc.RData", useBasedir=FALSE)
# }
# NOT RUN {
##-------------------------------------##
## E) UCSC junctions
##-------------------------------------##
junc <-getSpliceTable(uc)
# }
# NOT RUN {
saveGenome(junc, "junc.RData", useBasedir=FALSE)
jr <- loadGenome("junc.RData")
# }
# NOT RUN {
##-------------------------------------##
## F) UCSC exons
##-------------------------------------##
ucex <- refExons(uc)
# }
# NOT RUN {
saveGenome(ucex, "ucex.RData", useBasedir=FALSE)
ur <- loadGenome("ucex.RData")
# }

Run the code above in your browser using DataLab