# EpiTxDb: creating an EpiTxDb object

Felix G.M. Ernst

#### 2024-10-29

#### Package

EpiTxDb 1.18.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`.

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbPackage' by
    ## 'txdbmaker::makeTxDbPackage' when loading 'EpiTxDb'

    ## Warning: replacing previous import
    ## 'GenomicFeatures::supportedUCSCFeatureDbTables' by
    ## 'txdbmaker::supportedUCSCFeatureDbTables' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbFromGFF' by
    ## 'txdbmaker::makeTxDbFromGFF' when loading 'EpiTxDb'

    ## Warning: replacing previous import
    ## 'GenomicFeatures::makeTxDbPackageFromBiomart' by
    ## 'txdbmaker::makeTxDbPackageFromBiomart' when loading 'EpiTxDb'

    ## Warning: replacing previous import
    ## 'GenomicFeatures::supportedMiRBaseBuildValues' by
    ## 'txdbmaker::supportedMiRBaseBuildValues' when loading 'EpiTxDb'

    ## Warning: replacing previous import
    ## 'GenomicFeatures::supportedUCSCFeatureDbTracks' by
    ## 'txdbmaker::supportedUCSCFeatureDbTracks' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::browseUCSCtrack' by
    ## 'txdbmaker::browseUCSCtrack' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::getChromInfoFromBiomart'
    ## by 'txdbmaker::getChromInfoFromBiomart' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbFromGRanges' by
    ## 'txdbmaker::makeTxDbFromGRanges' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::supportedUCSCtables' by
    ## 'txdbmaker::supportedUCSCtables' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbFromBiomart' by
    ## 'txdbmaker::makeTxDbFromBiomart' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::UCSCFeatureDbTableSchema'
    ## by 'txdbmaker::UCSCFeatureDbTableSchema' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbFromEnsembl' by
    ## 'txdbmaker::makeTxDbFromEnsembl' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDb' by
    ## 'txdbmaker::makeTxDb' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeFDbPackageFromUCSC' by
    ## 'txdbmaker::makeFDbPackageFromUCSC' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbFromUCSC' by
    ## 'txdbmaker::makeTxDbFromUCSC' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeTxDbPackageFromUCSC'
    ## by 'txdbmaker::makeTxDbPackageFromUCSC' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makePackageName' by
    ## 'txdbmaker::makePackageName' when loading 'EpiTxDb'

    ## Warning: replacing previous import 'GenomicFeatures::makeFeatureDbFromUCSC' by
    ## 'txdbmaker::makeFeatureDbFromUCSC' when loading 'EpiTxDb'

    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: 2024-10-29 22:30:56 -0400 (Tue, 29 Oct 2024)
    ## # EpiTxDb version at creation time: 1.18.0
    ## # RSQLite version at creation time: 2.3.7
    ## # 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()`.

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

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

# 5 Session info

    sessionInfo()

    ## R version 4.4.1 (2024-06-14 ucrt)
    ## Platform: x86_64-w64-mingw32/x64
    ## Running under: Windows Server 2022 x64 (build 20348)
    ##
    ## Matrix products: default
    ##
    ##
    ## locale:
    ## [1] LC_COLLATE=C
    ## [2] LC_CTYPE=English_United States.utf8
    ## [3] LC_MONETARY=English_United States.utf8
    ## [4] LC_NUMERIC=C
    ## [5] LC_TIME=English_United States.utf8
    ##
    ## 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] EpiTxDb_1.18.0       Modstrings_1.22.0    Biostrings_2.74.0
    ##  [4] XVector_0.46.0       AnnotationDbi_1.68.0 Biobase_2.66.0
    ##  [7] GenomicRanges_1.58.0 GenomeInfoDb_1.42.0  IRanges_2.40.0
    ## [10] S4Vectors_0.44.0     BiocGenerics_0.52.0  BiocStyle_2.34.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] tRNAdbImport_1.24.0         tidyselect_1.2.1
    ##  [3] dplyr_1.1.4                 blob_1.2.4
    ##  [5] filelock_1.0.3              bitops_1.0-9
    ##  [7] fastmap_1.2.0               RCurl_1.98-1.16
    ##  [9] BiocFileCache_2.14.0        GenomicAlignments_1.42.0
    ## [11] rex_1.2.1                   XML_3.99-0.17
    ## [13] digest_0.6.37               lifecycle_1.0.4
    ## [15] KEGGREST_1.46.0             RSQLite_2.3.7
    ## [17] magrittr_2.0.3              compiler_4.4.1
    ## [19] rlang_1.1.4                 sass_0.4.9
    ## [21] progress_1.2.3              tools_4.4.1
    ## [23] utf8_1.2.4                  yaml_2.3.10
    ## [25] rtracklayer_1.66.0          knitr_1.48
    ## [27] prettyunits_1.2.0           S4Arrays_1.6.0
    ## [29] bit_4.5.0                   curl_5.2.3
    ## [31] DelayedArray_0.32.0         xml2_1.3.6
    ## [33] abind_1.4-8                 BiocParallel_1.40.0
    ## [35] txdbmaker_1.2.0             grid_4.4.1
    ## [37] fansi_1.0.6                 colorspace_2.1-1
    ## [39] ggplot2_3.5.1               scales_1.3.0
    ## [41] biomaRt_2.62.0              SummarizedExperiment_1.36.0
    ## [43] cli_3.6.3                   rmarkdown_2.28
    ## [45] crayon_1.5.3                generics_0.1.3
    ## [47] httr_1.4.7                  rjson_0.2.23
    ## [49] DBI_1.2.3                   cachem_1.1.0
    ## [51] stringr_1.5.1               zlibbioc_1.52.0
    ## [53] parallel_4.4.1              BiocManager_1.30.25
    ## [55] restfulr_0.0.15             matrixStats_1.4.1
    ## [57] vctrs_0.6.5                 Matrix_1.7-1
    ## [59] jsonlite_1.8.9              bookdown_0.41
    ## [61] hms_1.1.3                   bit64_4.5.2
    ## [63] GenomicFeatures_1.58.0      jquerylib_0.1.4
    ## [65] glue_1.8.0                  codetools_0.2-20
    ## [67] gtable_0.3.6                stringi_1.8.4
    ## [69] BiocIO_1.16.0               UCSC.utils_1.2.0
    ## [71] munsell_0.5.1               tibble_3.2.1
    ## [73] pillar_1.9.0                rappdirs_0.3.3
    ## [75] htmltools_0.5.8.1           GenomeInfoDbData_1.2.13
    ## [77] R6_2.5.1                    dbplyr_2.5.0
    ## [79] httr2_1.0.5                 evaluate_1.0.1
    ## [81] lattice_0.22-6              png_0.1-8
    ## [83] Rsamtools_2.22.0            memoise_2.0.1
    ## [85] bslib_0.8.0                 Structstrings_1.22.0
    ## [87] tRNA_1.24.0                 SparseArray_1.6.0
    ## [89] xfun_0.48                   MatrixGenerics_1.18.0
    ## [91] 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: 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.

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–D265. 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–D334. https://doi.org/10.1093/nar/gkx934.