Building your own modules

DO-MS is designed to allow easy customization to in-house proteomics workflows through a modular plotting and data display system. Modules are a type of data display, such as plots, tables, and text.

Write your code once in the module format, apply it automatically to different datasets, and get consistent data display through the web interface or generated reports.

Table of Contents


Modules are organized and grouped together through tabs, which are named folders under the modules/ folder.

$ ls modules

Tab Organization

Tabs are sorted alphabetically, so numerical prefixes to folder names allow for custom ordering of tabs, as done with the base set of tabs. When displaying the tab name in the interface/report, numerical prefixes are removed and the _ character is replaced with a space.

Removing Tabs

Deleting the tab folder will remove the tab and all of its child modules. Tabs can be “commented out” by appending the folder name with two underscores, like so: __090_Hidden_Tab/.


Each module is its own .R file inside of a tab. The contents of the module are described below, and annotated, example modules can be found in the examples/ folder. You can also use the base set of modules as a reference to build your own.

Module Organization

Modules are displayed alphabetically in both the web interface and report. Numerical prefixes to the module file name allow for custom ordering, in the same system for tabs described above. Unlike tabs, module names are specified inside the file and are not derived from the file name.

Removing Modules

Deleting a module will remove it. If you want to keep it without displaying it, you can “comment out” similar to tabs, by appending the module file name with two underscores like so: __hide_this_module.R

Module Types

Modules can render into a variety of display types. Current options are listed below, but more are upcoming.


Render a plot image. The plot function should return a ggplot object or a vanilla R plot object recorded with the recordPlot() function.


Render a static table. The plot function should return a matrix or datatable


The same as the table type, except in the web interface and HTML report this table is displayed as a DataTable which allows searching, reordering, etc. More details on DataTables can be found here


Render a string. The plot function should return a string. Newlines should be done with two newline characters (\n\n) instead of one for proper display.

Module Structure

Each module file specifies a function init() that takes in no arguments, and returns a list that provides both metadata about the module and function definitions that give the module its functionality.

Metadata Fields


Module type, as described above.


The name of the module, as displayed on the web interface and report


Description of the module, shown in the web interface and documentation tab


Description of the file(s) used for this module, displayed in the documentation tab


validate_func(data, input)

Function to validate whether or not the data required for this module is loaded. All implementations use shiny’s validate function internally.

plotdata_func(data, input)

Function to generate filtered and modified data to be used for display. Returns data, usually in tabular form. This is the data that will be given to the user when clicking the “Download Data” button in the interface

plot_func(data, input)

Function to generate a display object (plot, table, text) from the plotdata function.

Additional Options (web interface)


Width of the box in bootstrap column units (1-12, where 12 is the full page width).


Height of the box in pixels. By default the box height is the height of the plot object, or 400px if the display type is not a plot.

Additional Options (plot type)


Value, in pixels, of the width of each experiment in the plot. For plots such as the vertical histograms used in the base set of DO-MS plots need to scale horizontally with the number of experiments.


Value, in pixels, of the base width of a plot using the dynamic width. Useful for plots with elements taking up a fixed amount of horizontal space – e.g., legends.


Height, in pixels, of the plot. Default is 370px. Will also scale the box height, unless it is also user-defined.


Width, in inches, of the plot in the generated report. Defaults to a global report plot width, which is by default 5 inches.


Height, in inches, of the plot in the generated report. Defaults to a global report plot height, which is by default 5 inches.

Additional Options (datatable type)


A list of parameters to pass to DataTables. For example:

  lengthMenu=c(5, 10, 15, 20, 50)

More details can be found in the R DT interface, and on the DataTables reference page