Make interactive reports on differential abundance
write_limma_plots.RdCreates and saves interactive HTML reports summarizing differential abundance analyses for each contrast in the results slot of the DAList. Creates one HTML report for each contrast. Also creates a subfolder containing static .pdf versions of all interactive plots. Currently, overwrites any previous reports or other files with the same name.
Arguments
- DAList
A DAList object, with statistical results.
- grouping_column
The name of the column in the metadata which gives information on how to group samples for the interactive abundance plot.
- table_columns
Optional: the name of the column(s) in the annotation data frame that will be included in the interactive table of statistical results in the report. These columns will also be displayed in the tooltips of the volcano and MD plots. By default, only the uniprot_id column is displayed. See Details for more information.
- title_column
Optional: the name of a column in the annotation data frame from which to take values to use as the title for the protein intensity plots in the report. If not supplied, will use the info in the uniprot_id. If supplied, the title column will also be displayed (without truncation) in the results table. See Details for more information.
- output_dir
The directory in which to create the reports and save the plot files. If not specified, will default to the current working directory.
- tmp_subdir
The subdirectory within the output directory in which to store temporary files. Deleted by default. Default is "tmp".
- overwrite
Should results files be overwritten? Default is FALSE.
- height
The height of the interactive report objects, in pixels. Default is 1000.
- width
The width of the interactive report objects, in pixels. Default is 1000.
- control_proteins
Optional character vector of protein identifiers (e.g., UniProt IDs) to treat as control or reference proteins. These can be highlighted in static volcano and MD plots.
- highlight_by
Optional column name in the results table or annotation used to select proteins for highlighting (for example,
"uniprot_id"or a logical marker column such as"is_marker").- image_formats
Character vector of file formats to write for the static plots, e.g.
c("pdf", "png"). Passed on toggplot2::ggsave.
Details
Users can modify some aspects of the report output. First, users can modify the width and height of the interactive report with the height and width arguments, specified in pixels.
Users can also control what data are displayed in the interactive table of the report via the table_columns argument. Users can supply a vector of column names from the annotation data frame to include, these columns will be displayed in the order provided (column names may be changed slightly if the original names cause issues with the Javascript code used for plotting). By default, only the uniprot_id column is displayed.
Finally, users can use the title_column argument to change the title of the protein intensity (the plots on the right of the report). By default, the values in the uniprot_id column of the annotation are used. To avoid plotting issues, the values in the user-provided column will be truncated to 15 characters for use in the title: these values must remain unique after truncation. If a title_column is supplied, it will be added to the table_columns so that it is displayed in the table as well.
Examples
if (FALSE) { # \dontrun{
# Using defaults
write_limma_plots(DAList,
grouping_column = "treatment")
# Adjust size of report
write_limma_plots(DAList,
grouping_column = "treatment",
height = 1500,
width = 1500)
# Customize output directory
write_limma_plots(DAList,
grouping_column = "treatment",
output_dir = "DA_results")
# Add titles to the intensity plot,
# using the values in the protein_id column
# in the annotation of the DAList,
# and display additional columns in the table
write_limma_plots(DAList,
grouping_column = "treatment",
table_columns = "description",
title_column = "protein_id")
} # }