# EpiTxDb: creating an EpiTxDb object

# Introduction

To create an `EpiTxDb` object a number of different functions are available. The most univeral functions are `makeEpiTxDb` and `makeEpiTxDbFromGRanges`. `makeEpiTxDb` uses four `data.frame`s as input, whereas `makeEpiTxDbFromGRanges` is a wrapper for information available as a `GRanges` object.

The other functions are `makeEpiTxDbFromRMBase` and `makeEpiTxDbFromtRNAdb`, which are aimed to make data available from the RMBase v2.0 database (Xuan et al. 2017; Sun et al. 2015) or the tRNAdb (Jühling et al. 2009; Sprinzl and Vassilenko 2005). However, before creating your `EpiTxDb` objects, have a look at the already available resources for `H. sapiens`, `M. musculus` and `S. cerevisiae.`

Additional metadata can be provided as separate `data.frame` for all functions. The `data.frame` must have two columns `name` and `value`.

    library(GenomicRanges)
    library(EpiTxDb)

# `makeEpiTxDb` and `makeEpiTxDbFromGRanges`

The creation of an etdb object is quite easy starting with a `GRanges` object.

    gr <- GRanges(seqnames = "test",
                  ranges = IRanges::IRanges(1,1),
                  strand = "+",
                  DataFrame(mod_id = 1L,
                            mod_type = "Am",
                            mod_name = "Am_1"))
    etdb <- makeEpiTxDbFromGRanges(gr, metadata = data.frame(name = "test",
                                                             value = "Yes"))

    ## Creating EpiTxDb object ... done

    etdb

    ## EpiTxDb object:
    ## # Db type: EpiTxDb
    ## # Supporting package: EpiTxDb
    ## # test: Yes
    ## # Nb of modifications: 1
    ## # Db created by: EpiTxDb package from Bioconductor
    ## # Creation time: 2026-05-30 08:39:35 +0000 (Sat, 30 May 2026)
    ## # EpiTxDb version at creation time: 1.25.0
    ## # RSQLite version at creation time: 3.53.1
    ## # DBSCHEMAVERSION: 1.0

    metadata(etdb)

    ##                               name                                        value
    ## 1                          Db type                                      EpiTxDb
    ## 2               Supporting package                                      EpiTxDb
    ## 3                             test                                          Yes
    ## 4              Nb of modifications                                            1
    ## 5                    Db created by            EpiTxDb package from Bioconductor
    ## 6                    Creation time 2026-05-30 08:39:35 +0000 (Sat, 30 May 2026)
    ## 7 EpiTxDb version at creation time                                       1.25.0
    ## 8 RSQLite version at creation time                                       3.53.1
    ## 9                  DBSCHEMAVERSION                                          1.0

Additional data can be provided via the metadata columns of the `GRanges` object. For supported columns have a look at `?makeEpiTxDb` or `?makeEpiTxDbFromGRanges`.

# `makeEpiTxDbFromtRNAdb`

The information of the tRNAdb can be accessed via the `tRNAdbImport` package using the RNA database. As a result a `ModRNAStringSet` object is returned from which the modifications can be extracted using `separate()`.

The only input require is a valid organism name returned by `listAvailableOrganismsFromtRNAdb()`.

    # Currently not run since the server is not available
    etdb <- makeEpiTxDbFromtRNAdb("Saccharomyces cerevisiae")
    etdb

For additional information have a look at `?makeEpiTxDbFromtRNAdb`. The result returned from the tRNAdb is also available as `GRanges` object, if `gettRNAdbDataAsGRanges()` is used.

# `makeEpiTxDbFromRMBase`

Analogous to the example above `makeEpiTxDbFromRMBase()` will download the data from the RMBase v2.0. Three inputs are required, `organism`, `genome` and `modtype`, which have to valid bia the functions `listAvailableOrganismsFromRMBase()`, `.listAvailableGenomesFromRMBase()` and `listAvailableModFromRMBase`.

    etdb <- makeEpiTxDbFromRMBase(organism = "yeast",
                                  genome = "sacCer3",
                                  modtype = "m1A")

Internally, the files are cached using the `BiocFileCache` package and passed to `makeEpiTxDbFromRMBaseFiles()`, which can also be used with locally stored files. The resuls for creating the `EpiTxDb` class are processed from these files via the `getRMBaseDataAsGRanges()` function.

