exportFASTA {txcutr}R Documentation

Export Transcriptome as FASTA

Description

Export Transcriptome as FASTA

Usage

exportFASTA(txdb, genome, file, ...)

Arguments

txdb

a TxDb object representing a transcriptome annotation

genome

a BSgenome object from which to extract sequences

file

a string for output FASTA file. File names ending in ".gz" will automatically use gzip compression.

...

additional arguments to pass through to writeXStringSet

Value

The txdb argument is invisibly returned.

Examples

library(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene)
library(BSgenome.Scerevisiae.UCSC.sacCer3)

## load annotation and genome
txdb <- TxDb.Scerevisiae.UCSC.sacCer3.sgdGene
sacCer3 <- BSgenome.Scerevisiae.UCSC.sacCer3

## restrict to 'chrI' transcripts (makes for briefer example runtime)
seqlevels(txdb) <- c("chrI")

## last 500 nts per tx
txdb_w500 <- truncateTxome(txdb)

## export uncompressed
outfile <- tempfile("sacCer3.sgdGene.w500", fileext=".fa")
exportFASTA(txdb_w500, sacCer3, outfile)

## export compressed
outfile <- tempfile("sacCer3.sgdGene.w500", fileext=".fa.gz")
exportFASTA(txdb_w500, sacCer3, outfile)


[Package txcutr version 0.99.1 Index]