plotTranscripts-methods | R Documentation |
plotTranscripts
uses the Gviz package to plot the exon
structure of a set of transcripts along genomic coordinates.
plotTranscripts(x, reads=NULL, from=NA, to=NA, max.plot.reads=200)
x |
A GRangesList object containing the genomic ranges
of a set of exons grouped by transcript. Alternatively, |
reads |
A GAlignments or GAlignmentPairs object containing single-end or paired-end reads. |
from , to |
Single numeric values, giving the range of genomic coordinates to plot
the tracks in. By default (i.e. |
max.plot.reads |
The maximum number of reads that will be plotted. When the number of
reads that fall in the region being plotted is very large, plotting them
all would take a long time and result in a plot that is not very useful.
If that number is greater than |
H. Pagès
This man page is part of the SplicingGraphs package.
Please see ?`SplicingGraphs-package`
for an overview of the
package and for an index of its man pages.
Other topics related to this man page and documented in other packages:
plotTranscripts
is based on the plotTracks
function defined in the Gviz package.
The GRangesList class defined in the GenomicRanges package.
The GAlignments and GAlignmentPairs classes defined in the GenomicAlignments package.
The TxDb class defined in the GenomicFeatures package.
## ---------------------------------------------------------------------
## A. PLOT TRANSCRIPTS
## ---------------------------------------------------------------------
example(SplicingGraphs) # create SplicingGraphs object 'sg'
sg
## 'sg' has 1 element per gene and 'names(sg)' gives the gene ids.
names(sg)
## The transcripts of a given gene can be extracted with [[. The result
## is an *unnamed* GRangesList object containing the exons grouped by
## transcript:
sg[["geneD"]]
plotTranscripts(sg[["geneD"]]) # requires the Gviz package
## The transcripts of all the genes can be extracted with unlist(). The
## result is a *named* GRangesList object containing the exons grouped
## by transcript. The names on the object are the gene ids:
ex_by_tx <- unlist(sg)
ex_by_tx
plotTranscripts(ex_by_tx)
## ---------------------------------------------------------------------
## B. PLOT TRANSCRIPTS AND READS
## ---------------------------------------------------------------------
gal <- readGAlignments(toy_reads_bam(), use.names=TRUE)
plotTranscripts(sg[["geneA"]], reads=gal)
plotTranscripts(ex_by_tx, reads=gal)
plotTranscripts(ex_by_tx, reads=gal, from=1, to=320)
plotTranscripts(ex_by_tx, reads=gal[21:26], from=1, to=320)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.