Setting genome information on a TxDb object
1
0
Entering edit mode
Diego Diez ▴ 760
@diego-diez-4520
Last seen 20 months ago
Japan

I am generating a TxDb object using a GFF file from Plasmodb (e.g. http://plasmodb.org/common/downloads/release-24/PbergheiANKA/gff/data/PlasmoDB-24_PbergheiANKA.gff). The object is generated correctly. However if I try to set the genome information I get the following error message:

> genome(txdb) <- "PbergheiANKA"
Error in .seqinfo.TxDbReplace(x, new2old = new2old, force = force, value) : 
  'new2old' must be specified when replacing the 'seqinfo' of a TxDb object

> genome(txdb)
PBANKA_API PBANKA_MIT     berg01     berg02     berg03     berg04     berg05     berg06 
        NA         NA         NA         NA         NA         NA         NA         NA 
    berg07     berg08     berg09     berg10     berg11     berg12     berg13     berg14 
        NA         NA         NA         NA         NA         NA         NA         NA 
  berg_bin 
        NA 

> seqlevels(txdb)
 [1] "PBANKA_API" "PBANKA_MIT" "berg01"     "berg02"     "berg03"     "berg04"     "berg05"    
 [8] "berg06"     "berg07"     "berg08"     "berg09"     "berg10"     "berg11"     "berg12"    
[15] "berg13"     "berg14"     "berg_bin"  

It is unclear to me how should I use new2old here. How can I accomplish this?

> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
 [1] grid      stats4    parallel  graphics  grDevices utils     datasets  stats     methods  
[10] base     

other attached packages:
 [1] BSgenome_1.36.0        rtracklayer_1.28.2     GenomicFeatures_1.20.1 AnnotationDbi_1.30.1  
 [5] GenomicRanges_1.20.3   GenomeInfoDb_1.4.0     gtable_0.1.2           motifTools_0.13.0     
 [9] knitr_1.10.5           ape_3.2                ggtree_1.0.7           Biostrings_2.36.1     
[13] XVector_0.8.0          IRanges_2.2.1          S4Vectors_0.6.0        Biobase_2.28.0        
[17] BiocGenerics_0.14.0    XML_3.98-1.1           fortunes_1.5-2         dplyr_0.4.1           
[21] tidyr_0.2.0            reshape2_1.4.1         ggplot2_1.0.1          lattice_0.20-31       
[25] devtools_1.8.0        

loaded via a namespace (and not attached):
 [1] locfit_1.5-9.1          colorspace_1.2-6        DBI_0.3.1              
 [4] BiocParallel_1.2.1      EBImage_4.10.0          lambda.r_1.1.7         
 [7] jpeg_0.1-8              plyr_1.8.2              stringr_1.0.0          
[10] zlibbioc_1.14.0         futile.logger_1.4.1     munsell_0.4.2          
[13] labeling_0.3            biomaRt_2.24.0          BiocInstaller_1.18.2   
[16] proto_0.3-10            Rcpp_0.11.6             scales_0.2.4           
[19] jsonlite_0.9.16         abind_1.4-3             Rsamtools_1.20.1       
[22] gridExtra_0.9.1         png_0.1-7               digest_0.6.8           
[25] stringi_0.4-1           tiff_0.1-5              tools_3.2.0            
[28] bitops_1.0-6            magrittr_1.5            lazyeval_0.1.10        
[31] RCurl_1.95-4.6          RSQLite_1.0.0           futile.options_1.0.0   
[34] MASS_7.3-40             assertthat_0.1          rstudioapi_0.3.1       
[37] fftwtools_0.9-7         rstudio_0.98.1103       GenomicAlignments_1.4.1
[40] nlme_3.1-120
genomicfeatures txdb • 1.0k views
ADD COMMENT
2
Entering edit mode
@herve-pages-1542
Last seen 7 hours ago
Seattle, WA, United States

Hi Diego,

Even though the error message you got suggests otherwise, it's not possible at the moment to modify the genome of a TxDb object a posteriori. So we will modify this error message to make this clear.

Another problem is that the interface of the makeTxDbFromGFF() function (I presume that's what you used) doesn't let the user specify the genome either. Something else we need to address.

Here is a workaround you can use for the moment:

library(rtracklayer)
gr <- import("http://plasmodb.org/common/downloads/release-24/PbergheiANKA/gff/data/PlasmoDB-24_PbergheiANKA.gff")
genome(gr) <- "PbergheiANKA"

library(GenomicFeatures)
txdb <- makeTxDbFromGRanges(gr)

txdb
# TxDb object:
# Db type: TxDb
# Supporting package: GenomicFeatures
# Genome: PbergheiANKA
# transcript_nrow: 5164
# exon_nrow: 13533
# cds_nrow: 13389
# Db created by: GenomicFeatures package from Bioconductor
# Creation time: 2015-05-18 10:20:51 -0700 (Mon, 18 May 2015)
# GenomicFeatures version at creation time: 1.20.1
# RSQLite version at creation time: 1.0.0
# DBSCHEMAVERSION: 1.1

seqinfo(txdb)
# Seqinfo object with 17 sequences from PbergheiANKA genome; no seqlengths:
#   seqnames   seqlengths isCircular       genome
#   PBANKA_API       <NA>       <NA> PbergheiANKA
#   PBANKA_MIT       <NA>       <NA> PbergheiANKA
#   berg01           <NA>       <NA> PbergheiANKA
#   berg02           <NA>       <NA> PbergheiANKA
#   berg03           <NA>       <NA> PbergheiANKA
#   ...               ...        ...          ...
#   berg11           <NA>       <NA> PbergheiANKA
#   berg12           <NA>       <NA> PbergheiANKA
#   berg13           <NA>       <NA> PbergheiANKA
#   berg14           <NA>       <NA> PbergheiANKA
#   berg_bin         <NA>       <NA> PbergheiANKA

Hope this helps,

H.

ADD COMMENT
0
Entering edit mode

Hi Herve, thanks. This works perfectly.

ADD REPLY

Login before adding your answer.

Traffic: 171 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6