TxDb objects

The TxDb 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 TxDb objects from UCSC or BioMart online resources.

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

classes, methods

In the code snippets below, x is a TxDb 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.
seqlevelsStyle(x), seqlevelsStyle(x) <- value: Get or set the seqname style for x. See the seqlevelsStyle generic getter and setter in the GenomeInfoDb package for more information.
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.

See Also

  • TxDb-class
  • class:TxDb
  • TxDb
  • seqinfo,TxDb-method
  • seqinfo<-,TxDb-method
  • isActiveSeq
  • isActiveSeq<-
  • isActiveSeq,TxDb-method
  • isActiveSeq<-,TxDb-method
  • show,TxDb-method
  • as.list,TxDb-method
txdb_file <- system.file("extdata", "Biomart_Ensembl_sample.sqlite",
txdb <- loadDb(txdb_file)

## Use of seqinfo
seqlengths(txdb)  # shortcut for 'seqlengths(seqinfo(txdb))'
isCircular(txdb)  # shortcut for 'isCircular(seqinfo(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)
txdb1 <- do.call(makeTranscriptDb, txdump)
stopifnot(identical(as.list(txdb1), txdump))
Documentation reproduced from package GenomicFeatures, version 1.18.7, License: Artistic-2.0

Community examples

Looks like there are no examples yet.