1 Introduction

The tRNAdb and mttRNAdb (Jühling et al. 2009) is a compilation of tRNA sequences and tRNA genes. It is a follow up version of the database of Sprinzl et al. (Sprinzl and Vassilenko 2005).

Using tRNAdbImport the tRNAdb can be accessed as outlined on the website http://trna.bioinf.uni-leipzig.de/ and the results are returned as a GRanges object.

2 Importing as GRanges

library(tRNAdbImport)
# accessing tRNAdb
# tRNA from yeast for Alanine and Phenylalanine
gr <- import.tRNAdb(organism = "Saccharomyces cerevisiae",
                    aminoacids = c("Phe","Ala"))
# get a Phenylalanine tRNA from yeast
gr <- import.tRNAdb.id(tdbID = gr[gr$tRNA_type == "Phe",][1]$tRNAdb_ID)
# find the same tRNA via blast
gr <- import.tRNAdb.blast(blastSeq = gr$tRNA_seq)
# accessing mtRNAdb
# get the mitochrondrial tRNA for Alanine in Bos taurus
gr <- import.mttRNAdb(organism = "Bos taurus", 
                      aminoacids = "Ala")
# get one mitochrondrial tRNA in Bos taurus. 
gr <- import.mttRNAdb.id(mtdbID = gr[1]$tRNAdb_ID)
# check that the result has the appropriate columns
istRNAdbGRanges(gr)
## [1] TRUE

3 Importing as GRanges from the RNA database

The tRNAdb offers two different sets of data, one containing DNA sequences and one containing RNA sequences. Depending on the database selected, DNA as default, the GRanges will contain a DNAStringSet or a ModRNAStringSet as the tRNA_seq column. Because the RNA sequences can contain modified nucleotides, the ModRNAStringSet class is used instead of the RNAStringSet class to store the sequences correctly with all information intact.

gr <- import.tRNAdb(organism = "Saccharomyces cerevisiae",
                    aminoacids = c("Phe","Ala"),
                    database = "RNA")
gr$tRNA_seq
##   A ModRNAStringSet instance of length 3
##     width seq
## [1]    76 GGGCGUGUKGCGUAGDCGGDAGCGCRCUCCCU...GGDCUCCGGTPCGAUUCCGGACUCGUCCACCA
## [2]    76 GCGGAUUUALCUCAGDDGGGAGAGCRCCAGAB...G7UC°UGUGTPCG"UCCACAGAAUUCGCACCA
## [3]    76 GCGGACUUALCUCAGDDGGGAGAGCRCCAGAB...G7UC°UGUGTPCG"UCCACAGAGUUCGCACCA

The special characters in the sequence might no exactly match the ones shown on the website, since they are sanitized internally to a unified dictionary defined in the Modstrings package. However, the type of modification encoded will remain the same (See the Modstrings package for more details).

The information on the position and type of the modifications can also be converted into a tabular format using the separate function from the Modstrings package.

separate(gr$tRNA_seq)
## GRanges object with 38 ranges and 1 metadata column:
##        seqnames    ranges strand |         mod
##           <Rle> <IRanges>  <Rle> | <character>
##    [1]        2        10      + |         m2G
##    [2]        2        16      + |           D
##    [3]        2        17      + |           D
##    [4]        2        26      + |       m2,2G
##    [5]        2        32      + |          Cm
##    ...      ...       ...    ... .         ...
##   [34]        1        37      + |         m1I
##   [35]        1        38      + |           Y
##   [36]        1        47      + |           D
##   [37]        1        54      + |         m5U
##   [38]        1        55      + |           Y
##   -------
##   seqinfo: 3 sequences from an unspecified genome; no seqlengths

4 Further analysis

The output can be saved or directly used for further analysis.

library(Biostrings)
library(rtracklayer)
writeXStringSet(gr$tRNA_seq, filepath = tempfile())
gff <- tRNAdb2GFF(gr)
export.gff3(gff, con = tempfile())

Please have a look at the tRNA package for further analysis of the tRNA sequences.

5 Session info

sessionInfo()
## R version 3.6.0 (2019-04-26)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.2 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.9-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.9-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] rtracklayer_1.44.0   tRNAdbImport_1.2.2   tRNA_1.2.2          
##  [4] Structstrings_1.0.3  Modstrings_1.0.2     Biostrings_2.52.0   
##  [7] XVector_0.24.0       GenomicRanges_1.36.0 GenomeInfoDb_1.20.0 
## [10] IRanges_2.18.1       S4Vectors_0.22.0     BiocGenerics_0.30.0 
## [13] BiocStyle_2.12.0    
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.1                  lattice_0.20-38            
##  [3] Rsamtools_2.0.0             assertive.properties_0.0-4 
##  [5] assertive.types_0.0-3       assertive.data.us_0.0-2    
##  [7] assertthat_0.2.1            digest_0.6.19              
##  [9] R6_2.4.0                    plyr_1.8.4                 
## [11] evaluate_0.14               assertive.code_0.0-3       
## [13] httr_1.4.0                  ggplot2_3.1.1              
## [15] pillar_1.4.1                assertive.strings_0.0-3    
## [17] zlibbioc_1.30.0             rlang_0.3.4                
## [19] lazyeval_0.2.2              curl_3.3                   
## [21] Matrix_1.2-17               assertive_0.3-5            
## [23] assertive.data_0.0-3        rmarkdown_1.13             
## [25] BiocParallel_1.18.0         stringr_1.4.0              
## [27] RCurl_1.95-4.12             munsell_0.5.0              
## [29] DelayedArray_0.10.0         compiler_3.6.0             
## [31] xfun_0.7                    pkgconfig_2.0.2            
## [33] htmltools_0.3.6             SummarizedExperiment_1.14.0
## [35] tidyselect_0.2.5            tibble_2.1.3               
## [37] GenomeInfoDbData_1.2.1      bookdown_0.11              
## [39] matrixStats_0.54.0          assertive.sets_0.0-3       
## [41] codetools_0.2-16            XML_3.98-1.20              
## [43] crayon_1.3.4                dplyr_0.8.1                
## [45] GenomicAlignments_1.20.0    bitops_1.0-6               
## [47] grid_3.6.0                  assertive.base_0.0-7       
## [49] gtable_0.3.0                magrittr_1.5               
## [51] assertive.models_0.0-2      scales_1.0.0               
## [53] stringi_1.4.3               assertive.matrices_0.0-2   
## [55] xml2_1.2.0                  assertive.reflection_0.0-4 
## [57] assertive.datetimes_0.0-2   tools_3.6.0                
## [59] Biobase_2.44.0              glue_1.3.1                 
## [61] purrr_0.3.2                 assertive.numbers_0.0-2    
## [63] yaml_2.2.0                  colorspace_1.4-1           
## [65] BiocManager_1.30.4          assertive.files_0.0-2      
## [67] assertive.data.uk_0.0-2     knitr_1.23

References

Jühling, Frank, Mario Mörl, Roland K. Hartmann, Mathias Sprinzl, Peter F. Stadler, and Joern Pütz. 2009. “TRNAdb 2009: Compilation of tRNA Sequences and tRNA Genes.” Nucleic Acids Research 37:D159–D162. https://doi.org/10.1093/nar/gkn772.

Sprinzl, Mathias, and Konstantin S. Vassilenko. 2005. “Compilation of tRNA Sequences and Sequences of tRNA Genes.” Nucleic Acids Research 33:D139–D140. https://doi.org/10.1093/nar/gki012.