TranscriptDb-class {GenomicFeatures}R Documentation

TranscriptDb objects

Description

The TranscriptDb class is a container for storing transcript annotations.

See ?FeatureDb for a more generic container for storing genomic locations of an arbitrary type of genomic features.

See ?makeTranscriptDbFromUCSC and ?makeTranscriptDbFromBiomart for convenient ways to make TranscriptDb objects from UCSC or BioMart online resources.

See ?makeTranscriptDbFromGFF for making a TranscriptDb object from annotations available as a GFF3 or GTF file.

Methods

In the code snippets below, x is a TranscriptDb object.

metadata(x): Return x's metadata in a data frame.

seqinfo(x), seqinfo(x) <- value: Get or set the information about the underlying sequences. Note that, for now, the setter only supports replacement of the sequence names, i.e., except for their sequence names (accessed with seqnames(value) and seqnames(seqinfo(x)), respectively), Seqinfo objects value (supplied) and seqinfo(x) (current) must be identical.

isActiveSeq(x): Return the currently active sequences for this txdb object as a named logical vector. Only active sequences will be tapped when using the supplied accessor methods. Inactive sequences will be ignored. By default, all available sequences will be active.

isActiveSeq(x) <- value: Allows the user to change which sequences will be actively accessed by the accessor methods by altering the contents of this named logical vector.

seqnameStyle(x): List the matching seqname styles for x. seqnameStyle(x) is equivalent to seqnameStyle(seqinfo(x)). Note that this information is not stored in x but inferred by looking up seqlevels(x) against a seqname style database stored in the seqnames.db metadata package (required).

determineDefaultSeqnameStyle(x): Determine the default seqname style for the database in x.

as.list(x): Dumps the entire db into a list of data frames txdump that can be used in do.call(makeTranscriptDb, txdump) to make the db again with no loss of information. Note that the transcripts are dumped in the same order in all the data frames.

Author(s)

H. Pages, Marc Carlson

See Also

Examples

txdb_file <- system.file("extdata", "Biomart_Ensembl_sample.sqlite",
                         package="GenomicFeatures")
txdb <- loadDb(txdb_file)
txdb

## Use of seqinfo
seqinfo(txdb)
seqlevels(txdb)  # shortcut for 'seqlevels(seqinfo(txdb))'
seqlengths(txdb)  # shortcut for 'seqlengths(seqinfo(txdb))'
isCircular(txdb)  # shortcut for 'isCircular(seqinfo(txdb))'
names(which(isCircular(txdb)))

## Can set txdb so that only chr1 and chr2 are used by using the seqlevels
seqlevels(txdb, force=TRUE) <- c("1", "2")
## And then you can restore the default seqlevels
txdb <- restoreSeqlevels(txdb)


## Use of as.list
txdump <- as.list(txdb)
txdump
txdb1 <- do.call(makeTranscriptDb, txdump)
stopifnot(identical(as.list(txdb1), txdump))

[Package GenomicFeatures version 1.14.2 Index]