transcriptsBy {GenomicFeatures} | R Documentation |
Generic functions to extract genomic features of a given type grouped based on another type of genomic feature. This page documents the methods for TranscriptDb objects only.
transcriptsBy(x, by=c("gene", "exon", "cds"), ...) ## S4 method for signature 'TranscriptDb' transcriptsBy(x, by=c("gene", "exon", "cds"), use.names=FALSE) exonsBy(x, by=c("tx", "gene"), ...) ## S4 method for signature 'TranscriptDb' exonsBy(x, by=c("tx", "gene"), use.names=FALSE) cdsBy(x, by=c("tx", "gene"), ...) ## S4 method for signature 'TranscriptDb' cdsBy(x, by=c("tx", "gene"), use.names=FALSE) intronsByTranscript(x, ...) ## S4 method for signature 'TranscriptDb' intronsByTranscript(x, use.names=FALSE) fiveUTRsByTranscript(x, ...) ## S4 method for signature 'TranscriptDb' fiveUTRsByTranscript(x, use.names=FALSE) threeUTRsByTranscript(x, ...) ## S4 method for signature 'TranscriptDb' threeUTRsByTranscript(x, use.names=FALSE)
x |
A TranscriptDb object. |
... |
Arguments to be passed to or from methods. |
by |
One of |
use.names |
Controls how to set the names of the returned
GRangesList object.
These functions return all the features of a given type (e.g.
all the exons) grouped by another feature type (e.g. grouped by
transcript) in a GRangesList object.
By default (i.e. if Finally, |
These functions return a GRangesList object where the ranges within each of the elements are ordered according to the following rule:
When using exonsBy
and cdsBy
with by = "tx"
,
the ranges are returned in the order they appear in the transcript,
i.e. order by the splicing.exon_rank field in x
's internal
database. In all other cases, the ranges will be ordered by chromosome,
strand, start, and end values.
A GRangesList object.
M. Carlson, P. Aboyoun and H. Pages
transcripts
and transcriptsByOverlaps
for more ways to extract genomic features
from a TranscriptDb object.
select-methods for how to use the simple "select" interface to extract information from a TranscriptDb object.
id2name
for mapping TranscriptDb internal ids
to external names for a given feature type.
The TranscriptDb class.
txdb_file <- system.file("extdata", "UCSC_knownGene_sample.sqlite", package="GenomicFeatures") txdb <- loadDb(txdb_file) ## Get the transcripts grouped by gene: transcriptsBy(txdb, "gene") ## Get the exons grouped by gene: exonsBy(txdb, "gene") ## Get the cds grouped by transcript: cds_by_tx0 <- cdsBy(txdb, "tx") ## With more informative group names: cds_by_tx1 <- cdsBy(txdb, "tx", use.names=TRUE) ## Note that 'cds_by_tx1' can also be obtained with: names(cds_by_tx0) <- id2name(txdb, feature.type="tx")[names(cds_by_tx0)] stopifnot(identical(cds_by_tx0, cds_by_tx1)) ## Get the introns grouped by transcript: intronsByTranscript(txdb) ## Get the 5' UTRs grouped by transcript: fiveUTRsByTranscript(txdb) fiveUTRsByTranscript(txdb, use.names=TRUE) # more informative group names