plotTranscripts-methods: Plot a set of transcripts along genomic coordinates.

Description Usage Arguments Author(s) See Also Examples

Description

plotTranscripts uses the Gviz package to plot the exon structure of a set of transcripts along genomic coordinates.

Usage

1
plotTranscripts(x, reads=NULL, from=NA, to=NA, max.plot.reads=200)

Arguments

x

A GRangesList object containing the genomic ranges of a set of exons grouped by transcript. Alternatively, x can be a TxDb object, or a SplicingGraphs object of length 1.

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. from=NA and to=NA), the plot covers the range spanned by the transcripts. If from=NULL and to=NULL, then the plot covers the range spanned by the transcripts and the reads.

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 max.plot.reads, then only max.plot.reads randomly chosen reads are plotted.

Author(s)

H. Pagès

See Also

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:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## ---------------------------------------------------------------------
## 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)

SplicingGraphs documentation built on Nov. 8, 2020, 5:58 p.m.