NaRIBaS—A Scripting Framework for Computational Modeling of Nanomaterials and Room Temperature Ionic Liquids in Bulk and Slab

Computational modeling is more and more often used in studies of novel ionic liquids. The inevitable side-effect is the growing number of similar computations that require automation. This article introduces NaRIBaS (Nanomaterials and Room Temperature Ionic Liquids in Bulk and Slab)—a scripting framework that combines bash scripts with computational codes to ease modeling of nanomaterials and ionic liquids in bulk and slab. NaRIBaS helps to organize and document all input and output data, thus, improving the reproducibility of computations. Three examples are given to illustrate the NaRIBaS workflows for density functional theory (DFT) calculations of ionic pairs, molecular dynamics (MD) simulations of bulk ionic liquids (ILs), and MD simulations of ILs at an interface.


Introduction
Ionic liquids (ILs) are widely studied as electrolytes for electrochemical systems [1,2]. Herewith, the number of computational studies is comparable to the number of experimental works [1]. However, most of the simulations bypass the informatics techniques. For this reason, a large amount of working time is usually consumed by semi-manual repetition of computations, analyses, and visualization. A workflow by Qu et al. [3] takes over some of the routines to calculate properties of different battery electrolytes at the density functional theory (DFT) level. Our scripting framework-NaRIBaS also automates DFT calculations as well as molecular dynamics (MD) simulations.
It should be noted that there are many computational methods used to study IL varying from volume-based thermodynamics to DFT-based MD [4,5]. Common cheminformatics toolkits, for example, those listed in Reference [6], are not directly applicable to the MD simulations. While some software developers include tools for workflow creation, e.g., Amsterdam Density Functional (ADF) [7] or Desmond [8], others create similar tools that may be interfaced with various computational codes like those listed in Reference [6]. Such tools as Mbuild [9], Atomic Simulation Environment (ASE) [10], pysimm [11] or packmol [12] are useful for creating complex systems for MD simulations.
MDanalysis [13] or MDtraj [14] are useful for analyzing the MD trajectories. NaRIBaS (Nanomaterials and Room Temperature Ionic Liquids in Bulk and Slab) solves the intermediate problem of the automation of the MD simulations. It helps to organize all input and output data; ordering the input data improves the reproducibility of the computations; ordering the output data allows for advanced, massive data processing that cannot be obtained directly from a single computation result.
This article gives an overview of NaRIBaS-what it is, how it works, and what advantages it has to offer. It also describes how NaRIBaS can be used for DFT calculations of ionic pairs, MD simulations of bulk ILs, and MD simulations of ILs at an interface.

What is NaRIBaS?
NaRIBaS is a Unix-based scripting framework that combines bash scripts with computational codes to allow iterative repetition of tasks ( Figure 1). We started developing NaRIBaS to standardize our computational methodology and to make our research reproducible. Within NaRIBaS, several basic concepts (simplicity, transparency, parameter management through input lists) are combined to improve the productivity of a scientist. It is handy to use without much prior learning, and it is possible to trace errors during the preparation of a computation. With NaRIBaS, it takes less time to extend the setups or to re-use old scripts.
Let's assume that a usual computational project usually starts with reproducing a specific type of computation. Ideally, a defined set of input files allows reproduction of any computation, provided that the necessary software and hardware are available. At times reproduction could be a more laborious task than it should be due to the absence of a specific input. NaRIBaS stores all data in such a way that it can be easily found and identified even years later. Such on-the-fly documentation improves the reproducibility of the research.

How Does NaRIBaS Work?
A single computation requires a solid scientific knowledge. An extensive computation, especially in the high-throughput approach, demands programming know-how. NaRIBaS solves the problem of the extensive computations, namely, repetitive accessing, utilizing, and post-processing data ( Figure 2) via the implementation of the iterator pattern in bash language.
In NaRIBaS, the user provides the input parameters, e.g., physical properties and chemical structure, as lists. The iterator traverses the input data to create a configuration of the accessed elements. A loop is then started with a question that determines whether the iterator has found a new Figure 1. The general composition of the NaRIBaS (Nanomaterials and Room Temperature Ionic Liquids in Bulk and Slab) scripting framework. User-defined tasks-preparing input files, executing simulations, and managing output data-are carried out with properties read from the input lists.
Within NaRIBaS, several basic concepts (simplicity, transparency, parameter management through input lists) are combined to improve the productivity of a scientist. It is handy to use without much prior learning, and it is possible to trace errors during the preparation of a computation. With NaRIBaS, it takes less time to extend the setups or to re-use old scripts.
Let's assume that a usual computational project usually starts with reproducing a specific type of computation. Ideally, a defined set of input files allows reproduction of any computation, provided that the necessary software and hardware are available. At times reproduction could be a more laborious task than it should be due to the absence of a specific input. NaRIBaS stores all data in such a way that it can be easily found and identified even years later. Such on-the-fly documentation improves the reproducibility of the research.

