# EpiTxDb: creating an EpiTxDb object

Felix G.M. Ernst

#### 2020-04-28

#### Package

EpiTxDb 1.0.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: 2020-04-28 03:31:32 -0400 (Tue, 28 Apr 2020)
    ## # EpiTxDb version at creation time: 1.0.0
    ## # RSQLite version at creation time: 2.2.0
    ## # 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: 2020-04-28 03:32:01 -0400 (Tue, 28 Apr 2020)
    ## # EpiTxDb version at creation time: 1.0.0
    ## # RSQLite version at creation time: 2.2.0
    ## # 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.0.0 (2020-04-24)
    ## Platform: x86_64-w64-mingw32/x64 (64-bit)
    ## Running under: Windows Server 2012 R2 x64 (build 9600)
    ##
    ## Matrix products: default
    ##
    ## locale:
    ## [1] LC_COLLATE=C
    ## [2] LC_CTYPE=English_United States.1252
    ## [3] LC_MONETARY=English_United States.1252
    ## [4] LC_NUMERIC=C
    ## [5] LC_TIME=English_United States.1252
    ##
    ## attached base packages:
    ## [1] parallel  stats4    stats     graphics  grDevices utils     datasets
    ## [8] methods   base
    ##
    ## other attached packages:
    ##  [1] EpiTxDb_1.0.0        Modstrings_1.4.0     Biostrings_2.56.0
    ##  [4] XVector_0.28.0       AnnotationDbi_1.50.0 Biobase_2.48.0
    ##  [7] GenomicRanges_1.40.0 GenomeInfoDb_1.24.0  IRanges_2.22.0
    ## [10] S4Vectors_0.26.0     BiocGenerics_0.34.0  BiocStyle_2.16.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] bitops_1.0-6                matrixStats_0.56.0
    ##  [3] assertive.models_0.0-2      bit64_0.9-7
    ##  [5] progress_1.2.2              httr_1.4.1
    ##  [7] assertive.datetimes_0.0-2   tools_4.0.0
    ##  [9] R6_2.4.1                    colorspace_1.4-1
    ## [11] DBI_1.1.0                   assertive.data_0.0-3
    ## [13] assertive.reflection_0.0-4  tidyselect_1.0.0
    ## [15] prettyunits_1.1.1           bit_1.1-15.2
    ## [17] curl_4.3                    compiler_4.0.0
    ## [19] assertive.properties_0.0-4  xml2_1.3.2
    ## [21] DelayedArray_0.14.0         rtracklayer_1.48.0
    ## [23] assertive.files_0.0-2       bookdown_0.18
    ## [25] scales_1.1.0                tRNA_1.6.0
    ## [27] askpass_1.1                 rappdirs_0.3.1
    ## [29] stringr_1.4.0               digest_0.6.25
    ## [31] Rsamtools_2.4.0             rmarkdown_2.1
    ## [33] assertive.numbers_0.0-2     pkgconfig_2.0.3
    ## [35] htmltools_0.4.0             dbplyr_1.4.3
    ## [37] rlang_0.4.5                 RSQLite_2.2.0
    ## [39] assertive_0.3-5             jsonlite_1.6.1
    ## [41] BiocParallel_1.22.0         dplyr_0.8.5
    ## [43] RCurl_1.98-1.2              magrittr_1.5
    ## [45] GenomeInfoDbData_1.2.3      Matrix_1.2-18
    ## [47] Rcpp_1.0.4.6                munsell_0.5.0
    ## [49] lifecycle_0.2.0             stringi_1.4.6
    ## [51] assertive.base_0.0-7        yaml_2.2.1
    ## [53] SummarizedExperiment_1.18.0 zlibbioc_1.34.0
    ## [55] BiocFileCache_1.12.0        grid_4.0.0
    ## [57] blob_1.2.1                  crayon_1.3.4
    ## [59] lattice_0.20-41             tRNAdbImport_1.6.0
    ## [61] assertive.code_0.0-3        GenomicFeatures_1.40.0
    ## [63] hms_0.5.3                   knitr_1.28
    ## [65] pillar_1.4.3                assertive.sets_0.0-3
    ## [67] codetools_0.2-16            biomaRt_2.44.0
    ## [69] XML_3.99-0.3                glue_1.4.0
    ## [71] evaluate_0.14               Structstrings_1.4.0
    ## [73] BiocManager_1.30.10         vctrs_0.2.4
    ## [75] gtable_0.3.0                openssl_1.4.1
    ## [77] purrr_0.3.4                 assertive.strings_0.0-3
    ## [79] assertthat_0.2.1            ggplot2_3.3.0
    ## [81] xfun_0.13                   assertive.types_0.0-3
    ## [83] assertive.data.uk_0.0-2     tibble_3.0.1
    ## [85] GenomicAlignments_1.24.0    memoise_1.1.0
    ## [87] assertive.matrices_0.0-2    ellipsis_0.3.0
    ## [89] assertive.data.us_0.0-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: 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.