exportGTF: Export GTF

Description Usage Arguments Value Examples

Description

Exports a TxDb annotation to a GTF file

Usage

1
exportGTF(txdb, file, source = "txcutr")

Arguments

txdb

transcriptome to be output

file

a string or connection to output GTF file. Automatically recognizes strings ending with ".gz" for zipped output.

source

a string to go in the source column

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
library(TxDb.Scerevisiae.UCSC.sacCer3.sgdGene)

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

## restrict to 'chrI' transcripts
seqlevels(txdb) <- c("chrI")

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

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

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

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