How Does NaRIBaS Work?
A single computation requires a solid scientific knowledge. An extensive computation, especially in the high-throughput approach, demands programming know-how. NaRIBaS solves the problem of the extensive computations, namely, repetitive accessing, utilizing, and post-processing data ( Figure 2) via the implementation of the iterator pattern in bash language.
In NaRIBaS, the user provides the input parameters, e.g., physical properties and chemical structure, as lists. The iterator traverses the input data to create a configuration of the accessed Computation 2018, 6, 57 3 of 9 elements. A loop is then started with a question that determines whether the iterator has found a new configuration. Each configuration is used to perform user-defined tasks, e.g., computation and plotting routines. Thus, NaRIBaS decouples the input parameters (lists) from the terminal-based command lines (tasks) and considers them as independent, reusable building blocks, held together by a linking function. configuration. Each configuration is used to perform user-defined tasks, e.g., computation and plotting routines. Thus, NaRIBaS decouples the input parameters (lists) from the terminal-based command lines (tasks) and considers them as independent, reusable building blocks, held together by a linking function.

Main Features of NaRIBaS
Using and modifying NaRIBaS scripts does not require advanced knowledge of programming techniques. The extension of NaRIBaS relies on the addition and modification of tasks, which are merely a handy collection of command lines.
Automatization of the work processes is a huge time saver. Every researcher confronts the repetition of tasks with variable parameters. The manual execution of repetitive tasks is tiresome and time-consuming. Also, it makes the occurrence of abstraction of the data and mistakes likely to occur. Whereas, once an automatized routine is tested and approved, the computer repeats the tasks without errors.
The construction of NaRIBaS impels the user to solve every task through a script, to define all parameters in lists, and to prepare the computation template files. Thus, NaRIBaS forces documentation in such a way that the user-created NaRIBaS tasks, lists, and template files represent the whole work process, including the details of applied computation schemes or external code as well as the storage of the results.
The key ingredient of a robust data handling is awareness of the parameter space and its possibilities for extensions. In NaRIBaS, management of input parameters is done through lists that make information about the project easily accessible (not hidden in the middle of a script containing nested loops) and available for manipulation.
NaRIBaS stores data files in well-defined folder trees. Thus, it clarifies dependencies of data files and minimizes the risk of data loss. Compared to a super-folder containing hundreds of files, a small number of items in a folder improves the concentration on the given content.

Main Features of NaRIBaS
Using and modifying NaRIBaS scripts does not require advanced knowledge of programming techniques. The extension of NaRIBaS relies on the addition and modification of tasks, which are merely a handy collection of command lines.
Automatization of the work processes is a huge time saver. Every researcher confronts the repetition of tasks with variable parameters. The manual execution of repetitive tasks is tiresome and time-consuming. Also, it makes the occurrence of abstraction of the data and mistakes likely to occur. Whereas, once an automatized routine is tested and approved, the computer repeats the tasks without errors.
The construction of NaRIBaS impels the user to solve every task through a script, to define all parameters in lists, and to prepare the computation template files. Thus, NaRIBaS forces documentation in such a way that the user-created NaRIBaS tasks, lists, and template files represent the whole work process, including the details of applied computation schemes or external code as well as the storage of the results.
The key ingredient of a robust data handling is awareness of the parameter space and its possibilities for extensions. In NaRIBaS, management of input parameters is done through lists that make information about the project easily accessible (not hidden in the middle of a script containing nested loops) and available for manipulation. NaRIBaS stores data files in well-defined folder trees. Thus, it clarifies dependencies of data files and minimizes the risk of data loss. Compared to a super-folder containing hundreds of files, a small number of items in a folder improves the concentration on the given content.
NaRIBaS simplifies further research, as the existing lists allow the reproduction of all the results. Therefore, further research on the topics are made plain as the input parameters can be modified easily to prepare new computational workflows.
NaRIBaS is free software. The entire NaRIBaS script package is available under the GNU General Public License. For details, check the COPYING file in the source code or consult (Reference [15]).