# Session info

    sessionInfo()

    ## R version 4.6.0 (2026-04-24)
    ## Platform: x86_64-pc-linux-gnu
    ## Running under: Ubuntu 24.04.4 LTS
    ##
    ## Matrix products: default
    ## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
    ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
    ##
    ## locale:
    ##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
    ##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
    ##  [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
    ##
    ## time zone: Etc/UTC
    ## tzcode source: system (glibc)
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ##  [1] EpiTxDb_1.25.0       Modstrings_1.29.0    Biostrings_2.81.2
    ##  [4] XVector_0.53.0       AnnotationDbi_1.75.0 Biobase_2.73.1
    ##  [7] GenomicRanges_1.65.0 Seqinfo_1.3.0        IRanges_2.47.2
    ## [10] S4Vectors_0.51.3     BiocGenerics_0.59.6  generics_0.1.4
    ## [13] BiocStyle_2.41.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] tRNAdbImport_1.31.0         tidyselect_1.2.1
    ##  [3] farver_2.1.2                dplyr_1.2.1
    ##  [5] blob_1.3.0                  S7_0.2.2
    ##  [7] filelock_1.0.3              bitops_1.0-9
    ##  [9] fastmap_1.2.0               RCurl_1.98-1.18
    ## [11] BiocFileCache_3.3.0         GenomicAlignments_1.49.0
    ## [13] rex_1.2.2                   XML_3.99-0.23
    ## [15] digest_0.6.39               lifecycle_1.0.5
    ## [17] KEGGREST_1.53.0             RSQLite_3.53.1
    ## [19] magrittr_2.0.5              compiler_4.6.0
    ## [21] progress_1.2.3              rlang_1.2.0
    ## [23] sass_0.4.10                 tools_4.6.0
    ## [25] yaml_2.3.12                 rtracklayer_1.73.0
    ## [27] knitr_1.51                  prettyunits_1.2.0
    ## [29] S4Arrays_1.13.0             bit_4.6.0
    ## [31] curl_7.1.0                  DelayedArray_0.39.3
    ## [33] xml2_1.5.2                  RColorBrewer_1.1-3
    ## [35] abind_1.4-8                 BiocParallel_1.47.0
    ## [37] txdbmaker_1.9.0             sys_3.4.3
    ## [39] grid_4.6.0                  ggplot2_4.0.3
    ## [41] scales_1.4.0                biomaRt_2.69.0
    ## [43] SummarizedExperiment_1.43.0 cli_3.6.6
    ## [45] rmarkdown_2.31              crayon_1.5.3
    ## [47] httr_1.4.8                  rjson_0.2.23
    ## [49] BiocBaseUtils_1.15.1        DBI_1.3.0
    ## [51] cachem_1.1.0                stringr_1.6.0
    ## [53] parallel_4.6.0              BiocManager_1.30.27
    ## [55] restfulr_0.0.16             matrixStats_1.5.0
    ## [57] vctrs_0.7.3                 Matrix_1.7-5
    ## [59] jsonlite_2.0.0              hms_1.1.4
    ## [61] bit64_4.8.2                 GenomicFeatures_1.65.0
    ## [63] maketools_1.3.2             jquerylib_0.1.4
    ## [65] glue_1.8.1                  codetools_0.2-20
    ## [67] gtable_0.3.6                stringi_1.8.7
    ## [69] GenomeInfoDb_1.49.1         BiocIO_1.23.3
    ## [71] UCSC.utils_1.9.0            tibble_3.3.1
    ## [73] pillar_1.11.1               rappdirs_0.3.4
    ## [75] htmltools_0.5.9             httr2_1.2.2
    ## [77] R6_2.6.1                    dbplyr_2.5.2
    ## [79] evaluate_1.0.5              lattice_0.22-9
    ## [81] png_0.1-9                   Rsamtools_2.29.0
    ## [83] cigarillo_1.3.0             memoise_2.0.1
    ## [85] bslib_0.11.0                Structstrings_1.29.0
    ## [87] tRNA_1.31.0                 SparseArray_1.13.2
    ## [89] xfun_0.57                   MatrixGenerics_1.25.0
    ## [91] buildtools_1.0.0            pkgconfig_2.0.3

# 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.
Sun, Wen-Ju, Jun-Hao Li, Shun Liu, et al. 2015. “RMBase: a resource for decoding the landscape of RNA modifications from high-throughput sequencing data.” Nucleic Acids Research 44 (D1): D259–65. https://doi.org/10.1093/nar/gkv1036.
Xuan, Jia-Jia, Wen-Ju Sun, Peng-Hui Lin, et al. 2017. “RMBase v2.0: deciphering the map of RNA modifications from epitranscriptome sequencing data.” Nucleic Acids Research 46 (D1): D327–34. https://doi.org/10.1093/nar/gkx934.