With a longer list of input arguments and advanced properties like conditionals, Pline’s interface rendering and command generation process is scalable to more complex programs. Examples of sophisticated interfaces can be found from the Wasabi web app \cite{Veidenberg2016} that uses Pline to draw interfaces for external tools into its graphical analysis environment.
Integration into Wasabi
As Pline consists of human-readable plain text files, the system is easy to customize. The appearance of the graphical interfaces can be changed by editing the style definitions in the CSS file and the Pline JavaScript library can be extended with custom functions to modify any step in the interface generation process. This flexibility is especially useful for integrating Pline into existing web pages.
As an example of extensive integration, we added Pline to Wasabi, a web-based environment for evolutionary sequence analyses
\cite{wasabi}. With Pline, we were able to integrate external analysis programs into Wasabi’s graphical interface as plugins without having to write program-specific interfaces and related code from scratch. Wasabi-specific features were added to the Pline interface generator as extensions. For example, an additional function in the plugin registration step makes a pop-up menu showing all the available plugins in Wasabi. Other additions automatically convert user-supplied files to the correct format, show the status updates of running programs in the Wasabi menu bar, and collects the resulting output files in an analysis database. The extensions are available as open-source software at
http://wasabiapp.org.
Since Wasabi is designed for evolutionary sequence analysis, the list of existing plugins include tools for related tasks: PRANK
\cite{Loytynoja2005}, PAGAN
\cite{Loytynoja2012} and MAFFT
\cite{Katoh2013} for multiple sequence alignment; FastTree
\cite{Price2010} for phylogenetic inference; CodeML
\cite{Yang2007} for tests of positive selection. Out of these examples, CodeML has the most complex interface and serves as a comprehensive example that utilizes a majority of the options available in the Pline API. The CodeML interface in Wasabi is shown in Figure
\ref{890860}. The CodeML plugin JSON (and therefore its interface) includes multiple presets – stored sets of pre-filled argument values – that are useful for running common configurations of selection models and related parameters. When users select a preset, the interface hides or reveals the relevant inputs, fills these with default values and enables the corresponding models from a set of tick boxes. When the user modifies an input that is part of the selected preset, the interface checks for dependencies and changes the preset selection as the combination of the input values no longer matches the initial preset. As an example of proxy inputs, the set of model selection tick boxes are converted to their corresponding command-line form as a single argument that consists of a string of numbers representing the selected model. As CodeML takes the input arguments through a configuration file, the "configfile" and "valuesep" properties in the JSON data instruct Pline to store the argument values as a newline-delimited text file and to launch the program with the file path as its only input argument.