NaRIBaS in Action
The full technical details of the examples provided below are available on GitHub [16]. Each example includes a figure illustrating the corresponding workflow.

DFT Calculations
The so-called high-throughput approach has become popular with the increase in overall computational power. In high-throughput screening, a large number of candidates are filtered using simple descriptors to design task-specific materials. DFT is often the method of choice for calculating the descriptors, as DFT is both fast and accurate [3,17,18].
The workflow in Figure 3 demonstrates how to automate DFT calculations of IL ion pairs. There is a vast amount of possible combinations of cations and anions that are potentially useful in practical application [19]. Moreover, there are many basis sets, functionals as well as computational approximations [20]. NaRIBaS is a suitable tool for such combinatorial exercise; it can be used for conducting repetitive calculations and organizing systematic data storage. Furthermore, the flexible task routines can serve different purposes with only minor retuning, as in References [19][20][21]. NaRIBaS simplifies further research, as the existing lists allow the reproduction of all the results. Therefore, further research on the topics are made plain as the input parameters can be modified easily to prepare new computational workflows.
NaRIBaS is free software. The entire NaRIBaS script package is available under the GNU General Public License. For details, check the COPYING file in the source code or consult (Reference [15]).

NaRIBaS in Action
The full technical details of the examples provided below are available on GitHub [16]. Each example includes a figure illustrating the corresponding workflow.

DFT Calculations
The so-called high-throughput approach has become popular with the increase in overall computational power. In high-throughput screening, a large number of candidates are filtered using simple descriptors to design task-specific materials. DFT is often the method of choice for calculating the descriptors, as DFT is both fast and accurate [3,17,18].
The workflow in Figure 3 demonstrates how to automate DFT calculations of IL ion pairs. There is a vast amount of possible combinations of cations and anions that are potentially useful in practical application [19]. Moreover, there are many basis sets, functionals as well as computational approximations [20]. NaRIBaS is a suitable tool for such combinatorial exercise; it can be used for conducting repetitive calculations and organizing systematic data storage. Furthermore, the flexible task routines can serve different purposes with only minor retuning, as in References [19][20][21]. In Reference [19], we applied the NaRIBaS workflow from Figure 3 to predict the relative electrochemical stabilities and the activation energies of the viscosity of 48 ILs. NaRIBaS looped over 48 ion pairs, which were constructed by combining 4 anions and 12 cations defined in the corresponding input lists. The first and the second NaRIBaS tasks were responsible for creating all the necessary input files, invoking the calculation code, and storing the results in an organized manner. In the third task, relevant properties were condensed in a database format, which was then used to conduct the analysis. All calculations were run using the Orca 4 package [22]. Further details are given in References [19,20,23].
In Reference [20], we used the same NaRIBaS workflow to assess the performance of several DFT-based computational methods. A similar set of 48 ion pairs were used. In addition to the cations and the anions, the input lists also iterated over the different applied functionals and corrections. We used the same tasks as in Reference [19], with only a few changes in the input file templates and the In Reference [19], we applied the NaRIBaS workflow from Figure 3 to predict the relative electrochemical stabilities and the activation energies of the viscosity of 48 ILs. NaRIBaS looped over 48 ion pairs, which were constructed by combining 4 anions and 12 cations defined in the corresponding input lists. The first and the second NaRIBaS tasks were responsible for creating all the necessary input files, invoking the calculation code, and storing the results in an organized manner. In the third task, relevant properties were condensed in a database format, which was then used to conduct the analysis. All calculations were run using the Orca 4 package [22]. Further details are given in References [19,20,23].
In Reference [20], we used the same NaRIBaS workflow to assess the performance of several DFT-based computational methods. A similar set of 48 ion pairs were used. In addition to the cations and the anions, the input lists also iterated over the different applied functionals and corrections. We used the same tasks as in Reference [19], with only a few changes in the input file templates and the choice of properties of interest. The calculation results were again gathered in the database to facilitate the subsequent analysis [23].
A sample workflow for similar calculations is provided in the IL-DFT folder of the NaRIBaS GitHub repository (Reference [16]) The first task of IL-DFT is responsible geometry optimization; the second task executes single point calculations and the third task indexes some properties of interest in a json-format database. Note that the second step uses a different input list for functionals, as geometry optimization is only done once, but single point energies are found with multiple different functionals. Sample results and the Python script responsible for indexing results are included therein as an archive due to GitHub restrictions.

