Importing from to tRNAdb and mitotRNAdb as GRanges
Author: Felix G.M. Ernst
Date: 2026-05-18

# Importing from to tRNAdb and mitotRNAdb as `GRanges`

Felix G.M. Ernst

#### 2026-05-18

#### Package

tRNAdbImport 1.31.0

# 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.

## 1.1 Status 2024

The tRNAdb Server is currently not available. Some chunks of the code in this vignette are currently not avilable. See https://www.bioinf.uni-leipzig.de/services/webservices for more information.

# 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"))

    ## Warning: tRNAdb Server seems to be not available.

    # get a Phenylalanine tRNA from yeast
    gr <- import.tRNAdb.id(tdbID = gr[gr$tRNA_type == "Phe",][1L]$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")

    ## Warning: tRNAdb Server seems to be not available.

    # get one mitochrondrial tRNA in Bos taurus.
    gr <- import.mttRNAdb.id(mtdbID = gr[1L]$tRNAdb_ID)

    # check that the result has the appropriate columns
    istRNAdbGRanges(gr)

    ## Warning: Input GRanges object does not meet the requirements of the function. The following columns are expected:
    ## 'tRNA_length', 'tRNA_type', 'tRNA_anticodon', 'tRNA_seq', 'tRNA_str', 'tRNA_CCA.end', 'tRNAdb_ID', 'tRNAdb', 'tRNAdb_organism', 'tRNAdb_strain', 'tRNAdb_taxonomyID', 'tRNAdb_verified'.

    ## [1] FALSE

# 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

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)

# 4 Further analysis

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

    library(Biostrings)
    library(rtracklayer)
    # saving the tRAN sequences as fasta file
    writeXStringSet(gr$tRNA_seq, filepath = tempfile())
    # converting tRNAdb information to GFF compatible values
    gff <- tRNAdb2GFF(gr)
    gff
    # Saving the information as gff3 file
    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 4.6.0 Patched (2026-05-01 r89994)
    ## Platform: aarch64-apple-darwin23
    ## Running under: macOS Tahoe 26.3.1
    ##
    ## Matrix products: default
    ## BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
    ## LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
    ##
    ## locale:
    ## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    ##
    ## time zone: America/New_York
    ## tzcode source: internal
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ##  [1] rtracklayer_1.73.0   tRNAdbImport_1.31.0  tRNA_1.31.0
    ##  [4] Structstrings_1.29.0 Modstrings_1.29.0    Biostrings_2.81.1
    ##  [7] XVector_0.53.0       GenomicRanges_1.65.0 Seqinfo_1.3.0
    ## [10] IRanges_2.47.1       S4Vectors_0.51.2     BiocGenerics_0.59.2
    ## [13] generics_0.1.4       BiocStyle_2.41.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] SummarizedExperiment_1.43.0 gtable_0.3.6
    ##  [3] rjson_0.2.23                xfun_0.57
    ##  [5] bslib_0.11.0                ggplot2_4.0.3
    ##  [7] httr2_1.2.2                 lattice_0.22-9
    ##  [9] Biobase_2.73.1              vctrs_0.7.3
    ## [11] tools_4.6.0                 bitops_1.0-9
    ## [13] curl_7.1.0                  parallel_4.6.0
    ## [15] tibble_3.3.1                pkgconfig_2.0.3
    ## [17] BiocBaseUtils_1.15.1        Matrix_1.7-5
    ## [19] RColorBrewer_1.1-3          cigarillo_1.3.0
    ## [21] S7_0.2.2                    lifecycle_1.0.5
    ## [23] compiler_4.6.0              farver_2.1.2
    ## [25] stringr_1.6.0               Rsamtools_2.29.0
    ## [27] codetools_0.2-20            htmltools_0.5.9
    ## [29] sass_0.4.10                 RCurl_1.98-1.18
    ## [31] yaml_2.3.12                 pillar_1.11.1
    ## [33] crayon_1.5.3                jquerylib_0.1.4
    ## [35] BiocParallel_1.47.0         DelayedArray_0.39.2
    ## [37] cachem_1.1.0                abind_1.4-8
    ## [39] tidyselect_1.2.1            digest_0.6.39
    ## [41] stringi_1.8.7               dplyr_1.2.1
    ## [43] restfulr_0.0.16             bookdown_0.46
    ## [45] fastmap_1.2.0               grid_4.6.0
    ## [47] SparseArray_1.13.2          cli_3.6.6
    ## [49] magrittr_2.0.5              S4Arrays_1.13.0
    ## [51] dichromat_2.0-0.1           XML_3.99-0.23
    ## [53] scales_1.4.0                rappdirs_0.3.4
    ## [55] rmarkdown_2.31              httr_1.4.8
    ## [57] matrixStats_1.5.0           otel_0.2.0
    ## [59] evaluate_1.0.5              knitr_1.51
    ## [61] BiocIO_1.23.3               rlang_1.2.0
    ## [63] glue_1.8.1                  BiocManager_1.30.27
    ## [65] xml2_1.5.2                  jsonlite_2.0.0
    ## [67] R6_2.6.1                    MatrixGenerics_1.25.0
    ## [69] GenomicAlignments_1.49.0

# 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 (suppl_1): D159–62. 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 (suppl_1): D139–40. https://doi.org/10.1093/nar/gki012.