Learn R Programming

TRAMPR (version 1.0-5)

plot.TRAMP: Plot a TRAMP Object

Description

Creates a graphical representation of matches performed by TRAMP. The plot displays (1) matches, showing how samples match the knowns and (2) peak profiles, showing the locations of peaks for individual enzyme/primer combinations.

Usage

## S3 method for class 'TRAMP':
plot(x, sample.fk, ...)
TRAMP.plotone(x, sample.fk, grouped=FALSE, ignore=FALSE,
              all.knowns=TRUE, all.samples=FALSE,
              all.samples.global=FALSE, col=1:10,
              pch=if (grouped) 15 else 16, xmax=NULL, horiz.lines=TRUE,
              mar.default=.5, p.top=.5, p.labels=1/3, cex.axis=NULL,
              cex.axis.max=1)

Arguments

x
A TRAMP object.
sample.fk
The sample.fk to plot. If omitted, then all samples are plotted, one after the other (this is useful for generating a summary of all fits for printing out: see Example).
grouped
Logical: Should the matched knowns be grouped?
ignore
Logical: Should matches marked as ignored by remove.TRAMP.match be excluded?
all.knowns, all.samples, all.samples.global
Controls which enzyme/primer combinations are displayed (see Details)
col
Vector of colours to plot the different enzyme/primer combinations. There must be at least as many colours as there are different combinations.
pch
Plotting symbol to use (see points for possible values and their interpretation). By default, this will use filled circles when ungrouped and filled squares when grouped.
xmax
Maximum size (in base pairs) for the plots to cover. NULL (the default) uses the range of all data found in the TRAMPsamples object (rounded up to the nearest 100). NA will use the range of all data in
horiz.lines
Logical: Should horizontal grid lines be used for each matched known?
mar.default
Margin size (in lines of text) to surround the plot.
p.top
Proportion of the plotting area to be used for the matches. The peak profiles will share the bottom 1-p.top of the plot.
p.labels
Proportion of the plotting area to be used for labels to the left of the plots. 1-p.labels will be used for the plots (try increasing this if you have very long species or group names).
cex.axis
Size of the text used for axes. If NULL (the default), then the largest cex that will exactly fit labels is chosen (up to cex.axis.max).
cex.axis.max
Maximum size of the text used for axes, if automatically determining the label size (i.e. cex.axis is NULL).
...
Additional arguments passed to TRAMP.plotone.

Details

This constructs a plot of a TRAMP fit, illustrating where knowns match the sample data, and which sample peaks remain unmatched. The top portion of the plot displays matches, showing how samples match the knowns. Individual species (or groups if grouped is TRUE) are represented by different horizontal lines. Where the sample matches a particular known, a symbol is drawn (Beware: it may look like only one symbol is drawn when several symbols are plotted on top of one another). The bottom portion of the plot displays the peak profile of the sample, showing the locations and heights of peaks for various enzyme/primer combinations (the exact combination depends on the values of all.knowns, all.samples and all.samples.global; see below). The height is arbitrary, so units are ommited. The arguments all.knowns, all.samples and all.samples.global control which enzyme/primer combinations are displayed in the plot. all.knowns=TRUE displays all combinations present in the knowns database and all.samples=TRUE displays all combinations present in the samples; when all.samples.global=TRUE this is combinations across the entire samples data set, otherwise this is samples present in the current sample only. At least one of all.knowns and all.samples must be TRUE.

See Also

plot.TRAMPknowns, for plotting TRAMPknowns objects, and plot.TRAMPsamples, for plotting TRAMPsamples objects.

Examples

Run this code
data(demo.samples)
data(demo.knowns)
res <- TRAMP(demo.samples, demo.knowns)

plot(res, 101)
plot(res, 110)
plot(res, 117)

plot(res, 117, grouped=TRUE)

# Create a PDF file with all matches:
pdf("all_matches.pdf")
plot(res)
dev.off()

Run the code above in your browser using DataLab