exportFASTA: Export Transcriptome as FASTA

Description Usage Arguments Value Examples

Description

Export Transcriptome as FASTA

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)

mfansler/txcutr documentation built on Dec. 21, 2021, 4:59 p.m.