# Software for biogas research: Tools for measurement and prediction of methane production

Sasha D. Hafner, Konrad Koch, Hélène Carrère, Sergi Astals, Sören Weinrich, Charlotte Rennuit

► To cite this version:

Sasha D. Hafner, Konrad Koch, Hélène Carrère, Sergi Astals, Sören Weinrich, et al., Software for biogas research: Tools for measurement and prediction of methane production. SoftwareX, 2018, 7, pp.205-210. 10.1016/j.softx.2018.06.005. hal-02622100

HAL Id: hal-02622100

https://hal.inrae.fr/hal-02622100

Submitted on 26 May 2020

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

Original Software Publication

# Software for biogas research: Tools for measurement and prediction of methane production

<figure><img src="image_3.png" /></figure>

Check for
updates

Sasha D. Hafner<sup>a,*</sup>, Konrad Koch<sup>b</sup>, Hélène Carrere<sup>c</sup>, Sergi Astals<sup>d</sup>, Sören Weinrich<sup>e</sup>,
Charlotte Rennuit<sup>f</sup>

## ARTICLE INFO

**Article history:**

Received 3 January 2018

Received in revised form 27 June 2018

Accepted 27 June 2018

**Keywords:**

Anaerobic digestion

Biochemical methane potential

Data processing

Microbial stoichiometry

## ABSTRACT

Biogas production from organic materials by anaerobic digestion is both a developed technology and an active area of research. In this contribution we describe an R package designed to help standardize biogas research. A web-based application provides access to the main functions. The software can be used to accurately calculate biochemical methane potential (BMP) from a range of biogas measurement types. Additionally, methane potential can be predicted from substrate composition, facilitating experimental design and interpretation of results. By providing access to flexible, efficient, standardized, and transparent algorithms, this software may make biogas research more accurate and efficient.

© 2018 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).

## Code metadata

Current code version

Permanent link to code/repository used for this code version

Legal Code License

Code versioning system used

Software code languages, tools, and services used

Compilation requirements, operating environments

If available Link to developer documentation/manual

Support email for questions

1.10.3

https://CRAN.R-project.org/package=biogas

GPL-2

git

R

Compilation not required; Windows, Mac OSX, Linux

https://cran.r-project.org/web/packages/biogas/biogas.pdf

sasha.hafner@eng.au.dk

## 1. Motivation and significance

Anaerobic digestion is an established technology for the stabilization of organic materials and production of renewable energy. Energy is recovered in the form of biogas (a mixture of methane ($CH_4$) and carbon dioxide ($CO_2$)), and optimization of biogas production is an active area of research [1]. Research on anaerobic digestion includes laboratory and pilot-scale experiments, as well

as theoretical calculations and process modeling. Laboratory experiments are used to determine how much $CH_4$ can be obtained from a particular substrate, or to study the effect of a particular treatment [2,3]. Many of these experiments use biochemical methane potential (BMP) tests to estimate the maximum quantity of $CH_4$ that can be obtained. Transformation of laboratory measurements into BMP is done using a sequence of simple calculations [4]. Although conceptually simple, calculations differ among groups, and are seldom described in detail in publications, leading to a lack of reproducibility and a high likelihood of systematic bias in results. Many groups use custom spreadsheet templates for calculations.

<footnote><sup>a</sup> Department of Engineering, Aarhus University, Finlandsgade 12, 8200 Aarhus N, Denmark</footnote>

<footnote><sup>b</sup> Chair of Urban Water Systems Engineering, Technical University of Munich, Am Coulombwall 3, 85748 Garching, Germany</footnote>

<footnote><sup>c</sup> LBE, University of Montpellier, INRA, 11100 Narbonne, France</footnote>

<footnote><sup>d</sup> Advanced Water Management Centre, The University of Queensland, Brisbane, QLD 4072, Australia</footnote>

<footnote><sup>e</sup> Biochemical Conversion Department, DBFZ Deutsches Biomasseforschungszentrum gemeinnützige GmbH, Torgauer Str. 116, 04347 Leipzig, Germany</footnote>

