getTxsSeq: Get transcript sequences

getTxsSeqR Documentation

Get transcript sequences

Description

Extract the DNA sequences of all exons of transcript models and concatenate to one sequence per transcript. This is basically a wrapper for extractTranscriptSeqs, which makes sure that the exons are correctly sorted according to their position in the transcript (3' to 5').

Usage

getTxsSeq(transcripts, genome)

## S4 method for signature 'GRangesList'
getTxsSeq(transcripts, genome)

## S4 method for signature 'GRanges'
getTxsSeq(transcripts, genome)

Arguments

transcripts

A GRanges or GRangesList object containing exons of transcripts for which sequences should be extracted. All exons in a GRanges object are assumed to belong to the same transcript. Multiple transcripts can be provided in a GRangesList object.

genome

A BSgenome or DNAStringSet object containing chromosome sequences which should be used to extract transcript sequences. Although using a BSgenome object is the easiest way, the genome sequence could also be loaded from a FASTA file using readDNAStringSet.

Value

A DNAString or DNAStringSet object containing the transcript sequence(s).

Methods (by class)

  • getTxsSeq(GRangesList): Obtain transcript sequence from GRangesList input

  • getTxsSeq(GRanges): Obtain transcript sequence from GRanges input

Examples

library(BSgenome)

# protein-coding exons of transcripts within chr11 region
data("chr11_genes")
target_txs <- split(chr11_genes, f = chr11_genes$transcript_id)

# human genome (hg38) BSgenome object (needs to be installed separately from Bioconductor)
hg38 <- getBSgenome("BSgenome.Hsapiens.UCSC.hg38")

# get sequences for all target transcripts on chr11
txs_seqs <- getTxsSeq(target_txs, genome = hg38)

argschwind/TAPseq documentation built on Feb. 9, 2024, 8:20 p.m.