Importing from to tRNAdb and mitotRNAdb as `GRanges`

BiocStyle::markdown(css.files = c('custom.css'))

Introduction

The tRNAdb and mttRNAdb [@Juehling.2009] is a compilation of tRNA sequences and tRNA genes. It is a follow up version of the database of Sprinzl et al. [@Sprinzl.2005].

Using tRNAdbImport the tRNAdb can be accessed as outlined on the website r tRNAdbImport::TRNA_DB_URL and the results are returned as a GRanges object.

Importing as GRanges

suppressPackageStartupMessages(
  library(tRNAdbImport)
)
library(tRNAdbImport)
# accessing tRNAdb
# tRNA from yeast for Alanine and Phenylalanine
gr <- import.tRNAdb(organism = "Saccharomyces cerevisiae",
                    aminoacids = c("Phe","Ala"))
# 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")
# 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)

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)

Further analysis

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

suppressPackageStartupMessages({
  library(Biostrings)
  library(rtracklayer)
})
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.

Session info

sessionInfo()

References



Try the tRNAdbImport package in your browser

Any scripts or data that you put into this service are public.

tRNAdbImport documentation built on Nov. 8, 2020, 6:50 p.m.