plotExon: Plot pipeline data/results for a given exon

Description Usage Arguments Value Note Author(s) See Also

Description

Creates a 3-paneled plot of a selected exon: panel 1 = genomic position vs. raw coverage data, panel 2 = genomic position vs. moderated t statistic from linear model at that position, panel 3 = genomic position vs. predicted state for that position, with annotated exons overlaid.

Usage

1
2
3
4
5
plotExon(getRegionObject, ind = NULL, exonname = NULL, tstats, pos,
  annotation, counts, group, bppad = 50, axpad = 50, prettyskips = T,
  skiplines = T, countsheader = F, countssep = "\t", tabname = NULL,
  plotfile = NULL, width = 900, height = 750, plottitle = NULL,
  chromosome, legendloc = "bottomleft", scalefac = 0.5, ylim = c(0, 9))

Arguments

getRegionObject

The name of an object created with getRegions.

ind

index in the provided annotation of the exon you wish to plot.

exonname

name of the exon (as listed in the provided annotation) you wish to plot

tstats

Vector of t-statistics that was used to create getRegionObject.

pos

vector of genomic positions corresponding to tstats

annotation

data frame containing exon annotation to use (see getAnnotation). Must contain a "name" column listing the exon names. (The column exon_id in a getAnnotation object can be re-named to name).

counts

Raw coverage data used to obtain tstats. This can be provided in one of three forms: (1) a string indicating the location/file name of a SQLite database containing the counts, usually created with makeDb; (2) a string indicating the location/file name of a text file containing coverage – this will get loaded into memory!! – or (3) an already-loaded matrix containing the raw data. Note that counts must have the same number of rows as pos and tstats have elements, and the rows must correspond to genomic position pos.

group

a vector containing the group labels for the columns of counts. Only 2 groups are permitted at this time. These labels are used in the plot's legend, so generally they are character strings (rather than, say, 0/1).

bppad

the number of bases to plot outside of the designated region (default 50). Essentially, use this to "zoom" in (decrease bppad) or out (increase bppad) on the plotted region.

axpad

how much wider (in bases) you'd like the x-axis to be, compared to the plotted area

prettyskips

If TRUE, plot counts/states/t-statistics contiguously, even if there are zero entries between them (i.e., even though pos may not indicate that contiguous postions are being plotted). Note that in general, when plotting just one exon, this is not an issue as exons tend to contain contiguous data. So, prettyskips will only affect areas outside the exon, i.e., prettyskips has larger impact if bppad is large. Also, note that prettyskips = FALSE is not allowed at this time.

skiplines

if TRUE, add a light vertical line to the plot indicating an eliminated "low-coverage" nucleotide

countsheader

If TRUE, the counts matrix contains a header row. Not usually the case if counts is a database or already-loaded matrix.

countssep

If reading counts from a text file, the separator used in that file.

tabname

If counts is a database file, the name of the table that was dumped into that database. (See tablename in makeDb)

plotfile

Optional string containing a file you'd like to put the plot into (if NULL, plot appears interactively). Should have a .jpg extension.

width

Only used when plotfile is non-null: width (in pixels) of resulting jpg. Defaults to 900.

height

Only used when plotfile is non-null: width (in pixels) of resulting jpg. Defaults to 750.

plottitle

Optional main title to use on your plot. Defaults to chromosome: start-end (referring to plotted REGION)

chromosome

The chromosome corresponding to the exon being plotted, in the same format as chromosomes are listed in the supplied annotation.

legendloc

Can be one of "topright","bottomright","topleft",or "bottomleft" indicating where the legend (indicating group label on raw count plot) should be located. Defaults to "bottomleft."

scalefac

How should we offset counts (so that we can log-transform everything, even zero counts)? Defaults to 0.5, derfinder uses an offset of 32.

ylim

Equivalent to ylim argument in plot: what should the lower and upper limits be on the y-axis of the top panel of plot be? Defaults to c(0,9).

Value

Plots (either on screen or in the supplied .jpg file) the following: top panel = genomic position vs. raw coverage data, middle panel = genomic position vs. moderated t statistic from linear model at that position, bottom panel = genomic position vs. predicted state for that position, with annotated exons overlaid. States are as follows: gray = not expressed, black = equally expressed, red = overexpressed (in whatever group = 1 represented in getRegions), green = underexpressed.

Note

Provide exactly one of ind and exonname.

Author(s)

Alyssa Frazee

See Also

getRegions, makeDb


leekgroup/derfinder documentation built on May 20, 2019, 11:30 p.m.