plot.pixelgram: Renders the pixelgram object

Description Usage Arguments Details Examples

Description

This layout-compatible method validates the pixelgram object, establishes plot coordinates, and draws the pixel and phylogram plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'pixelgram'
plot(x, xform_type = NULL, xform_master = NULL,
  leaf_colors = NULL, tip_labels = NULL, legend_attributes = NULL,
  edge_widths = NULL, edge_colors = NULL, scale_bar = NULL,
  pheno_matrix = NULL, pheno_colnames = NULL, pheno_letters = NULL,
  show_top_axis = F, show_tip_label = F, selected_rows = NULL,
  selected_row_colors = NULL, no_margin = F, plot_margin_points = F,
  vbars = NULL, raster_width = NULL, raster_margin = NULL,
  color_lut_type = NULL, x_labs = NULL, notes = NULL, annotate_env = F,
  show_tree = NULL, main = NULL, sub = NULL, ...)

Arguments

x

pixelgram object to be plotted

xform_type

see help(pixelgram::pixelgram()).

xform_master

see help(pixelgram::pixelgram()).

leaf_colors

vector of tree leaf colors; can be colors or integers

tip_labels

List for adding tree tip labels; see details.

legend_attributes

Named list of entries that go into the legend

edge_widths

tree edge widths

edge_colors

tree edge colors

scale_bar

Named list of entries used to draw the scale bar

pheno_matrix

Heatmap of RGB values to draw in raster_margin.

pheno_colnames

A vector of names to label pheno_matrix.

pheno_letters

A vector of letters to label pheno_matrix.

show_top_axis

Draw axis along top of plot?

show_tip_label

Show taxon labels on tree tips?

selected_rows

Vector of selected taxa.

selected_row_colors

Colors to depict vector of selected taxa.

no_margin

No margin? This is passed to ape::plot.phylo().

plot_margin_points

Plot margin points?

vbars

vertical bars?

raster_width

Proportionate width of the pixel plot, e.g. 1 indicates equal width.

raster_margin

Offset in raster portion of the layout, e.g. for heatmap.

color_lut_type

Optional string for non-default color lookup table, currently only implemented for amino acids as 'charge' and 'taylor'.

x_labs

Vector of values to plot as labels along x axis of raster plot, e.g. to identify specific sites.

notes

Is a named list used to draw landmarks for the region sequenced, with elements "Lhs", "Rhs", "col" and "txt". Using numbering from the reference sequence lookup-table, rectangles are drawn bounded by Lhs and Rhs for each entry and filled with the color specified by col (using alpha transparency gives better results). If present, labels with values in "txt" are plotted along the margin. If annotate_env is true, these values are populated internally for the HIV-1 env.

annotate_env

If true, draw Env landmarks.

show_tree

Show the tree? If not, only show the pixel plot.

main

Plot title, e.g. coded subject id. If given, it is plotted at the top of the pixelgram output.

sub

Plot subtitle, i.e. region sequenced. If specified, it appears with "site" below the pixel plot.

...

dots, passed to ape::plot.phylo()

Details

The x-axis of the plot coordinate system is positive for the tree-plotting region, and negative for the pixel-plotting region. Setting raster_width rescales the minimum x-axis value by this factor. The default is 1, so the pixel and raster plots are equal width. The raster_margin parameter rescales the right (least negative) edge of the pixel plot, to leave a gap between pixel and tree, e.g. to include a heatmap of phyenotypic assay results.

Tree tip labels can be added by passing a list called tip_labels, with elements named "pch", "bgs", and "col". See vignette. The tree can be further decorated by passing leaf_colors, edge_widths, and edge_colors. See the last vignette example.

If defined, data in the pheno_matrix are plotted in the margin between tree and pixel plots. Entry values should be positive (non-zero) integers, which are interpreted as indices to palette(), color names, or color values. Matrix rows must have names that match tree tip-label (i.e. pg$tre$tip.label strings, or they will not be plotted. This is to facilitate their proper ordering, which follows that of the leaves on the tree. All columns are plotted, and in the order given. However, column widths are scaled to fit together into the marginal area provided within the pixel-plot area (x-values < 0) by raster_margin.

The x- and y-axis lim arguments are provided to facilitate plotting multiple trees on the same scale in different panels.

The option color_lut_type is used to specify alternative columns from the defined color scheme (see help(pixmap_colors)). For example, 'taylor' in the vignette uses the colors described in Wittgensteinean fashion by W. Taylor, Protein Engineering, Vol 10 , 743-746 (1997).

Entries in the scale_bar list argument should be named 'pos' for plot-position coordinates, 'lwd', 'len' for bar length, in terms of the plot coordinates, 'cex', and 'text'.

Entries in the legend_attributes list argument should be named 'location' for legend positioning as defined in ?legend, 'pch', 'cex', 'pt.cex', 'lwd', 'bg', 'bty', 'box.col', 'col' for colors, 'title', and 'text'.

Examples

1
2
3
4
## Not run: 
  plot( pg <- pixelgram::pixelgram(nts=pixelgram::hiv.ref$nts) )

## End(Not run)

phraber/pixelgram documentation built on May 25, 2019, 6:02 a.m.