<footnote><sup>f</sup> University of Southern Denmark, Campusvej 55, 5230 Odense M, Denmark</footnote>

<footnote>* Corresponding author.</footnote>

<footnote>E-mail address: sasha.hafner@eng.au.dk (S.D. Hafner).</footnote>
Prediction of CH₄ production can be carried out using substrate composition (simple stoichiometry) but there are multiple steps involved [5]. A simple means of quickly making these calculations would facilitate the design of experiments as well as evaluation and interpretation of results. In this contribution, we describe a package for the R environment [6] that addresses these problems and needs: the biogas package [7].

## 2. Software description

The biogas package is written in R and can be used directly in the R environment. The heart of the package is a set of ten functions, which require some proficiency in R for use. However, a web-based interface called OBA (from Online Biogas App, https://biotransformers.shinyapps.io/oba1/) provides access to the main functions, albeit with less flexibility.

### 2.1. Software architecture

Package functions can be divided into three groups: (1) basic vectorized functions for common conversions and calculations, (2) two data processing functions that calculate BMP or similar results from laboratory measurements, and (3) a function for predicting CH₄ production.

### 2.2. Software functionality

#### 2.2.1. Basic functions

Seven functions (Table 1) assist with data processing and experimental design, and are used by the data processing functions (Section 2.2.2). Most perform a conversion of an input vector (the first argument), and are vectorized. And most include optional arguments, making them both flexible and convenient.

The `stdVol()` function is used for converting measured gas volume or pressure into a standardized volume that corresponds to a fixed quantity (44.72 mmol or 717.4 mg CH₄ per L under standard conditions of 0°C and 1.0 atm, as calculated using the `vol2mol()` function). Standardized volume is often referred to as normal volume, and given in publications without details on the standardization conditions. However, because of inconsistency in the use of terms, correction for water vapor, and standard conditions (IUPAC now uses 1 bar = 0.9869 atm [8]), it is prudent to simply provide the conditions used for standardization. Standard conditions in the biogas package are 0°C and 1.0 atm (101.325 kPa) by default, but can be set by the user in a function call or globally. Accurate standardization requires correction for water vapor, pressure, and temperature [9,10]. Water vapor content is based on saturation vapor pressure by default, and is calculated using a Magnus form equation [11]. This function can be used for volumetric (typically fixed pressure and variable volume) or manometric measurements (typically fixed volume and variable pressure). Multiple temperature and pressure units are supported (°C, °F, K, atm, kPa, bar, and others). Unit conversion is carried out by the hidden function `unitConvert()`.

Two functions convert between biogas mass and volume: `mass2vol()` and `vol2mass()`. These functions are intended for gravimetric measurement of biogas production (`mass2vol()`), and checking for leaks (`vol2mass()`). The `vol2mol()` function facilitates standardization to molar quantity, and is based on molar volume data from NIST [12].

Given the importance of substrate energy content, it is useful to be able to easily determine the oxygen demand of any substrate. The `calcCOD()` function returns the theoretical (or “calculated” [5]) oxygen demand COD' based on a chemical formula [5]. The `molMass()` function calculates molar mass based on a chemical formula. An internal database of atomic weights is from [13] (for

<caption>**Table 1**</caption>

Basic functions in the biogas package.

<table><thead><tr><td>Operation</td><td>Function</td></tr></thead><tbody><tr><td>Calculate oxygen demand of a compound</td><td>calcCOD()</td></tr><tr><td>Interpolate composition etc.</td><td>interp()</td></tr><tr><td>Calculate biogas volume from mass loss</td><td>mass2vol()</td></tr><tr><td>Calculate molar mass of a compound</td><td>molMass()</td></tr><tr><td>Standardize gas volume</td><td>stdVol()</td></tr><tr><td>Calculate mass loss from biogas volume</td><td>vol2mass()</td></tr><tr><td>Convert gas volume to moles</td><td>vol2mol()</td></tr></tbody></table>

“normal materials”). Both functions rely on a hidden function (`readFormula()`) for reading chemical formulas. Interpolation of biogas composition, cumulative production, or any other variable can be done using `interp()`, which provides a simple integrated interface to both linear interpolation and spline functions from the stats package [6].

