BPG: Seamless, automated and interactive visualization of scientific data

Christine P'ng, Jeffrey Green, Lauren C. Chong, Daryl Waggott, Stephenie D. Prokopec, Mehrdad Shamsi, Francis Nguyen, Denise Y. F. Mak, Felix Lam, Marco A. Albuquerque, Ying Wu, Esther H. Jung, Maud H. W. Starmans, Michelle A. Chan-Seng-Yue, Cindy Q. Yao, Bianca Liang, Emilie Lalonde, Syed Haider, Nicole A. Simone, Dorota H. Sendorek, Kenneth C. Chu, Nathalie C. Moon, Natalie S. Fox, Michal R. Grzadkowski, Nicholas J. Harding, Clement Fung, Amanda R. Murdoch, Kathleen E. Houlahan, Jianxin Wang, David R. Garcia, Richard de Borja, Ren X. Sun, Xihui Lin, Gregory M. Chen, Aileen Lu, Yu-Jia Shiah, Amin Zia, Ryan Kearns, Paul C. BoutrosBMC Bioinformatics 2019

TL;DR

This paper introduces BPG, an R package designed to simplify the creation of publication-quality, highly customizable scientific data visualizations. It addresses the challenge of integrating complex, multi-dimensional biological data into reproducible and aesthetically pleasing figures, offering both an R library and an interactive web tool for seamless workflow integration.

What Problem Does This Paper Address?

In the era of big data, especially in biological sciences, researchers are generating increasingly large and complex datasets. Effectively exploring and communicating the insights from this data is a significant challenge. While numerous visualization tools exist, many struggle to integrate smoothly into existing R-based statistical pipelines (like Bioconductor). Furthermore, existing tools often lack publication-quality defaults, require extensive manual parameterization, offer limited options for multi-panel figures, or fail to provide interactive customization that can generate R code in real-time. This creates a bottleneck for researchers needing to produce high-resolution, consistent, and informative figures efficiently.

Methods

BPG is an R package built upon the grid graphics system and the lattice framework. Its core methodology involves providing a comprehensive suite of chart types, from common plots like bar charts and box plots to more specialized ones like the novel "dotmap" for visualizing four-dimensional data.

Key methodological contributions include:

  • Highly Parameterized Functions: Each plotting function offers extensive control over aesthetics, allowing for fine-tuning.
  • Publication-Quality Defaults: BPG aims for high-resolution (1600 dpi TIFF) output by default, with optimized settings for color palettes (including those suitable for colorblindness) and typography to ensure graphical consistency across projects.
  • create.multiplot Function: This function is crucial for combining multiple plots into a single, cohesive figure. It automatically aligns plots and standardizes parameters like line widths and font sizes, automating a process that is often manual and error-prone in other tools.
  • Interactive Web Tool: An online interface (http://bpg.oicr.on.ca) allows users to interactively adjust plot parameters and immediately see the results. Crucially, this tool generates the corresponding R code, facilitating the transition from interactive exploration to scripted analysis and integration into computational pipelines.
  • Code Efficiency: The paper highlights that BPG requires significantly less code to produce comparable or superior plots compared to other popular R graphics frameworks like base R, ggplot2, and lattice.

Datasets

The paper does not explicitly list specific external datasets used for training or evaluation. However, it states that BPG includes example datasets for users to practice with, and the figures presented (e.g., Fig. 1 and Fig. 2) are generated using these included datasets. The focus is on the types of data that can be visualized (high-dimensional, multi-faceted biological data) rather than specific benchmark datasets.

Key Insights and Ideas

  • Bridging the Gap between Interactive Exploration and Scripted Analysis: The most significant insight is BPG's ability to seamlessly link interactive visualization with reproducible R code generation. This empowers researchers to explore data visually and then directly obtain the code needed for their analysis pipelines, reducing manual transcription errors and saving time.
  • Automating Complex Figure Assembly: The create.multiplot function is a game-changer for creating complex figures that combine multiple plot types. This automates a tedious and often frustrating manual process, making sophisticated multi-panel figures much more accessible.
  • Focus on Publication-Readiness: By providing publication-quality defaults and considering aspects like colorblind-friendly palettes and grey-scale compatibility, BPG directly addresses a common pain point for researchers aiming to publish their findings.
  • Efficiency in Code and Output: The demonstration that BPG requires less code for similar or better graphical output compared to established libraries is a compelling argument for its adoption.

Key Results

  • BPG offers a wide array of chart types, including novel ones like the "dotmap" for visualizing four-dimensional data.
  • The package requires significantly less code to generate plots compared to base R, ggplot2, and lattice.
  • The interactive web tool allows for rapid prototyping and parameter tuning, generating R code for reproducibility.
  • The create.multiplot function automates the creation of complex multi-panel figures, a common requirement for high-dimensional data.
  • BPG has already been used in over 60 publications, indicating its practical utility and adoption by the research community.

Limitations and Future Work

  • Parameterization Complexity: While BPG offers extensive parameterization for fine control, the paper acknowledges that even "good defaults" may not be appropriate for every use-case, implying that users might still need to delve into detailed parameter tuning for specific needs.
  • Integration with Existing Pipelines: While BPG is designed to integrate well with R-based pipelines, the paper doesn't detail specific integration strategies beyond generating R code.
  • Future Work: The paper implicitly suggests future work through its emphasis on ease of use and comprehensive documentation, indicating a continued effort to make BPG accessible and powerful. The development of an interactive tool that generates code is a significant step towards future interactive visualization platforms.

Summary updated

BibTeX
@article{png2019bpg,
  author = {Christine P'ng and Jeffrey Green and Lauren C. Chong and Daryl Waggott and Stephenie D. Prokopec and Mehrdad Shamsi and Francis Nguyen and Denise Y. F. Mak and Felix Lam and Marco A. Albuquerque and Ying Wu and Esther H. Jung and Maud H. W. Starmans and Michelle A. Chan-Seng-Yue and Cindy Q. Yao and Bianca Liang and Emilie Lalonde and Syed Haider and Nicole A. Simone and Dorota H. Sendorek and Kenneth C. Chu and Nathalie C. Moon and Natalie S. Fox and Michal R. Grzadkowski and Nicholas J. Harding and Clement Fung and Amanda R. Murdoch and Kathleen E. Houlahan and Jianxin Wang and David R. Garcia and Richard de Borja and Ren X. Sun and Xihui Lin and Gregory M. Chen and Aileen Lu and Yu-Jia Shiah and Amin Zia and Ryan Kearns and Paul C. Boutros},
  title = {{BPG: Seamless, automated and interactive visualization of scientific data}},
  journal = {BMC Bioinformatics},
  year = {2019},
  doi = {10.1186/s12859-019-2610-2},
}
Figure