Abstract
Many R packages have been developed for transcriptome analysis but their use often requires familiarity with R and integrating results of different packages is difficult. Here we present PIVOT, an R-based application with a uniform user interface and graphical data management that allows non-programmers to conveniently access various bioinformatics tools and interactively explore transcriptomics data. PIVOT supports many popular open source packages for transcriptome analysis and provides an extensive set of tools for statistical data manipulations. A graph-based visual interface is used to represent the links between derived datasets, allowing easy tracking of data versions. PIVOT further supports automatic report generation, publication-quality plots, and program/data state saving, such that all analysis can be saved, shared and reproduced.
Introduction
Technologies such as RNA-sequencing and microarray measure gene expressions and present them as high-dimensional expression matrixes for downstream analyses. In recent years, many programs have been developed for the statistical analysis of transcriptomics data, such as edgeR [1] and DESeq [2] for differential expression testing, and monocle [3], Seurat [4] and SCDE [5] for single cell RNA-Seq data analysis. Besides these, the Comprehensive R Archive Network (CRAN) [6] and Bioconductor [7] host various statistical packages addressing different aspects of transcriptomics study and provides recipes for a multitude of analysis workflows. Making use of these R analysis packages requires expertise in R and often custom scripts to integrate the results of different packages. In addition, many exploratory analyses of transcriptome data involve repeated data manipulations such as transformations (e.g., normalizations), filtering, merging, etc., each step generating a derived dataset whose version and provenance must be tracked. Previous efforts to address these problems include designing standardized workflows [8], building a comprehensive package [4] or assembling pipelines into integrative platforms such as Galaxy [9] or Illumina BaseSpace [10]. Designing workflows or using large packages still requires a significant amount of programming skills and it can be difficult to make various components compatible or applicable to specific datasets. Integrative platforms offer greater usability but trades off flexibility, functionality and efficiency due to limitations on data size, parameter choice and computing power. For example, the Galaxy platform is designed as discrete functional modules which require separate file inputs for different analysis. This design not only makes user-end file format conversion complicated and time-consuming, but also breaks the integrity of the analysis workflow, limiting the sharing of global parameters, filtering criteria and analysis results between modules. Tools such as ASAP [11] and DEApp [12] provides an interactive graphical interface for a small number of packages. But, these and other similar packages all adopt a rigid workflow design and have limited data provenance tracking, and none of the packages provide mechanisms for saving, sharing and reproducing analysis results. Furthermore, many web-based applications require users to upload data to a server, which might be prohibited by HIPPA (Health Insurance Portability and Accountability Act of 1996) for clinical data analysis.
Here we developed PIVOT, an R-based platform for exploratory transcriptome data analysis. We leverage the Shiny framework [13] to bridge open source R packages and JavaScript-based web applications, and to design a user-friendly graphical interface that is consistent across statistical packages. The Shiny framework translates user-driven events (e.g. pressing buttons) into R interpretable reactive data objects, and present results as dynamic web content. PIVOT incorporates four key features that assists user interactions, integrative analysis and provenance management:
PIVOT directly integrates existing open source packages by wrapping the packages with a uniform user-interface and visual output displays. The user interface replaces command line options of many packages with menus, sliders, and other option controls, while the visual outputs provide extra interactive features such as change of view, active objects, and other user selectable tools.
PIVOT provides many tools to manipulate a dataset to derive new datasets including different ways to normalize a dataset, subset a dataset, etc. In particular, PIVOT supports manipulating the datasets using the results of an analysis; for example, an user might use the results of differential gene expression analysis to select all gene satisfying some p-value filter. PIVOT implements a visual data management system, which allows users to create multiple data views and graphically display the linked relationship between data variants, allowing navigation through derived data objects and automated re-analysis.
PIVOT dynamically bridges analysis modules to allow results from one module being used as inputs for another. Thus, it provides a flexible framework for users to combine tools into customizable pipelines for various analysis purposes.
PIVOT provides facilities to automatically generate reports, publication-quality figures, and reproducible computations. All analyses and data generated in an interactive session can be packaged as a single R object that can be shared to exactly reproduce any results.
Methods
Data Input and Transformations
Read counts obtained from RNA-Seq quantification tools such as HTSeq [14] or featureCounts [15] can be directly uploaded into PIVOT as text, csv or Excel files. PIVOT automatically merges sample counts into an expression matrix and performs user selected data transformations including normalization, log transformation, or standardization. We have included multiple RNA-Seq data normalization methods including DESeq normalization [16], trimmed mean of M-values (TMM) [17], quantile normalization [18], RPKM/TPM [19], Census normalization [20], and Remove Unwanted Variation (RUVg) [21] (Table 1). If samples contain spike-in control mixes such as ERCC [22], PIVOT will also separately analyze the ERCC count distribution and allow users to normalize the data using the ERCC control. Existing methods can be customized by the user by setting detailed normalization parameters. For example, we implement a modification of the DESeq method by making the inclusion criterion a user set parameter, making it more applicable to sparse expression matrices such as single cell RNA-Seq data [23].
Users can upload experiment design information such as conditions and batches, which can be visualized as annotation attributes (e.g., color points/sidebars) or used as model specification variables for downstream analyses such as differential expression. PIVOT supports flexible operations to filter data for row and column subsets as well as for merging datasets, creating new derived datasets. Multiple summary statistics are automatically computed to help users identify possible outliers. Users can manually select samples for analysis, or specify statistical criteria on analysis results such as expression threshold, dispersion cutoff, Cook’s distance or size factor range to remove unwanted features and samples.
Visual Data Management with Data Map
When analyzing large datasets, a common procedure is to first perform quality control to remove low quality elements, then normalize the data and finally generate different data subsets for various analysis purposes. Some analyses require filtering out genes with low expressions, while others are designed to be performed on a subset of the genes such as transcription factors. During secondary analyses, outliers may be detected requiring additional scrutiny. All these data manipulations generate a network of derived datasets from the original data and require a significant amount of effort to track. Failure to track the data lineage could affect the reproducibility and reliability of the study. Furthermore, an investigator might wish to repeat an analysis over a variety of derived datasets, which may be tedious and error-prone to carry out manually. To address this problem, we implemented a graphical data management system in PIVOT.
As the user generates derived datasets with various data manipulations, PIVOT records and presents the data provenance in an interactive tree graph, the “Data Map”. As shown in Figure 1, each node in the data map represents a derived dataset and the edges contain information about the details of the derivation operation. Users can attach analysis results to the data nodes as interactive R markdown reports [24] and switch between different datasets or retrieve analysis reports by simply clicking the nodes. Upon switch to a new dataset selected from the Data Map, PIVOT automatically re-runs analyses and updates parameter choices when needed. Thus, a user can easily compare results of a workflow across derived datasets. The data map is generated with the visNetwork package [25] and can be directly edited, so that users can rename nodes, add notes, or delete data subsets and analysis reports that are no longer useful. The full data history is also presented as downloadable tables with all sample and feature information as well as data manipulation details.
Comprehensive Toolset for Exploratory Analysis
PIVOT is designed to aid exploratory analysis for both single cell and bulk RNA-Seq data, thus we have incorporated a large set of commonly used tools (see Table 1). PIVOT supports many visual data analytics including QC plots (number of detected genes, total read counts and estimated size factors; Fig. 2a, data from [26]), transcriptome statistics plots (e.g., rank-frequency plots, mean-variability plots, etc; Fig. 2b), and sample and feature correlation plots (e.g., heatmaps, smoothened scatter plots, etc.). All visual plots feature interactive options and a query function is provided which allows users to search for features sharing similar expression patterns with a target feature. PIVOT provides users extensive control over parameter choices. Each analysis module contains multiple visual controls allowing users to adjust parameters and obtain updated results on the fly.
Integrative Analysis and Interactive Visualization
PIVOT transparently bridges multiple sequences of analyses to form customizable analysis pipelines. For example, with single cell data collected from heterogeneous tumor or tissue, a user can first perform PCA or t-SNE [27] (Fig. 2c) to visualize the low dimensional embedding of the data. If there is clear clustering pattern, possibly originated from different cell types, the user can directly specify cell clusters by dragging selection boxes on the graph, or perform K-means or hierarchical clustering with the projection matrix. One can proceed to run DE or penalized LDA [28] to identify cluster-specific marker genes, which can then be used to filter the datasets for generating a heatmap showing distinctive expression pattern across cell types (Fig. 2d). Within each determined cell type, a user may further apply the walk-trap community detection method [29] to identify densely connected network of cells, which are indicative of potential subpopulations [30].
As another example, for time-series data such as cells collected at different stages of development or differentiation, one can use monocle [3], which implements an unsupervised algorithm for pseudo-temporal ordering of single cells [31]. We have incorporated the latest monocle 2 workflow in PIVOT, including cell state ordering, unsupervised cell clustering, gene clustering by pseudo-temporal expression pattern and cell trajectory analysis. Besides the DE method implemented in monocle, one can also run DESeq, edgeR, SCDE or the Mann-Whitney U test. A user can specify whether to perform basic DE analysis or a multi-factorial DE analysis with customized formulae for complex experimental designs such as time-series or controlling for batch effects. Results are presented as dynamic tables including all essential statistics such as maximum likelihood estimation and confidence intervals. Each gene entry in the table can be clicked and visualized as violin plots or box plots, showing the actual expression level across conditions. Once DE results are obtained, the user can further explore the connections between DE genes and identify potential trans-differentiation factors as introduced in the Mogrify algorithm [32]. PIVOT provides several extensions of functionality from the original Mogrify method. The network analysis module allows users to plot the log fold changes (LFC) of DE genes in a protein-protein interaction network obtained from the STRING database (Fig. 3a) [33] or a directed regulatory network graph constructed from the Regnetwork repository (Fig. 3b) [34]. With scoring based on the p-value and log fold change, the graph can be zoomed to only include top-rank genes, showing the regulatory “hot spot” of the network. PIVOT provides users with multiple options for defining the network influence score of transcription factors, and will produce lists of potential trans-differentiation factors based on the final ranking. As shown in Fig. 3c, with the FANTOM5 expression data of fibroblasts and ES cells [35], PIVOT correctly reports OCT4 (POU5F1), NANOG and SOX2 as key factors for trans-differentiation [36]. In addition to the DESeq results used by the original Mogrify algorithm, a user can choose to use SCDE or edgeR results to perform trans-differentiation analysis on single cell datasets.
Another useful feature of PIVOT is that it provides users multiple visualization options by exploiting the power of various plotting packages. For example, users can either generate publication-quality heatmap graphs (implemented in gplots package [37]), or interactively explore the heatmap with the heatmaply view [38]. For principal component analysis, PIVOT uses three different packages to present the 2D and 3D projections. The plotly package [39] displays sample names and relevant information as mouse-over labels, while the ggbiplot [40] presents the loadings of each gene on the graph as vectors. The threejs package [41] fully utilizes the power of WebGL and outputs rotatable 3D projections. In the network analysis module, we utilize both igraph [42] and networkD3 [43] package to plot the transcription factor centered local network. The latter provides a force directed layout, which allows users to drag the nodes and visualize the physical simulation of the network response.
Reproducible Research and Complete Provenance Capture
PIVOT automatically records all data manipulations and analysis steps. Once an analysis has been performed, users will have the option of pasting related R markdown code to a shinyAce report editor [44], or download the report as either a pdf or interactive html document. All results and associated parameters will be captured and saved to the report along with user-provided comments. PIVOT states are automatically saved in cases of browser refresh, crash or user exit, and can also be manually exported, shared and loaded. Thus, all analyses performed in PIVOT are fully encapsulated and can be shared or disseminated as a single data+provenance object, allowing universally reproducible research.
Implementation
PIVOT is written in R and is distributed as an R package. It is developed using the Shiny framework, multiple R packages and a collection of scripts written by members of J. Kim’s Lab at University of Pennsylvania. PIVOT exports multiple Shiny modules [45] which can be used as design blocks for other Shiny apps, as well as R functions for transcriptomics analysis and plotting. A proficient R user can easily access data objects, analysis parameters and results exported by PIVOT and use them in customized scripts. PIVOT has been tested on macOS, Linux and Windows. It can be downloaded from Kim Lab Software Repository (http://kim.bio.upenn.edu/software) or GitHub (https://github.com/qinzhu/PIVOT).
Discussion and conclusions
We developed PIVOT for easy, fast, and exploratory analysis of the transcriptomics data.
Toward this goal we have automated the analysis procedures and data management, and we provide users with detailed explanations both in tooltips and a user manual. PIVOT exploits the power of multiple plotting packages and gives users full control of key analysis and plotting parameters. Given user input that leads to function errors, PIVOT will alert the user and provide corrective suggestions. PIVOT states and reports can be shared between researchers to facilitate the discussion of expression analysis and future experimental design. PIVOT is designed to be extensible and future versions will continue to integrate popular transcriptome analysis routines as they are made available to the research community.
Abbreviations
- PIVOT
- Platform for Interactive analysis and Visualization Of Transcriptomics data
- TMM
- trimmed mean of M-values
- RPKM
- Reads Per Kilobase per Million mapped reads
- RUV
- remove unwanted variation
- DE
- differential expression
- GUI
- graphical user interfaces
- PCA
- principal component analysis
- t-SNE
- t-Distributed Stochastic Neighbor Embedding
- LDA
- linear discriminant analysis
- MDS
- multidimensional scaling
- ES cells
- Embryonic stem cells
- TF
- transcription factor
- LFC
- log fold change
Declarations
Acknowledgements
We are grateful to all members in Junhyong Kim’s lab and James Eberwine’s lab for their participation in the beta-testing of the program and their valuable feedbacks and suggestions. This research has been supported by NIMH U01MH098953 grant to J. Kim and J. Eberwine.
Availability of data and materials
Project name: PIVOT
Project home page: http://kim.bio.upenn.edu/software/pivot.shtml Operating systems: macOS, Linux, Windows.
Programming language: R
Other requirements: Dependent R packages.
License: GNU.
Funding
This work has been supported by NIMH grant U01MH098953 to J. Kim and J. Eberwine.
Authors’ contributions
QZ carried out the programming tasks. QZ, SF and JK designed the application. SF, HD, SM and MK contributed scripts and extensive software testing. QZ, SF and JK wrote the manuscript.
Competing interests
The authors declare that they have no competing interests. No ethics approval was required for this work.