MD Simulations of Ionic Liquid in Bulk
Modern MD simulations consist of a large number of initial configurations, independent runs, and replicas. They require a lot of routine actions that consume much time if made by hand. The workflow in Figure 4 demonstrates how to proceed with MD simulations and analyses in an automated fashion. choice of properties of interest. The calculation results were again gathered in the database to facilitate the subsequent analysis [23]. A sample workflow for similar calculations is provided in the IL-DFT folder of the NaRIBaS GitHub repository (Reference [16]) The first task of IL-DFT is responsible geometry optimization; the second task executes single point calculations and the third task indexes some properties of interest in a json-format database. Note that the second step uses a different input list for functionals, as geometry optimization is only done once, but single point energies are found with multiple different functionals. Sample results and the Python script responsible for indexing results are included therein as an archive due to GitHub restrictions.

MD Simulations of Ionic Liquid in Bulk
Modern MD simulations consist of a large number of initial configurations, independent runs, and replicas. They require a lot of routine actions that consume much time if made by hand. The workflow in Figure 4 demonstrates how to proceed with MD simulations and analyses in an automated fashion.
In work [24], we used the NaRIBaS workflow from Figure 4 to mix up to three types of ions into liquid mixtures and then simulate their properties. To introduce NaRIBaS, we choose Gromacs software package, version 5.1.4. [25]. In principle, NaRIBaS can be interfaced with any code that is executed from a command line and that uses text files as inputs, such as LAMMPS [26] or DLPOLY [27]. The description of ions, as well as other details, were defined in the input lists. For convenience, we used predefined topologies, which can be used as they are [28]. The four steps of MD simulations were intended (Figure 4): initiation of the system, equilibration, production and analysis. The first step (the initiation) consisted of packing the chosen ions-one cation and three pairs of anions-in a simulation cell with Packmol [12]. The size of the cell was evaluated automatically according to the molar volume of the ions. The energy minimization of the resulted cell was calculated with the steepest descent method. Then, a short run in NVT ensemble with low time step (0.5 fs) allowed the necessary relaxation of the system. The initiation was followed by the next steps: the equilibration, the production run and finally the analysis. The basic analysis, in this case, consisted of the density calculation, yet, any type of analyses can be chosen according to specific needs of a study. A sample workflow for conducting similar simulations is provided in the IL-mix folder of the NaRIBaS GitHub repository (Reference  In work [24], we used the NaRIBaS workflow from Figure 4 to mix up to three types of ions into liquid mixtures and then simulate their properties. To introduce NaRIBaS, we choose Gromacs software package, version 5.1.4. [25]. In principle, NaRIBaS can be interfaced with any code that is executed from a command line and that uses text files as inputs, such as LAMMPS [26] or DLPOLY [27]. The description of ions, as well as other details, were defined in the input lists. For convenience, we used predefined topologies, which can be used as they are [28]. The four steps of MD simulations were intended (Figure 4): initiation of the system, equilibration, production and analysis. The first step (the initiation) consisted of packing the chosen ions-one cation and three pairs of anions-in a simulation cell with Packmol [12]. The size of the cell was evaluated automatically according to the molar volume of the ions. The energy minimization of the resulted cell was calculated with the steepest descent method. Then, a short run in NVT ensemble with low time step (0.5 fs) allowed the necessary relaxation of the system. The initiation was followed by the next steps: the equilibration, the production run and finally the analysis. The basic analysis, in this case, consisted of the density calculation, yet, any type of analyses can be chosen according to specific needs of a study. A sample workflow for conducting similar simulations is provided in the IL-mix folder of the NaRIBaS GitHub repository (Reference [15]).

MD Simulations of Ionic Liquid at Interfaces
MD simulations of IL confined between charged electrodes are used, for example, for investigation of the electrical double layer structure [29][30][31], estimation of differential capacitance of the system [32][33][34], or investigation of the dynamics within confinement [35][36][37]. Due to a significant number of variables in such systems, the dozens of configurations and replicas are needed to reduce the observational error. NaRIBaS proposes a reliable and straightforward approach to this kind of computation as well as to similar high-throughput analogues.
Similar to the simulations in bulk, all parameters were defined in the input lists, including the number and type of IL ions, type of probe (Lennard-Jones sphere or ion), number and type of electrode atoms, simulation temperature and surface charge density values. Gromacs 5.1.4 was used in all simulations 5.1.4. [25]. The schematic representation of NaRIBaS workflow is demonstrated in Figure 5.

MD Simulations of Ionic Liquid at Interfaces
MD simulations of IL confined between charged electrodes are used, for example, for investigation of the electrical double layer structure [29][30][31], estimation of differential capacitance of the system [32][33][34], or investigation of the dynamics within confinement [35][36][37]. Due to a significant number of variables in such systems, the dozens of configurations and replicas are needed to reduce the observational error. NaRIBaS proposes a reliable and straightforward approach to this kind of computation as well as to similar high-throughput analogues.
Similar to the simulations in bulk, all parameters were defined in the input lists, including the number and type of IL ions, type of probe (Lennard-Jones sphere or ion), number and type of electrode atoms, simulation temperature and surface charge density values. Gromacs 5.1.4 was used in all simulations 5.1.4. [25]. The schematic representation of NaRIBaS workflow is demonstrated in Figure 5. In References [38][39][40], we applied the NaRIBaS workflow to calculate free energy profiles for probes approaching graphene electrodes in various ILs. The probes-charged ions-were pulled through the interface towards the surface and, as a result of the measured force integration; the free energy profiles were calculated. Four steps of MD simulation were run: Initiation and equilibration, charging, production run, and analyses. For each IL a different number of ion pairs were considered, according to physical properties of the IL. A spherical probe was introduced into the IL at certain distances from the electrode surface. For each distance, 3-8 independent replicas were prepared. After initial packing and relaxation, the charging was performed, followed by the production run, and then finally, the analyses. Generally, these steps were similar to those depicted in Figure 4, except for charging-five surface charge values were simulated (±1, ±0.5, and 0 e/nm 2 ). All the calculations were run in NVT ensemble in slab-like geometry. The basic analysis included the calculation of number density and electrostatic potential. On top of that, the free energy profiles were calculated.
The tasks used in works [38][39][40] are similar and contain only small changes in the user-defined templates and the properties of interest. The slight change in the workflow-from Lennard-Jones probe to actual ions-allowed, with minimal manual adjusting, for reuse of the same code to get more profound ideas about mechanisms of solvent-mediated ion interactions with charged surfaces in ILs. Similarly, NaRIBaS was used to investigate the nature of capacitance vs potential dependence in ILs [41][42][43][44]. Such a versatile character constitutes the great potential of frameworks like NaRIBaS for MD simulation applications. A sample workflow with further details is provided in the IL-probe folder of the NaRIBaS GitHub repository (Reference [16]). In References [38][39][40], we applied the NaRIBaS workflow to calculate free energy profiles for probes approaching graphene electrodes in various ILs. The probes-charged ions-were pulled through the interface towards the surface and, as a result of the measured force integration; the free energy profiles were calculated. Four steps of MD simulation were run: Initiation and equilibration, charging, production run, and analyses. For each IL a different number of ion pairs were considered, according to physical properties of the IL. A spherical probe was introduced into the IL at certain distances from the electrode surface. For each distance, 3-8 independent replicas were prepared. After initial packing and relaxation, the charging was performed, followed by the production run, and then finally, the analyses. Generally, these steps were similar to those depicted in Figure 4, except for charging-five surface charge values were simulated (±1, ±0.5, and 0 e/nm 2 ). All the calculations were run in NVT ensemble in slab-like geometry. The basic analysis included the calculation of number density and electrostatic potential. On top of that, the free energy profiles were calculated.
The tasks used in works [38][39][40] are similar and contain only small changes in the user-defined templates and the properties of interest. The slight change in the workflow-from Lennard-Jones probe to actual ions-allowed, with minimal manual adjusting, for reuse of the same code to get more profound ideas about mechanisms of solvent-mediated ion interactions with charged surfaces in ILs. Similarly, NaRIBaS was used to investigate the nature of capacitance vs potential dependence in ILs [41][42][43][44]. Such a versatile character constitutes the great potential of frameworks like NaRIBaS for MD simulation applications. A sample workflow with further details is provided in the IL-probe folder of the NaRIBaS GitHub repository (Reference [16]).

Concluding Remarks
NaRIBaS is a scripting framework for computational modeling of nanomaterials and ionic liquids in bulk and slab. It is a valuable tool for automation and documentation of the computations. In addition to saving resources and nerves, NaRIBaS may reduce the occurrence of abstraction of the data and human mistakes. The capabilities of NaRIBaS can be tested in density functional calculations and molecular dynamics simulations by re-using the above described NaRIBaS workflows from Reference [16].