#### 2.2.2. Functions for biogas data processing

Calculation of BMP (or related measures of biogas production) from laboratory data is done using two functions sequentially: `cumBg()` (for cumulative biogas) and `summBg()` (for summarize biogas). Their use requires some familiarity with the design of BMP experiments [4,14,15]. Inputs, outputs, and operations are shown in Fig. 1. These functions carry out data manipulation, and calls to basic functions perform the necessary conversions.

Input data will generally consist of one or two data files (once in the R environment, data frames), containing original measurements of biogas quantity and composition (“biogas” and “composition” data, respectively (Fig. 1)). All files must contain a unique key to identify individual bottles. Any type of file that can be read by R can be used (spreadsheet files, tab- or comma-delimited text files, and others). Spreadsheets are convenient for data entry, but data import is simpler with text files. Measurement data and related variables such as biogas measurement temperature are passed to `cumBg()` to calculate biogas production. Input and output data are interval-level, meaning each observation corresponds to a single measurement interval. Calculated cumulative CH₄ production is primarily an intermediate object that is used to calculate BMP with `summBg()`. However, some users may work with these data directly to study kinetics, and users interested in BMP may check the shape of the CH₄ production curves by plotting cumulative production. Model fitting and plotting tasks can currently be carried out with functions from other packages.

Measurements may be volumetric [16], manometric [16], gravimetric [9], or gas-chromatography-based [17]. Both cumulative (biogas quantity is the total up to the end of the interval represented by a row in a data frame) and interval (biogas quantity is only that produced during a single interval) data can be handled by `cumBg()`. For most methods, there are two options for calculating CH₄ production. If measured CH₄ concentrations are normalized so the sum of CH₄ and CO₂ concentration is unity, calculations can be based on the volume of gas that exited each bottle [18]. With absolute CH₄ concentrations, production is determined as the sum of the volume of CH₄ that exited the bottle and CH₄ in the bottle headspace. These two methods will give identical results if headspace volume is accurately known and biogas contains only CH₄, CO₂, H₂O, and flushing gas.

Structure of input data is flexible: “wide” and “long” formats [19] can be used for biogas and composition data, or the two can be combined. The default long format is the most flexible (because sampling times may differ among bottles) but the wide format is more compact when measurements are made at fixed times, and is used in the automated AMPTS II system (Bioprocess Control, Lund, Sweden).

The final data file required for calculating BMP (“setup” data (Fig. 1)) is bottle-level, and contains at least the bottle key, a
<figure><img src="image_4.png" /><figcaption>**Fig. 1.** Data processing sequence for calculation of biochemical methane potential (BMP) or similar results from laboratory measurements of biogas production. Input data are shown on the left side.</figcaption></figure>

description of the substrate or treatment (a grouping variable), the quantity of inoculum, and mass of substrate added (typically as volatile solids (VS)). The bottle key is used by `summBg()` to merge setup data with the cumulative biogas data (output from `cumBg()`). Actual calculation of BMP is described elsewhere [4,10,15]. Time at which to evaluate BMP can be specified as a numeric value (e.g., 30 d), set to the maximum, or selected automatically when CH₄ relative production rate drops below a cutoff for a specified duration (e.g., < 1% of net cumulative per d for 3 d [15]). The last option is considered the best practice. Alternatively, BMP can be returned for all measurement times. Linear interpolation is carried out as needed using `interp()` to estimate CH₄ production at a specified time. By default mean values and standard deviation for each level of the grouping variable are returned, but results for individual bottles can be returned instead. Total random error (standard deviation) in the final BMP estimates may include contributions from substrate mass determination, CH₄ production by inoculum-only bottles, and CH₄ production from bottles with substrate. Presently, it is not possible to calculate BMP by model fitting and extrapolation using `cumBg()`, but this can be done using existing functions from other packages, and future versions of the biogas package may include functions for this task.

