# EpiTxDb: creating an EpiTxDb object

Felix G.M. Ernst

#### 2022-11-08

#### Package

EpiTxDb 1.10.0

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

# 2 `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: 2022-11-08 09:24:22 -0500 (Tue, 08 Nov 2022)
    ## # EpiTxDb version at creation time: 1.10.0
    ## # RSQLite version at creation time: 2.2.14
    ## # DBSCHEMAVERSION: 1.0

    metadata(etdb)

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

# 3 `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()`.

    etdb <- makeEpiTxDbFromtRNAdb("Saccharomyces cerevisiae")

    ## Loading data from tRNAdb ...

    ## Assembling data ...

    ## Creating EpiTxDb object ... done

    etdb

    ## EpiTxDb object:
    ## # Db type: EpiTxDb
    ## # Supporting package: EpiTxDb
    ## # Nb of modifications: 557
    ## # Db created by: EpiTxDb package from Bioconductor
    ## # Creation time: 2022-11-08 09:24:55 -0500 (Tue, 08 Nov 2022)
    ## # EpiTxDb version at creation time: 1.10.0
    ## # RSQLite version at creation time: 2.2.14
    ## # DBSCHEMAVERSION: 1.0

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

# 4 `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 = "Saccharomyces cerevisiae",
                                  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.

# 5 Session info

    sessionInfo()

    ## R version 4.2.1 (2022-06-23)
    ## Platform: aarch64-apple-darwin20 (64-bit)
    ## Running under: macOS Ventura 13.0
    ##
    ## Matrix products: default
    ## BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
    ## LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
    ##
    ## locale:
    ## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ##  [1] EpiTxDb_1.10.0       Modstrings_1.14.0    Biostrings_2.66.0
    ##  [4] XVector_0.38.0       AnnotationDbi_1.60.0 Biobase_2.58.0
    ##  [7] GenomicRanges_1.50.1 GenomeInfoDb_1.34.2  IRanges_2.32.0
    ## [10] S4Vectors_0.36.0     BiocGenerics_0.44.0  BiocStyle_2.26.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] bitops_1.0-7                matrixStats_0.62.0
    ##  [3] bit64_4.0.5                 filelock_1.0.2
    ##  [5] progress_1.2.2              httr_1.4.3
    ##  [7] tools_4.2.1                 bslib_0.3.1
    ##  [9] utf8_1.2.2                  R6_2.5.1
    ## [11] DBI_1.1.3                   colorspace_2.0-3
    ## [13] tidyselect_1.1.2            prettyunits_1.1.1
    ## [15] bit_4.0.4                   curl_4.3.2
    ## [17] compiler_4.2.1              cli_3.3.0
    ## [19] xml2_1.3.3                  DelayedArray_0.24.0
    ## [21] rtracklayer_1.58.0          bookdown_0.27
    ## [23] sass_0.4.1                  scales_1.2.0
    ## [25] tRNA_1.16.0                 rappdirs_0.3.3
    ## [27] stringr_1.4.0               digest_0.6.29
    ## [29] Rsamtools_2.14.0            rmarkdown_2.14
    ## [31] pkgconfig_2.0.3             htmltools_0.5.2
    ## [33] MatrixGenerics_1.10.0       dbplyr_2.2.1
    ## [35] fastmap_1.1.0               rlang_1.0.4
    ## [37] RSQLite_2.2.14              jquerylib_0.1.4
    ## [39] BiocIO_1.8.0                generics_0.1.3
    ## [41] jsonlite_1.8.0              BiocParallel_1.32.1
    ## [43] dplyr_1.0.9                 RCurl_1.98-1.7
    ## [45] magrittr_2.0.3              GenomeInfoDbData_1.2.8
    ## [47] Matrix_1.4-1                Rcpp_1.0.9
    ## [49] munsell_0.5.0               fansi_1.0.3
    ## [51] lifecycle_1.0.1             stringi_1.7.8
    ## [53] yaml_2.3.5                  SummarizedExperiment_1.28.0
    ## [55] zlibbioc_1.44.0             BiocFileCache_2.6.0
    ## [57] grid_4.2.1                  blob_1.2.3
    ## [59] parallel_4.2.1              crayon_1.5.1
    ## [61] lattice_0.20-45             tRNAdbImport_1.16.0
    ## [63] GenomicFeatures_1.50.2      hms_1.1.1
    ## [65] KEGGREST_1.38.0             knitr_1.39
    ## [67] pillar_1.7.0                rjson_0.2.21
    ## [69] codetools_0.2-18            biomaRt_2.54.0
    ## [71] XML_3.99-0.10               glue_1.6.2
    ## [73] evaluate_0.15               Structstrings_1.14.0
    ## [75] BiocManager_1.30.18         png_0.1-7
    ## [77] vctrs_0.4.1                 gtable_0.3.0
    ## [79] purrr_0.3.4                 assertthat_0.2.1
    ## [81] cachem_1.0.6                ggplot2_3.3.6
    ## [83] xfun_0.31                   restfulr_0.0.15
    ## [85] tibble_3.1.7                GenomicAlignments_1.34.0
    ## [87] memoise_2.0.1               ellipsis_0.3.2

# 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, Jie Wu, Hui Zhou, Liang-Hu Qu, and Jian-Hua Yang. 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, Ke-Ren Zhou, Shun Liu, Ling-Ling Zheng, Liang-Hu Qu, and Jian-Hua Yang. 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.