getTranscriptSeqs {VariantAnnotation}R Documentation

Get transcript sequences

Description

Extract transcript sequences from a BSgenome object or an FaFile.

Usage

  ## S4 method for signature 'GRangesList,BSgenome'
getTranscriptSeqs(query, subject, ...)
  ## S4 method for signature 'GRangesList,FaFile'
getTranscriptSeqs(query, subject, ...)
  ## S4 method for signature 'GRanges,FaFile'
getTranscriptSeqs(query, subject, ...)

Arguments

query

A GRangesList object containing exons or cds grouped by transcript.

subject

A BSgenome object or a FaFile from which the sequences will be taken.

...

Additional arguments

Details

getTranscriptSeqs is a wrapper for the extractTranscriptSeqs and getSeq functions. The purpose is to allow sequence extraction from either a BSgenome or FaFile. Transcript sequences are extracted based on the boundaries of the feature provided in the query (i.e., either exons or cds regions).

Value

A DNAStringSet instance containing the sequences for all transcripts specified in query.

Author(s)

Valerie Obenchain <vobencha@fhcrc.org>

See Also

predictCoding extractTranscriptSeqs getSeq

Examples

  library(TxDb.Hsapiens.UCSC.hg19.knownGene)
  library(BSgenome.Hsapiens.UCSC.hg19)
 
  txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene 
  cdsByTx <- cdsBy(txdb)

  ## Use only chromosome 20.
  seqlevels(cdsByTx, force=TRUE) <- "chr20"

  ## Return a DNAStringSet of sequences corresponding to 
  ## the cds regions.
  seqs <- getTranscriptSeqs(cdsByTx, Hsapiens)

  ## Sequences for the cds regions were retrieved from the BSgenome.
  ## Each element of the cdsByTx GRangesList is represented by
  ## a single DNAString in 'seqs'. 
  cdsByTx[1]
  seqs[1]

[Package VariantAnnotation version 1.14.6 Index]