### 2.2.3. Function to predict methane production

The `predBg()` function estimates CH₄ production from substrate stoichiometry. In its simplest usage the function can be used to determine the maximum theoretical CH₄ potential (sometimes called “theoretical BMP”) from a defined substrate with a known chemical formula. Complex substrates can be described using empirical chemical formulas, or by their macromolecular composition, e.g., the content of carbohydrates, proteins, and lipids. Internally, an empirical chemical formula is determined from a specified macromolecular composition and fixed chemical formulas for each component: C₆H₁₀O₅ for carbohydrates [20], C₄H₆.₁O₁.₂N for proteins [21], and C₅₇H₁₀₄O₆ for lipids [20]. However, users can specify other formulas. Stoichiometry is based on Eq. (13.5) in [5]. Additional input arguments can be used to include substrate partitioning between energy and biomass production, limited degradation of a substrate, and partitioning of CO₂ between solution and biogas (based on [5] and [22]). With these additions the function can be used to estimate actual biogas yield and composition in a continuous reactor.

## 3. Illustrative examples

Package functions can be used in many ways. The `cumBg()` function can process more than twenty different types of measurements. Most functions are flexible and contain optional arguments. The vectorized basic functions exploit vector recycling rules to facilitate a wide range of operations. Due to space restraints, this section presents only a small number of limited examples. For more details, readers should refer to the online supplementary material and documentation available elsewhere (see reference manual and vignettes on the biogas package at https://cran.r-project.org/package=biogas, and videos on OBA at https://www.youtube.com/channel/UCxNGlwTnSkEa1GaFuAKM_3A).

### 3.1. Basic functions

Oxygen demand (g O₂ per g substrate) for glucose, ethanol, palmitic acid, and food waste with a known composition can be calculated with:

> calcCOD(c("C6H12O6", "H3CCH2OH", "CH3(CH2)14COOH", + "C14.25 H23.74 07.16 N"))

[1] 1.065743 2.083876 2.870336 1.567671

Note the flexibility in specification of chemical formulas, which applies to all functions that accept formulas.

In volumetric methods, biogas volume is generally measured at the temperature of the bottles or else at room temperature, and must be standardized to be useful. The standard volume of 100 mL of water vapor-saturated gas measured at 20, 35, or 55 °C at atmospheric pressure (1 atm) is given by:

> stdVol(100, temp = c(20, 35, 55), pres = 1)

Using a standard pressure of 1 atm and standard temperature of 0 C for standardizing volume.

[1] 91.02041 83.70153 70.19444

In manometric methods, pressure varies among observations, but gas volume is fixed for each bottle.

> stdVol(vol = 480, temp = 35, pres = c(102, 220), unit pres = "kPa")

Using a standard pressure of 101.325 kPa and standard temperature of 0 C for standardizing volume.

[1] 404.6011 899.9771

Note the use of kPa, and the automatic conversion of standard conditions to new units.

### 3.2. Data processing for BMP calculation

This example shows the calculation of BMP from volumetric measurements made with an AMPTS II system (Bioprocess Control, Lund, Sweden). The data file and R code can be found in the supplementary material (MMC S1 and MMC S2). Bottles contained inoculum only, inoculum and cellulose, or inoculum and a particular type of food waste. Details can be found in [23]. The objective was to determine the BMP of the food waste, and cellulose was included as a positive control [15].

Input data were entered into two worksheets in a single spreadsheet (xlsex) file and read into R to give two input data frames. The first data frame (“biogas”) contains cumulative biogas volume reported at the end of each incubation interval (Table 2). The second (“setup”) links the bottle key (unique bottle identification code) to the general contents, used for grouping (e.g., cellulose), and also contains the quantity of inoculum (wet mass) and substrate (VS mass) added to each bottle.
<caption>**Table 2**</caption>

Structure of the interval-level “biogas” data file used in the BMP example, showing 5 of 500 observations per bottle for 4 of 9 bottles. Columns 2–5 show cumulative CH₄ production in mL. Columns 6–10, for other bottles, are not shown.

<table><thead><tr><th>Time (h)<br>time.h</th><th>Food waste 1<br>fw1</th><th>Cellulose 1<br>cell1</th><th>Blank 1<br>blank1</th><th>Food waste 2<br>fw2</th></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>1</td><td>16.1</td><td>14</td><td>10.2</td><td>19.5</td></tr><tr><td>2</td><td>26.9</td><td>17.9</td><td>13.7</td><td>31.5</td></tr><tr><td>...</td><td></td><td></td><td></td><td></td></tr><tr><td>499</td><td>3281</td><td>2923.8</td><td>362.5</td><td>3233.6</td></tr><tr><td>500</td><td>3281</td><td>2923.8</td><td>362.5</td><td>3233.6</td></tr></tbody></table>

Notes: In the wide structure, bottle keys are in the header (fw1, cell1, etc.). The double header is useful for a record of units or other details. Any order can be used for rows (and, for long and combined structures, columns).

Correctly using the `cumBg()` function requires knowledge about the nature and structure of the data:

1. What method was used for biogas measurement? Here, it was a volumetric method, and values are cumulative. Values are already standardized, and CH₄ content is assumed to be 100% due to CO₂ removal.

2. What is the structure of the interval-level data? Here, the measurements were organized in a wide format (Table 2). (The “setup” data file should always have the same structure, with one row for each bottle.)

Cumulative biogas production is calculated for all bottles with a call to `cumBg()`. Output is a data frame with all original columns in the input “biogas” data frame, along with new columns containing biogas and CH₄ volume produced during each interval, cumulative values (equal to input values in this case), and production rates.

Cumulative CH₄ production can then be used to calculate BMP by subtracting CH₄ production by inoculum from total production and normalizing the result by substrate VS using `summBg()`. Resulting mean BMP estimates, evaluated when net relative CH₄ production rate has dropped below 1% of cumulative for 3 d (when = "1p3d") [15] are given in Table 3. Estimates for all measurement times can be returned by setting `when = "meas"`, and `show.Obs = TRUE` will return results for individual bottles as well (Fig. 2). Variability is acceptably low in this example—the standard deviation for food waste BMP is about 4% of the mean, which is below the 5% criterion recommended by Holliger et al. [15]. And the measured BMP of cellulose is 92% of the theoretical maximum (413.7 mL g⁻¹ is the value returned by `predBg()`), which meets the criterion recommended by Holliger et al. [15]. (85–100% of theoretical maximum). (Software users may prefer to apply other criteria, e.g., [10].)

### 3.3. Stoichiometric calculation of methane potential

How much CH₄ should be expected from this food waste? An empirical chemical formula of C₁₄H₂₄O₇N was estimated from nutritional analysis. Theoretical maximum CH₄ potential (mL g⁻¹) can therefore be determined from:

> `predBg(form = "C14H24O7N")`

[1] 553.1513

Comparing this potential to the measured BMP (Table 3) shows that BMP was 83% of the maximum theoretical potential. CH₄ potential could also be calculated from oxygen demand, which could be measured or calculated. But use of a chemical formula provides more information. Setting `value = "all"` returns additional output.

<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /><figcaption>**Fig. 2.** Methane yield (top) and relative rates of CH₄ production (bottom, relative to net cumulative) for cellulose and food waste calculated using `summBg()` for all measurement times (500 for each bottle). In the top plot, black lines show results for individual bottles, and gray area shows mean ± standard deviation.</figcaption></figure>

> `predBg("C14H24O7N", value = "all")`

<table><thead><tr><th></th><th>form</th><th>mass</th><th>mol.mass</th><th>moles</th><th>COD</th><th>hydro</th></tr></thead><tbody><tr><td>1</td><td>C14H24O7N</td><td>1</td><td>318.339</td><td>0.003141305</td><td>1.583218</td><td>0.353711</td></tr><tr><td></td><td>fCH4</td><td></td><td>vCH4</td><td>mCH4</td><td>mCO2</td><td></td></tr><tr><td>1</td><td>0.5625</td><td>553.1513</td><td>0.3968435</td><td>0.8467742</td><td></td><td></td></tr></tbody></table>

Output includes substrate mass (mass, g), molar mass (mol.mass, g mol⁻¹) and moles of substrate (moles), substrate COD' (COD, g g⁻¹), water mass consumed in the reaction (hydro, g), the fraction of CH₄ in the reaction products (CH₄ and CO₂, including inorganic carbon that remains in solution, so fCH₄ is not equal to biogas composition, but see xCH₄ in the help file for an estimate of this value), the volume of CH₄ (vCH₄, dry mL at 1 atm of pressure and 0°C), and the mass of CH₄ and CO₂ produced (g). Also, the overall reaction used for the calculations can be returned as a character string or numeric vector:

> `predBg("C14H24O7N", value = "reactionc")`

[1] "C14H24O7N + 6.25H2O --> 7.875CH4 + 5.125CO2 + NH4+ + HCO3-"

> `predBg("C14H24O7N", value = "reactionn")`

<table><thead><tr><th></th><th>C14H24O7N</th><th>H2O</th><th>CH4</th><th>CO2</th><th>C5H7O2N</th><th>NH4+</th><th>HCO3-</th></tr></thead><tbody><tr><td>1</td><td>-1</td><td>-6.25</td><td>7.875</td><td>5.125</td><td>0</td><td>1</td><td>1</td></tr></tbody></table>

These results are for complete substrate degradation. But in practice some fraction will not be degraded (as in the experiment described above), and a part of the degraded fraction is used in
<table><caption>**Table 3**
Biochemical methane potential (BMP) of cellulose and food waste calculated using the cumBg() and sumBg() functions. The first six columns are included in the default output from sumBg().</caption><thead><tr><th>Substrate</th><th>Time (d)</th><th>Mean BMP (mL g<sup>-1</sup>)</th><th>BMP s<sub>x</sub> (mL g<sup>-1</sup>)</th><th>BMP s (mL g<sup>-1</sup>)</th><th>No. bottles</th><th>Rel. inoc. s (%)</th><th>Inoc. CH<sub>4</sub> (frac.)</th></tr></thead><tbody><tr><td>Cellulose</td><td>19.0</td><td>380.5</td><td>4.44</td><td>7.69</td><td>3</td><td>4.20</td><td>0.13</td></tr><tr><td>Food waste</td><td>16.2</td><td>461.6</td><td>11.19</td><td>19.38</td><td>3</td><td>4.17</td><td>0.11</td></tr></tbody></table>

Notes: Units for BMP are mL standardized CH₄ per g substrate VS. “s” = standard error and “s” = standard deviation. “Inoc. CH₄” is mean fraction of bottle CH₄ produced by inoculum.

(net) synthesis of new microbial biomass (shown as C5H7O2N in the reaction above), and so not converted to biogas. These and other effects can be included in the calculation through the use of optional arguments, but the focus here is on CH₄ potential only.

Nutritional analysis of this substrate showed a composition of 56% carbohydrates, 27% proteins, and 17% lipids (percentage of VS). This information could be used directly with the mcomp argument for mass-based mixtures and macromolecular composition.

> predBg(mcomp = c(carbohydrate = 0.56, protein = 0.27, lipid = 0.17))

[1] 547.6185

The chemical formula C₁₄H₂₄O₇N was actually calculated from these data using predBg() by setting value = "all". The difference between the two estimates of CH₄ potential is due to rounding in the empirical formula.

> predBg(form = "C14.25H23.7407.16N")

[1] 547.7193

Chemical formulas and macromolecular classes can be combined as well. For example, one might prefer C₅H₇O₂N instead of the default value for protein.

> predBg(mcomp = c(carbohydrate = 0.56, C5H7O2N = 0.27, lipid = 0.17))

[1] 536.851

## 4. Impact

The biogas package and OBA can help improve the efficiency of biogas research and the accuracy of results. Within our own groups, it has made data processing significantly easier, and has facilitated evaluation of results. In teaching, the software has been used to demonstrate concepts, and to check students' calculations.

Optimization of biogas plants requires accurate estimates of substrate BMP and simple tools for estimating CH₄ potential. Both are provided by the software described here.

As part of an open-source package, the functions described above clarify and standardize common operations that presently differ among groups. Already, the software is being used as the “reference” approach for data processing in a large inter-laboratory study (33 institutes) [24]. We anticipate that the package may serve as the base for a larger platform that includes model fitting and other functionality in the future.

Research activity on biogas is on the rise. The Web of Science lists more than 8000 papers published in 2000 or later with “methane potential”, “anaerobic digestion”, or “biogas” in the title. Academia represents a large group of potential users, and significant interest in our software already exists. Since it was uploaded in May 2015, the biogas package has been downloaded more than 22,000 times. And usage of OBA has gradually increased to more than 150 h per month (time app is running, regardless of number of concurrent users). YouTube videos on the app (https://www.youtube.com/channel/UCxNGlwTnSkEa1GaFuAKM_3A) have been viewed more than 3000 times in total.

## 5. Conclusions

Research on biogas production by anaerobic digestion includes both measurement and prediction of methane production potential. The biogas package and web-based interface OBA can improve the efficiency of biogas research, and accuracy of methane potential measurements and predictions by providing access to standardized algorithms for data processing and stoichiometric calculations. This R package may serve as a platform for future software tools, including functions for extraction of kinetic data, model-based estimation of BMP, and empirical models for prediction of BMP.

## Acknowledgments

Jon Katz did the original R/Shiny programming for OBA. Ali Heidarzadeh Vazifehkoran, Jin Mi Triolo, Christof Holliger, Simon Vilms Pedersen, and Agnieszka Glab contributed example data and helpful suggestions.

## Appendix A. Supplementary data

Supplementary material related to this article can be found online at https://doi.org/10.1016/j.softx.2018.06.005.

## References

[1] Mao C, Feng Y, Wang X, Ren G. Review on research achievements of biogas from anaerobic digestion. Renew Sustain Energy Rev 2015;45(Suppl. C):540–55. http://dx.doi.org/10.1016/j.rser.2015.02.032.

[2] Gunaseelan VN. Biochemical methane potential of fruits and vegetable solid waste feedstocks. Biomass Bioenergy 2004;26(4):389–99. http://dx.doi.org/10.1016/j.biombioe.2003.08.006.

[3] Carrere H, Antonopoulou G, Affes R, Passos F, Battimelli A, Lyberatos G, et al. Review of feedstock pretreatment strategies for improved anaerobic digestion: From lab-scale research to full-scale application. Bioresour Technol 2016;199:386–97. http://dx.doi.org/10.1016/j.biortech.2015.09.007.

[4] Owen WF, Stuckey DC, Healy Jr. JB, Young LY, McCarty PL. Bioassay for monitoring biochemical methane potential and anaerobic toxicity. Water Res 1979;13(6):485–92. http://dx.doi.org/10.1016/0043-1354(79)90043-5.

[5] Rittmann BE, McCarty PL. Environmental Biotechnology: Principles and Applications, McGraw-Hill Series in Water Resources and Environmental Engineering. Boston: McGraw-Hill; 2001.

[6] R Core Team. A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing; 2017. URL https://www.r-project.org/.

[7] Hafner S, Rennuit C, Triolo J, Vazifehkoran A. R package biogas: analyze Biogas Data and Predict Biogas Production; 2015. URL https://cran.r-project.org/package=biogas.

[8] McNaught A, Wilkinson A. Compendium of chemical terminology. 2nd ed. online corrected. Blackwell Scientific Publications; 2006. http://dx.doi.org/10.1351/goldbook.S06036.

[9] Hafner SD, Rennuit C, Triolo JM, Richards BK. Validation of a simple gravimetric method for measuring biogas production in laboratory experiments. Biomass Bioenergy 2015;83:297–301. http://dx.doi.org/10.1016/j.biombioe.2015.10.003.

[10] VDI. Fermentation of organic materials: characterisation of the substrate, sampling, collection of material data, fermentation tests. Tech. Rep. Düsseldorf, Germany: Verein Deutsch er Ingenieure e.V.; 2016.

[11] Alduchov OA, Eskridge RE. Improved Magnus form approximation of saturation vapor pressure. J Appl Meteorol 1996;35(4):601–9. http://dx.doi.org/10.1175/1520-0450(1996)035<0601:IMFAOS>2.0.CO;2.
[12] Lemmon E, McLinden M, Friend D. Thermophysical properties of Fluid Systems. In: NIST chemistry WebBook, NIST standard reference database number 69. Gaithersburg, MD: National Institute of Standards and Technology; 2011. URL https://webbook.nist.gov/chemistry/.

[13] Meija J, B Coplen T, Berglund M, Brand W, De Bièvre P, Gröning M, et al. Atomic weights of the elements 2013 (IUPAC technical report). Pure Appl Chem 2016;88:265–91. http://dx.doi.org/10.1515/pac-2015-0305.

[14] Angelidaki I, Alves M, Bolzonella D, Borzacconi L, Campos JL, Guwy AJ, et al. Defining the biomethane potential (BMP) of solid organic wastes and energy crops: a proposed protocol for batch assays. Water Sci Technol 2009;59(5):927–34. http://dx.doi.org/10.2166/wst.2009.040.

[15] Holliger C, Alves M, Andrade D, Angelidaki I, Astals S, Baier U, et al. Towards a standardization of biomethane potential tests. Water Sci Technol 2016;74(11): 2515–2522. http://dx.doi.org/10.2166/wst.2016.336.

[16] Rozzi A, Remigi E. Methods of assessing microbial activity and inhibition under anaerobic conditions: a literature review. Rev Environ Sci Biotechnol 2004;3(2):93–115. http://dx.doi.org/10.1007/s11157-004-5762-z.

[17] Hansen TL, Schmidt JE, Angelidaki I, Marca E, Jansen JLC, Mosbæk H, et al. Method for determination of methane potentials of solid organic waste. Waste Manag 2004;24(4):393–400. http://dx.doi.org/10.1016/j.wasman.2003.09.009.

[18] Richards B, Cummings R, White T, Jewell W. Methods for kinetic-analysis of methane fermentation in high solids biomass digesters. Biomass Bioenergy 1991;1(2):65–73. http://dx.doi.org/10.1016/0961-9534(91)90028-B.

[19] Long JD. Longitudinal Data Analysis for the Behavioral Sciences Using R. Thousand Oaks, CA, USA: SAGE; 2011.

[20] Møller HB, Sommer SG, Ahring BK. Methane productivity of manure, straw and solid fractions of manure. Biomass Bioenergy 2004;26(5):485–95. http://dx.doi.org/10.1016/j.biombioe.2003.08.008.

[21] IWA Task Group for Mathematical Modelling of Anaerobic Digestion. Anaerobic Digestion Model no.1 (ADM1). IWA Publishing; 2002.

[22] Hafner SD, Montes F, Alan Rotz C. The role of carbon dioxide in emission of ammonia from manure. Atmos Environ 2012;66:63–71. http://dx.doi.org/10.1016/j.atmosenv.2012.01.026.

[23] Koch K, Lippert T, Drewes JE. The role of inoculum's origin on the methane yield of different substrates in biochemical methane potential (BMP) tests. Bioresour Technol 2017;243(Suppl. C):457–63. http://dx.doi.org/10.1016/j.biortech.2017.06.142.

[24] Holliger C, Fruteau de Laclos H, Hafner S. A new protocol and software tool for standardizing biomethane potential tests: results of an inter-laboratory study. In Proceedings of the 15th iwa world conference on anaerobic digestion. Beijing, China; 2017.