get.tRNAprecursor: Get tRNA precursor sequences

View source: R/tRNAscanImport-genome.R

get.tRNAprecursorR Documentation

Get tRNA precursor sequences

Description

get.tRNAprecursor retrieves tRNA precursor sequences from genomic sequences. The length of 5'- and 3'-overhangs can be specifid individually. The output is checked for validity against the tRNA sequences as reported by tRNAscan.

The chromosomes names of tRNAscan input and genome sequences must be compatible.

Usage

get.tRNAprecursor(
  input,
  genome,
  add.5prime = 50L,
  add.3prime = add.5prime,
  trim.intron = FALSE
)

Arguments

input

a compatible GRanges object

genome

a BSgenome object, a DNAStringSet object, a FaFile object or a character vector with a single value referncing a file, which can be coerced to a FaFile object.

add.5prime, add.3prime

the length of overhangs as a single integer value each. (default add.5prime = 50L)

trim.intron

TRUE or FALSE: Should intron sequences be included in the precursor sequences? (default trim.intron = FALSE)

Value

a DNAStringSet object, containing the precursor sequences.

Examples

library(BSgenome.Scerevisiae.UCSC.sacCer3)
file <- system.file("extdata",
                    file = "yeast.tRNAscan",
                    package = "tRNAscanImport")
gr <- tRNAscanImport::import.tRNAscanAsGRanges(file)
genome <- getSeq(BSgenome.Scerevisiae.UCSC.sacCer3)
names(genome) <- c(names(genome)[-17],"chrmt")
get.tRNAprecursor(gr, genome)
# this produces an error since the seqnames do not match
## Not run: 
genome <- BSgenome.Scerevisiae.UCSC.sacCer3
names(genome) <- c(names(genome)[-17],"chrmt")
get.tRNAprecursor(gr, genome)

## End(Not run)
# ... but it can also be fixed
genome <- BSgenome.Scerevisiae.UCSC.sacCer3
seqnames(genome) <- c(seqnames(genome)[-17],"chrmt")
get.tRNAprecursor(gr, genome)

FelixErnst/tRNAscanImport documentation built on March 29, 2024, 5:44 p.m.