makeImages: Add dotplot images

View source: R/reportingTools.R

makeImagesR Documentation

Add dotplot images

Description

A function to add dotplot glyphs and links to HTML tables

Usage

makeImages(
  df,
  eset,
  grp.factor,
  design,
  contrast,
  colind,
  boxplot = FALSE,
  repdir = "./reports",
  extraname = NULL,
  weights = NULL,
  insert.after = 3,
  altnam = NULL,
  ...
)

Arguments

df

A data.frame from calling topTable. Note that the row.names for this data.frame must be consistent with the "eset" object. In other words, if "eset" is an ExpressionSet, then the row.names of the data.frame must consistent with the featureNames of the ExpressionSet.

eset

A matrix, data.frame, or ExpressionSet. If using RNA-Seq data, use voom from edgeR to create an EList object, and then pass in the "E" list item.

grp.factor

A factor that indicates which group ALL of the samples belong to. This will be subsetted internally, so do not subset yourself.

design

The design matrix used by limma or edgeR to fit the model.

contrast

The contrast matrix used by limma or edgeR to make comparisons.

colind

Which column of the contrast matrix are we using? In other words, for which comparison are we creating a table?

boxplot

Boolean. If TRUE, the output HTML table will have a boxplot showing differences between groups. If FALSE (default), the table will have dotplots.

repdir

A directory in which to put the HTML tables. Defaults to a "reports" directory in the working directory.

extraname

By default, the tables will go in a "reports" subdirectory, and will be named based on the column name of the contrast that is specified by the colind argument (after replacing any spaces with an underscore). If this will result in name collisions (e.g., a previous file will be over-written because the resulting names are the same), then an extraname can be appended to ensure uniqueness.

weights

Array weights, generally from arrayWeights in the limma package. These will affect the size of the plotting symbols, to reflect the relative importance of each sample.

insert.after

Which column should the image be inserted after? Defaults to 3.

altnam

Normally the output file directories are generated from the colnames of the contrast matrix. This argument can be used to over-ride the default, particularly in the case that one is computing an F-test using a set of columns from the contrast matrix.

...

Allows arbitrary arguments to be passed down to lower level functions.

Details

This function is intended to create little dotplot glyphs that can be added to an HTML table of results from e.g., a microarray or RNA-Seq experiment, showing graphically how much the different groups are changing. The glyphs have unlabeled axes to make them small enough to fit in an HTML table, and clicking on a glyph will result in a new page loading with a full sized dotplot, complete with axis labels.

This function is very similar to the stock functions in the ReportingTools package, but the standard glyphs for that package consist of a dotplot on top of a boxplot, which seems too busy to me. In addition, for most microarray analyses there are not enough replicates to make a boxplot useful.

Value

A list, two items. The first item is the input data.frame with the glyphs included, ready to be used with ReportingTools to create an HTML table. The second item is a pdf of the most differentially expressed comparison. This is useful for those who are using e.g., knitr or Sweave and want to be able to automatically insert an example dotplot in the document to show clients what to expect.

Author(s)

James W. MacDonald jmacdon@u.washington.edu


jmacdon/affycoretools documentation built on Feb. 25, 2023, 4:51 a.m.