Search
Question: Saving/loading TxDb objects
1
gravatar for James W. MacDonald
2.5 years ago by
United States
James W. MacDonald45k wrote:

What is the recommended method for saving/loading a TxDb object?

> example(makeTxDb)

mkTxDb> transcripts <- data.frame(
mkTxDb+                    tx_id=1:3,
mkTxDb+                    tx_chrom="chr1",
mkTxDb+                    tx_strand=c("-", "+", "+"),
mkTxDb+                    tx_start=c(1, 2001, 2001),
mkTxDb+                    tx_end=c(999, 2199, 2199))

mkTxDb> splicings <-  data.frame(
mkTxDb+                    tx_id=c(1L, 2L, 2L, 2L, 3L, 3L),
mkTxDb+                    exon_rank=c(1, 1, 2, 3, 1, 2),
mkTxDb+                    exon_start=c(1, 2001, 2101, 2131, 2001, 2131),
mkTxDb+                    exon_end=c(999, 2085, 2144, 2199, 2085, 2199),
mkTxDb+                    cds_start=c(1, 2022, 2101, 2131, NA, NA),
mkTxDb+                    cds_end=c(999, 2085, 2144, 2193, NA, NA))

mkTxDb> txdb <- makeTxDb(transcripts, splicings)
Warning message:
In .normarg_makeTxDb_chrominfo(chrominfo, transcripts$tx_chrom,  :
  chromosome lengths and circularity flags are not available for this TxDb object

> txdb
TxDb object:
# Db type: TxDb
# Supporting package: GenomicFeatures
# transcript_nrow: 3
# exon_nrow: 4
# cds_nrow: 4
# Db created by: GenomicFeatures package from Bioconductor
# Creation time: 2015-06-09 07:13:11 -0700 (Tue, 09 Jun 2015)
# GenomicFeatures version at creation time: 1.20.1
# RSQLite version at creation time: 1.0.0
# DBSCHEMAVERSION: 1.1


> save(txdb, file = "tmp.Rdata")
> rm(txdb)
> load("tmp.Rdata")
> txdb
TxDb object:
Error in sqliteSendQuery(con, statement, bind.data) :
  expired SQLiteConnection

 

ADD COMMENTlink modified 2.5 years ago by Martin Morgan ♦♦ 21k • written 2.5 years ago by James W. MacDonald45k
2
gravatar for Martin Morgan
2.5 years ago by
Martin Morgan ♦♦ 21k
United States
Martin Morgan ♦♦ 21k wrote:

saveDb() / loadDb() in AnnotationDbi.

ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by Martin Morgan ♦♦ 21k

Nice! Thanks Martin.

ADD REPLYlink written 2.5 years ago by James W. MacDonald45k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 329 users visited in the last hour