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

HAL
open science

# FishResp: R package and gui application for analysis of aquatic respirometry data

Sergey Morozov, R. J. Scott Mccairns, Juha Merilä

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

## To cite this version:

Sergey Morozov, R. J. Scott Mccairns, Juha Merilä. FishResp: R package and gui application for analysis of aquatic respirometry data. Conservation Physiology, 2019, 7, pp.1-13. 10.1093/con-phys/coz003. hal-02623159

HAL Id: hal-02623159

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

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_3.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# FishResp: R package and GUI application for analysis of aquatic respirometry data

Sergey Morozov<fnref n="1" />,*, R. J. Scott McCairns<fnref n="2" /> and Juha Merilä<fnref n="1" />

Intermittent-flow respirometry is widely used to measure oxygen uptake rates and subsequently estimate aerobic metabolic rates of aquatic animals. However, the lack of a standard quality-control software to detect technical problems represents a potential impediment to comparisons across studies in the field of evolutionary and conservation physiology. Here, we introduce 'FishResp', a versatile R package and its graphical implementation for quality-control and filtering of raw respirometry data. Our goal is to provide a straightforward, cross-platform and free software to help improve the quality and comparability of metabolic rate estimates for reducing methodological fragmentation in the field of aquatic respirometry. FishResp accepts data from various respirometry systems, allows users to detect potential mechanical problems which can occur during oxygen uptake measurements (e.g. chamber leaking, poor water circulation), and offers six options to correct raw data for microbial oxygen consumption. The software performs filtering of raw data based on user criteria, and produces accurate and unbiased estimates of absolute and mass-specific metabolic rates. Using data from three-spined sticklebacks (*Gasterosteus aculeatus*) and Trinidadian guppies (*Poecilia reticulata*), we demonstrate the virtues of FishResp, highlighting the importance of detecting mechanical problems and correcting measurements for background respiration.

**Key words:** background respiration, free software, intermittent-flow respirometry, metabolic rate, oxygen uptake, three-spined stickleback, Trinidadian guppy

**Editor:** Steven Cooke

Received 10 November 2018; Revised 19 December 2018; Editorial Decision 3 January 2019; accepted 7 January 2019

**Cite as:** Morozov S, McCairns RJS, Merilä J (2019) FishResp: R package and GUI application for analysis of aquatic respirometry data. *Conserv Physiol* 7(1): coz003; doi:10.1093/conphys/coz003.

## Introduction

Whole-body intermittent-flow respirometry (i.e. measuring the oxygen uptake of an organism) represents the most reliable and widespread technique to estimate aerobic metabolic rate of aquatic animals (Steffensen, 1989; Clark et al., 2013; Svendsen et al., 2016b). As the availability and precision of oxygen sensors has grown (Nelson, 2016), respirometry has

become increasingly common in the field of evolutionary and conservation physiology (Metcalfe et al., 2016; Chabot et al., 2016a). Among other fundamental questions, it has been applied to the identification of ecological and environmental factors that cause metabolic rate variation (Ohlberger et al., 2007; Auer et al., 2015; Christensen et al., 2017) and for studying physiological plasticity and adaptation to novel

<footnote n="1">¹ Ecological Genetics Research Unit, Organismal and Evolutionary Biology Programme, Faculty of Biological and Environmental Sciences, University of Helsinki, 00014 Helsinki, Finland</footnote>

<footnote n="2">² ESE, Ecology and Ecosystem Health, INRA, Agrocampus Ouest, 35042 Rennes, France</footnote>

<footnote>*Corresponding author: Ecological Genetics Research Unit, Organismal and Evolutionary Biology Programme, Faculty of Biological and Environmental Sciences, University of Helsinki, 00014 Helsinki, Finland. Email: sergey.morozov@helsinki.fi</footnote>
environmental conditions, including adaptive potential to global ocean warming, ocean acidification, hypoxia and chemical contaminants (Kreiss et al., 2015; McDonnell and Chapman, 2015; Hancock and Place, 2016; Kunz et al., 2016; Norin et al., 2016; Jayasundara et al., 2017; Zhang et al., 2017). In addition, intermittent-flow respirometry has been recently used in studies devoted to both applied and fundamental problems in aquaculture and fisheries (Hessenauer et al., 2015; Siikavuopio and James, 2015; Gerile and Pirhonen, 2017; Svendsen et al., 2018).

Despite the growing use of respirometry, quality-control of raw data and extraction of key parameters from it, remains the responsibility of individual researchers (Rodgers et al., 2016). The lack of standard quality-control software with the ability to detect and correct for technical problems in the raw data may compromise the comparability of results from different studies. Indeed, the literature contains many contradictory reports of intraspecific metabolic differences that are difficult to ascribe to only biological causes. For example, whilst inter-population comparisons of mean standard metabolic rate (SMR) estimates of Trinidadian guppy (*Poecilia reticulata*) have reported difference up to 1.7-fold between populations (Handelsman et al., 2013; Auer et al., 2018), comparisons between independent studies conducted under similar temperature conditions show 5-fold differences (from 100 to 550 mg O₂/kg/h; Svendsen et al., 2013; Ejbye-Ernst et al., 2016; Killen et al., 2016). Such a wide range of SMR estimates within a species are unlikely to be explained by biological factors, but more likely, reflect unstandardized measurement conditions and data post-processing procedures.

Two critical factors that influence the quality and reliability of respirometry data are (i) mechanical problems with the system itself and (ii) background respiration. As to the former, both the absence of or damage to a mixing device leading to poor water circulation in a system, and a large ratio of respirometer to fish volume, can reduce the resolution of raw data (Rodgers et al., 2016; Svendsen et al., 2016a). Similarly, study animals blocking the water supply to an oxygen sensor can cause dramatic drops in dissolved oxygen measurements, whereas leaking of a measurement chamber, which can be particularly pronounced under high water flow velocity in Blazka-type swimming tunnels (Blazka et al., 1960), has potential to lead to underestimation of metabolic rates (Svendsen et al., 2016b). Mechanical problems are relatively easy to detect via linear analysis of raw data, and may indicate the need to repair faulty equipment. However, detecting and correcting for background respiration (i.e. oxygen consumption of microorganisms in the water or on inner surfaces of equipment) can be more challenging (Dalla Via, 1983; Clark et al., 2013; Rodgers et al., 2016). Although several approaches exist, many studies fail to mention how background respiration was dealt with, or whether background respiration was totally ignored in data processing (see Svendsen et al., 2016b). The potential problem with

background respiration is especially relevant when metabolic rate is measured at high temperatures—a condition that favours microbial growth—and in small chambers, where the relative contribution of microbes to total rate of oxygen consumption is high and not constant over time (Rodgers et al., 2016). Both are prevalent when working with small tropical fish, as in the aforementioned guppy example, and can lead to substantial overestimates of oxygen consumption. In addition, background respiration may represent an increasingly large proportion of the total oxygen consumption under hypoxic conditions.

Here, we introduce ‘FishResp’, software for running quality control tests, filtering raw data and calculating metabolic estimates of high accuracy. We demonstrate the utility of FishResp for detecting mechanical problems and correcting for background microbial oxygen consumption using raw data obtained from the three-spined stickleback (*Gasterosteus aculeatus*) and the Trinidadian guppy (*Poecilia reticulata*). These examples demonstrate how FishResp significantly improves the quality of final estimates, setting what we hope will become standard practice for processing raw respirometry data.

# Materials and methods

## Software description

FishResp is an R package (R Development Core Team, 2018) for analysing raw data from intermittent-flow respirometry systems. Its current version 1.0.2 consists of 15 functions (listed in Table 1) and utilizes six dependencies (existing R packages) which will be automatically installed once FishResp is executed (listed in Table 2). The order of application of each function in a typical analysis is described in Fig. 1, encompassing all steps from data input to parameter estimation. Alternatively, a graphical user interface (GUI) of FishResp is also available, written in JavaFX. To integrate Java with R, the ‘rJava’ package (Urbanek, 2018) and its extension ‘JRI’ are used. The graphical interface consists of five tabs with functional blocks on the left side (functions with parameters), and information, graphical or extensions modules on the right side of the application (Fig. 2). The ‘Extensions Module’ has been created to integrate FishResp with other respirometry tools written in the R language, such as modified functions for unit conversion from the R packages ‘respirometry’ and ‘rMR’ (Birk, 2018; Moulton, 2018). Different colours of tabs and buttons are used as indicators of progress: unavailable (grey); plotting optional (blue); action required (yellow); successful execution (green). The log of complete actions can be saved using an icon in the upper-right corner of the graphical interface. Both versions of FishResp are free and open-source software, compatible with Windows, MacOS and Linux.

The software allows a user to analyse data from up to eight respirometry chambers concurrently. Raw data can be
<table><caption>**Table 1:** Overview of all functions in the R package</caption><thead><tr><td>Function</td><td>Description</td></tr></thead><tbody><tr><td>input.info</td><td>Input information about experimental organisms and chambers</td></tr><tr><td>import.test</td><td>Import raw data for a background respiration test</td></tr><tr><td>import.meas</td><td>Import raw data for metabolic rate measurements</td></tr><tr><td>correct.meas</td><td>Correction of measurements for background respiration</td></tr><tr><td>QC.meas</td><td>Graphical quality control of temperature and O<sub>2</sub> measurements before and after correction for bacterial respiration</td></tr><tr><td>QC.activity</td><td>Graphical quality control of measurement windows</td></tr><tr><td>extract.slope</td><td>Extraction of target measurements</td></tr><tr><td>QC.slope</td><td>Graphical quality control of extracted measurements</td></tr><tr><td>rm.data</td><td>Remove raw data manually for a specific measurement phase</td></tr><tr><td>calculate.MR</td><td>Calculation and visualization of background respiration, absolute and mass-specific metabolic rates</td></tr><tr><td>export.MR</td><td>Export results as .csv and .txt files (optionally, calculate aerobic metabolic scope)</td></tr><tr><td>convert.respirometry &amp; convert.rMR</td><td>Convert dissolved oxygen to partial pressure units and vice versa in raw data obtained in multichannel respirometry systems (see the R packages 'respirometry' and 'rMR')</td></tr><tr><td>presens.aquaresp &amp; pyroscience.aquaresp</td><td>Convert raw data from OxyView (PreSens) or Pyro Oxygen Logger (PyroScience) along with a summary file from AquaResp (free software) to the FishResp format</td></tr></tbody></table>

The functions are listed in order of a typical FishResp analysis (see also Fig. 1), excluding optional functions *convert.respirometry*, *convert.rMR*, *presens.aquaresp*, *pyroscience.aquaresp*.

<table><caption>**Table 2:** Overview of package dependencies and its functions in FishResp</caption><thead><tr><td>R package</td><td>Function</td><td>Reference</td></tr></thead><tbody><tr><td>chron</td><td>time analysis</td><td>James and Hornik (2018)</td></tr><tr><td>lattice</td><td>graphics</td><td>Sarkar (2008)</td></tr><tr><td>mclust</td><td>SMR determination</td><td>Scrucca et al. (2016)</td></tr><tr><td>respirometry</td><td>DO converter</td><td>Birk (2018)</td></tr><tr><td>rMR</td><td>DO converter</td><td>Moulton (2018)</td></tr><tr><td>rJava</td><td>R to Java Interface</td><td>Urbanek (2018)</td></tr></tbody></table>

imported into the R package/GUI application directly from 'AutoResp' (Loligo Systems, Denmark) and 'Q-box Aqua' (Qubit Systems, Canada); and via 'AquaResp' (University of Copenhagen, Denmark) with 'OxyView' (PreSens GmbH, Germany) and 'Pyro Oxygen Logger' (Pyro Science GmbH, Germany) output. The output from other logger software and DIY setups can be manually adjusted to 'FishResp' import format (see 'Details' in the documentation of the R function 'import.test' or 'import.meas'). The software accepts several units of O₂ concentration, while partial pressure units (e.g. % sat, mmHg or kPa) can be converted to O₂ concentration using the R functions 'convert.respirometry' and 'convert.rMR' or in the 'Extensions Module' of the GUI application (for details see the documentation of those functions). Quality-control tests and data filtering are performed

with the aid of graphical visualizations, and parameters from simple linear models: the slope of the linear regression of O₂ concentration over time, and the coefficient of determination (r²). Slopes are used to calculate metabolic rate, and to correct for background respiration.

## Experimental design for correction of background respiration

The number of traits calculated per one session is not limited in the R package, while GUI implementation of FishResp can be used only for measuring one or two metabolic traits per session, as shown in Fig. 3. In order to subtract background respiration from total oxygen consumption, additional tests must be conducted without an animal in the chambers
<figure><img src="image_4.png" /><figcaption>**Figure 1:** Flowchart illustrating a data processing pipeline for conducting analysis in the R package 'FishResp'. The names of R functions are italicized. The functions are grouped into four categories: raw data preparation (optional), input data and background respiration correction, slope extraction based on parameter filtration, and calculation of metabolic rate estimates.</figcaption></figure>

before, after or during metabolic rate measurements (pre-test, post-tests and parallel blank test, respectively). A full experiment processed with the GUI application can consist of four different steps (Fig. 3A), but this can be reduced to one metabolic measurement with either one or two background respiration tests (Fig. 3B). Both full and reduced designs are described to illustrate the use of the R package and its GUI version.

Six options are available for the correction of background respiration, each based on subtracting the slope of background respiration over time from the slope of animal oxygen consumption over time. Methods 'pre.test' and 'post.test' are used to remove background respiration before or after metabolic rate measurements, respectively. When a single metabolic trait has been measured with both pre- and post-tests (Fig. 3B), 'average', 'linear' and 'exponential' methods can be used to subtract the averaged slope of the tests, or the progressively changing slope over time between those tests. Alternatively, an empty chamber running in parallel with actual metabolic rate measurements can be used for the correction. Note that the 'parallel' method does not require running pre- and/or post-tests. To choose an optimal method of correction, monitoring of background respiration over a long measurement period is recommended (Rodgers et al., 2016; Svendsen et al., 2016b).

## Metabolic rate calculation

Several methods of slope extraction are available to estimate metabolic rate: all slopes, slopes with minimal or maximal values, or those of a given quantile within the frequency distribution of observed slopes. In addition, four methods for determination of SMR have been integrated into FishResp: mean of the lowest normal distribution (MLND), quantiles, low10, and low10% (see Chabot et al., 2016b). Likewise, users can define a threshold $r^2$ value (default value of 0.95), the parameter used to detect mechanical problems in a respirometry system (e.g. chamber leaking and poor water flow) or spontaneous animal activity during SMR measurements (but see Clark et al., 2013; Norin and Clark, 2017; Zhang and Gilbert, 2017).

Calculation of absolute (absMO₂; 'cO₂ unit'/h) and mass-specific (massMO₂; 'cO₂ unit'/kg/h) metabolic rates are based on the following equations (Claireaux and Lagardère, 1999):

$$ \text{absMO}_2 = \Delta[\text{O}_2]/\Delta t \times (V - D \times m) \quad (1) $$

$$ \text{massMO}_2 = \text{abs MO}_2 \times m^{-1} \quad (2) $$

where $\Delta[\text{O}_2]/\Delta t$ is slope in 'cO₂ unit'/L/h, m is mass in kg, V the chamber volume in L, and D is the density of an animal body (by default = 1000 kg/m³, can be modified; but see Svendsen et al. (2016b))
<figure><img src="image_5.png" /><figcaption>**Figure 2:** GUI implementation of 'FishResp': general settings and the information about guppies used in Case Study 2.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Figure 3:** Schematic representation of full (A) and reduced (B) experimental designs. SMR and AMR are conditional terms and can be substituted with other traits. Pre and post blocks represent tests of background oxygen consumption before and after experiments.</figcaption></figure>

## Fish and respirometry systems used for case studies

Use of FishResp is demonstrated in two case studies. Case Study 1 shows how the full scheme can be run using the R package, and provides an example of how mechanical problems can be detected. Raw respirometry data come from four three-spined sticklebacks (average mass = 1.96, SD = 0.19 g), measured in a 4-channel respirometry system of 250 mL Blazka-type swim tunnels (DAQ-PAC-F4 package, AutoResp user's manual; Loligo Systems, Denmark), together with pre- and post-tests. Standard metabolic rate (SMR) was measured overnight (22:00–06:00) after 4 h of acclimation in the absence of light and other external stimuli; active metabolic rate (AMR) was measured during the day at 80% of individual critical swimming speed, which represents a proxy of maximum aerobic activity during prolonged swimming performance, but not absolute maxMO₂ (for definitions, see Brett, 1964; Fry, 1971). We used an intermittent-flow procedure consisting of flush, wait and measurement phases (420/180/1200 s for SMR and pre-test, and 420/180/600 s for AMR and post-test). The experiment was
conducted in fresh water at 16.5°C with constant velocity (5 cm/s) generated by a propeller inside a swim tunnel. The level of dissolved oxygen during an open phase was 8.8 mg/L (90% air saturation), and it never dropped below 5.95 mg/L (61% air saturation) during the measurement phase.

Case Study 2, using data from four male and four female guppies (average mass<sub>male</sub> = 0.084, SD = 0.014 g and average mass<sub>female</sub> = 0.271, SD = 0.109 g), provides an example of excessively high background respiration, and is presented to demonstrate both the GUI and the importance of background respiration correction. Measures of SMR were taken overnight after 4 h of acclimation using eight 21.8 mL static chambers connected to an 8-channel respirometry system (DAQ-PAC-WF8 package, AutoResp user's manual; Loligo Systems, Denmark) with 300 s flush, 180 s wait and 720 s measurement periods. Fresh water was constantly mixed by a pump during the measurement phase (T = 24.8°C; mean CO₂ = 7.1, SD = 0.5 mg/L). Background respiration in the chambers was measured before and after the experiment (Fig. 3B). The calibration of the oxygen sensors for case studies was performed following the 2-point calibration procedure described in the AutoResp user's manual (Loligo Systems, Denmark). Raw data for both Case Study 1 and Case Study 2 can be found in the package folders 'FishResp/extdata/stickleback' and 'FishResp/extdata/guppy,' respectively.

Experiments were carried out in accordance with the recommendations and approval of the National Animal Experiment Board of Finland (permit no: ESAVI/6097/04.10.07/2013) and the Stockholm Ethical Board (permit no: N173/13, 223/15 and N8/17).

# Results and discussion

## Case Study 1: Calculation of SMR, AMR and MS of Sticklebacks

### Import and correction of raw data

Following the general outline of a typical 'FishResp' analysis (Fig. 1), the command library(FishResp) is used to load the package. The function input.info() must be applied first to specify dissolved oxygen measurement units, and to provide information about individual ID, fish mass (g), and chamber volumes (mL) used in subsequent analyses (see Table 1):

```r
info <- input.info(DO.unit = "mg/L",
ID = c("Stickleback_1", "Stickleback_2",
"Stickleback_3", "Stickleback_4"),
Mass = c(1.86, 1.92, 2.23, 1.80),
Volume = c(250, 250, 250, 250))
```

To load files containing raw data of background respiration measurements into R ('pre-test.txt' and 'post-test.txt'), the function import.test() should be used—note that if data files are not located in the same directory as the R session,

file names should be specified with their full paths (see code in File S1). The path to the file, the type of oxygen logger software, and the number of chambers used should also be included as arguments. Graphs of oxygen and temperature over time are plotted automatically to check temperature fluctuations and water supply to the sensor during background respiration tests:

```r
pre <- import.test(pre.path, info.data=info,
logger="AutoResp", n.chamber=4)
```

```r
post <- import.test(post.path, info.data=info,
logger="AutoResp", n.chamber=4)
```

The next step is to import raw data of SMR and AMR measurements into R using the import.meas() function. If the date format is not 'DMY', specify it in this function. Two additional parameters (start.measure and stop.measure, respectively) corresponding to the time interval of measurements not exceeding 24 h can help remove non-target data (e.g. acclimation period after handling stress):

```r
SMR/raw <- import.meas(SMR.path, info.data=info,
logger="AutoResp", n.chamber=4,
start.measure="22:00:00", stop.measure="06:00:00")
```

```r
AMR/raw <- import.meas(AMR.path, info.data=info,
logger="AutoResp", n.chamber=4)
```

As a full design was chosen for this experiment (Fig. 3A), 'pre' and 'post' methods are used to correct SMR and AMR for background respiration, respectively, where slopes of linear models (level of dissolved oxygen over time) for background respiration tests are automatically subtracted from slopes of linear models for actual measurements using the function correct.meas():

```r
SMR.clean <- correct.meas(info.data=info, pre.data=pre,
meas.data=SMR/raw, method="pre.test")
```

```r
AMR.clean <- correct.meas(info.data=info,
post.data.post, meas.data=AMR/raw,
method="post.test")
```

Oxygen data before and after background respiration correction can be visualized using the function QC.meas():

```r
QC.meas(SMR.clean, "Total.O2.phases")
QC.meas(SMR.clean, "Corrected.O2.phases")
QC.meas(SMR.clean, "Total.O2.chambers")
QC.meas(SMR.clean, "Corrected.O2.chambers")
```

Plotting raw data plays an important role in assessing its quality, providing preliminary information about the rate of background respiration; corrected O₂ plots allow the user to evaluate their choice of correction strategy. In this example, levels of dissolved oxygen and temperature were stable over the duration of the experiment, indicating that both pre- and post-tests can be used to remove background respiration.
Extraction and visualization of results: identifying
and removing artefacts due to animal disturbance
or swimming inactivity

The next step is to select slopes of dissolved oxygen concen-
tration over time to calculate metabolic rate. This is particu-
larly relevant when several consecutive measurement cycles
are taken. In this example, SMR measurements were col-
lected every 30 min over an 8 h period, but only three slopes
have been extracted to determine SMR. In contrast, as only
three AMR measurements are available for each individual,
all three slopes are used for calculation of AMR. For both
traits, only slopes with r² > 0.95 are extracted.

SMR.slope <- extract.slope(SMR.clean, method="min",
n.slope=3, r2=0.95)

AMR.slope <- extract.slope(AMR.clean, method="all",
r2=0.95)

It can be helpful to plot each slope separately: the func-
tion QC.slope() visualizes how a linear model fits data cor-
rected for background respiration. However, if one of the
'calcSMR' methods is selected to determine SMR (Chabot
et al., 2016b), a user should first extract all slopes to be able
to plot linear models, and then apply a 'calcSMR' method
(see Case Study 2 and File S2). Note that an exponential
decrease of oxygen content over long measurement periods
might be caused by chamber leaking or poor water circula-
tion in a respirometry system even with high r² value
(Svendsen et al., 2016b; Norin and Clark, 2017). Would this
be the case, those data should be omitted from further
analyses.

QC.slope(SMR.slope, SMR.clean, chamber="CH1",
current=1200, alter=600)

QC.slope(AMR.slope, AMR.clean, chamber="CH4",
current=600, alter=300)

In this example, linear models perfectly capture the trend
in SMR and most AMR data (Fig. 4, M1). However, data
from the two final AMR measurement phases in ‘Chamber
4’ show decreases in oxygen uptake rate with time (Fig. 4,
M2 & M3). During experiments (including Morozov et al.,
2018), we noticed that some individuals could not constantly
maintain 80% of Ucrit in swimming tunnels during the final
minutes of AMR measurements, but leaned against the
honeycomb stopper housing the oxygen sensor.
Occasionally, fish were able to block the oxygen supply to
the sensor, leading to dramatic decrease of oxygen level in
raw data (Fig. 4, M2). The slopes for M2 look similar
because blocking of the sensor was short and in the middle
stage of measurement phase. The other common problem,
when an experimental organism stopped swimming and rate
of oxygen uptake dropped, is illustrated in panel M3 (Fig. 4,
M3): the fish was not able to swim after the first five minutes
of the measurement phase, reflected in the upward inflection
of the QC plot. In fact, here we detected both these

<figure><img src="image_7.png" /><figcaption>**Figure 4:** Slopes for AMR in three-spined stickleback. The level of oxygen content in a respirometry chamber was measured every second over 10 min during three measurement phases (M1—M3). Black lines denote a linear model over the whole measurement period; in red measurements are restricted to the first 5 min. M1, M2 and M3 are the discrete measurement cycles.</figcaption></figure>

mechanical problems based on graphical QC tests, but not
based on r² < 0.95. Thus, it is important to combine compu-
tational methods with visualization of intermittent results of
the analysis. To avoid under- and over-estimating AMR, and
to follow a uniform approach for extracting slopes for this
trait, we decreased the time interval used for slope calcula-
tion with the function extract.slope(). The other important
feature of the function QC.slope(), which can represent a
useful tool for detecting deviations from linearity and in
determination of measurement window length, is regression
diagnostic plots for current and alternative length of a meas-
urement window (Fig. 5). In this example, reducing the
<figure><img src="image_8.png" /><figcaption>**Figure 5:** Regression diagnostics for the measurement phase 'M3' of Chamber 4. Raw data with fitted linear models for current length of measurement window (600s, black colour) and the alternative one (300s, red colour) displayed on the top graph. Regression diagnostic plots for current and alternative measurement windows are located in the middle section and the bottom section of the figure, respectively. More information on diagnostic plots can be found in the documentation of the base R function plot.Im().</figcaption></figure>

measurement window to 5 min (300 s) helps improve linear fit and allow us to avoid artefacts due to swimming inactivity (Fig. 4; red lines, Fig. 5; red graphs):

QC.slope(AMR.slope, AMR.clean, chamber="CH4", current=600, alter=300, residuals=TRUE)

AMR.slope <- extract.slope(AMR.clean, method="all", r2=0.95, length=300)

It should be noted that a call to extract.slope() uses r² = 0.95 as a default linearity filter. Svendsen *et al.* (2016b) have

suggested that this should be viewed as the minimum criterion when estimating O₂ consumption from the slope of a linear model. This value can be manually changed if users wish to use a more robust value. Under some circumstances users may wish to relax this parameter; however, we would urge careful reflection before doing so, and that all parameters used be reported.

The final step is to calculate and plot metabolic rate estimates, together with the percentage rate of background respiration using the function calculate.MR().

SMR <- calculate.MR(SMR.slope, density=1000)
AMR <- calculate.MR(AMR.slope, density=1000)

Results can be exported as .txt or .csv files. Optionally, when two traits are measured, they can be merged into one dataset containing absolute, mass-specific and factorial metabolic scopes.

results <- export.MR(SMR, AMR, "results.csv",
  simplify=TRUE, MS=TRUE)

Note that the rate of background respiration for both SMR and AMR is not more than 13.8% and 28.7% respectively. However, the situation can change dramatically when the experiment is conducted at high water temperature and/or in small chambers, as demonstrated by Case Study 2.

## Case Study 2: The effect of background respiration on SMR of Guppies

### Running the analysis using GUI application

The GUI version is created for users who prefer to interact with graphical elements in a user-friendly interface instead of

working with a command line. Here, we demonstrate the use of the application for estimating background respiration, and calculating SMR (see File S2 to run this example in R). After launching the program, a user should set parameters in the 'Global settings' module: we choose 'pre- and post-tests' as background respiration tests, 'AutoResp' for the type of logger software, and eight chambers in the respirometry system. As we measured only one trait (SMR), the field for 'Trait 2' should be empty. Click the 'Save global settings' button, and fill in the table with information about animals and chambers (Fig. 2). Next, move to the 'Background respiration' tab and import data for pre- and post-tests. Note that conducting visual QC tests of raw data is critical: if the temperature is unstable, or oxygen data show loss of linearity, further calculations might be meaningless. Navigation buttons of the graphical module can be used for zooming and switching plots for different chambers. Finally, open the 'Standard Metabolic Rate' tab, import raw data for SMR (time interval: 22:00:00-06:00:00), and correct them for background respiration. As both pre- and post-tests were used, all methods excluding 'parallel' are available (Fig. 3B). In this example, the method 'exponential' is used because

<figure><img src="image_9.png" /><figcaption>**Figure 6:** GUI implementation of 'FishResp': graphical module shows the difference in mass-specific SMR of guppies before (upper panel) and after correction (lower panel) for background respiration.</figcaption></figure>
<figure><img src="image_10.png" /><figcaption>**Figure 7:** (A) Absolute SMR of guppies versus background respiration. (B) Difference in corrected and non-corrected mass-specific SMR.</figcaption></figure>

background respiration was on average 17% lower during the pre-test than during the post-test in all chambers (Wilcoxon signed-rank test, P = 0.014), wherein exponential microbial growth is expected (Dalla Via, 1983, but see Rodgers et al., 2016).

## Comparison of SMR before and after correction

In the module 'Visual QC tests', a user can compare non-corrected versus corrected data, and check for indications of animal activity over the measurement period (GUI implementation of the package functions, QC.meas and QC.activity). 'Activity' and 'Comparison' options calculate mass-specific metabolic rate automatically, disabling any filters for slope estimation (but see Wilson, 2018). The 'Activity' option can be helpful for defining the time of corrected SMR, while 'Comparison' is used for graphical comparison of results with and without correction for background respiration (Fig. 6). Fig. 6 shows that mass-specific SMR after the subtraction of microbial oxygen consumption is markedly lower than before correction.

To calculate SMR, together with the percentage of background respiration, open the 'Results' tab. The method 'calcSMR: quant' (Chabot et al., 2016b) is chosen to determine SMR based on calculation of the lower quantile (P = 0.25) of all slopes with r² > 0.9 (the threshold level is reduced because of the high rate of background respiration, coupled with a low ratio between mass of male guppies and

the volume of chambers, both of which seriously reduced the linearity of corrected data). Note, if any of 'calcSMR' methods are applied, then slopes cannot be plotted individually in the module 'QC of slopes'. Thus, before using 'calcSMR: quant', we extract all slopes and conduct graphical QC tests of slopes for each chamber. Finally, we insert information about the body density of fish and click the button 'Calculate and plot'. Three graphs are plotted automatically in the graphical module: percentage rate of background respiration, absolute and mass-specific SMR. The last step is to save results as a .csv or .txt file (a log file with all commands applied during the analysis is also logged automatically in the same folder).

Results of the analysis show that background respiration represents 57.1–89% of the total oxygen consumption (Fig. 7A), despite daily cleaning of chambers and sensors, weekly changing 50% of water volume in the respirometry system and constant usage of the UV filter. Absolute SMR varies depending on mass of fish, while the mean mass-specific SMR is 185.5 mgO₂/kg/h. Thus, mean SMR is overestimated by ~2.8 times for females and 6.7 times for males (Fig. 7B), when not corrected for background respiration.

## Conclusions

Our case studies demonstrate that neglecting mechanical problems and microbial growth in a respirometry system can
lead to underestimation and/or overestimation of metabolic
rate. FishResp software, used together with a proper experi-
mental design (Clark et al., 2013; Svendsen et al., 2016b),
represents a simple and efficient approach to account for the
effects of chamber issues and background respiration in the
processing of raw respirometry data. To make FishResp a
universally available tool, we have developed both the R
package (available on CRAN), and its cross-platform and
user-friendly graphical implementation under open source
licenses. Both can import raw data from the majority of
respirometry systems available on the market. FishResp can
be adjusted for different experimental designs: the software
allows users to choose among various options for detection
of mechanical problems, correction of background respir-
ation, and calculation of metabolic rate. Therefore, FishResp
provides a universal and straightforward tool that can
improve the quality of metabolic rate estimation in fishes
and other aquatic animals. Last but not least, the ‘Extensions
module’ in the GUI version of FishResp represents a platform
for graphical implementation of other R packages, scripts
and functions available in open-access/published. Thus,
FishResp has potential to become a community-driven soft-
ware in the field of aquatic respirometry.

Data availability

The R package and data are available on the CRAN reposi-
tory (http://cran.r-project.org/package=FishResp). R scripts
for running both case studies are provided in Supplementary
files S1 & S2. Application of functions which have not been
reviewed in the case studies are shown in Supplementary file
S3. The official website (https://fishresp.org) will host all
information related to FishResp, including user manuals,
tutorial videos, FAQ, a forum and a blog with the latest
updates of the software.

Supplementary material

Supplementary material is available at Conservation Physiology online.

Acknowledgements

We thank Artur Zaripov and Roman Kovalev for significant con-
tribution to GUI development, Federico Calboli and Nicholas
Carey for helpful advice and testing the R package, Niclas Kolm
and Alexander Kotrschal for providing the guppy data.

Funding

This work was supported by Oskar Öflund Foundation (SM), Alfred Kordelin Foundation (SM), Helsinki Institute of Life Sciences [797011029 to J.M.] and Academy of Finland [259944 to R.J.S.M., 292737 to J.M.].

Authors' contributions

S.M. and R.J.S.M. conceived the ideas and designed the ori-
ginal R functions. S.M. developed the R package and GUI
application. All authors led the writing of the manuscript
and contributed critically to all drafts, and gave final
approval for publication.

Conflict of interest statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

Auer SK, Dick CA, Metcalfe NB, Reznick DN (2018) Metabolic rate evolves rapidly and in parallel with the pace of life history. *Nat Commun* 9: 6.

Auer SK, Salin K, Rudolf AM, Anderson GJ, Metcalfe NB (2015) The optimal combination of standard metabolic rate and aerobic scope for somatic growth depends on food availability. *Funct Ecol* 29: 479-486.

Birk MA (2018) respirometry: Tools for conducting and analyzing respirometry experiments, R package, version 0.7.0, URL: http://cran.r-project.org/package/respirometry

Blazka P, Volf M, Cepela M (1960) A new type of respirometer for the determination of the metabolism of fish in an active state. *Physiol Bohemoslov* 9: 553-558.

Brett JR (1964) The respiratory metabolism and swimming performance of young sockeye salmon. *J Fish Res Board Can* 21: 1183-1226.

Chabot D, McKenzie DJ, Craig JF (2016a) Metabolic rate in fishes: defi-
nitions, methods and significance for conservation physiology.
*J Fish Biol* 88: 1–9.

Chabot D, Steffensen JF, Farrell AP (2016b) The determination of standard metabolic rate in fishes. *J Fish Biol* 88: 81–121.

Christensen EAF, Svendsen MBS, Steffensen JF (2017) Plasma osmolality and oxygen consumption of perch *Perca fluviatilis* in response to different salinities and temperatures. *J Fish Biol* 90: 819–833.

Claireaux G, Lagardère JP (1999) Influence of temperature, oxygen and salinity on the metabolism of the European sea bass. *J Sea Res* 42: 157–168.

Clark TD, Sandblom E, Jutfelt F (2013) Aerobic scope measurements of fishes in an era of climate change: respirometry, relevance and recommendations. *J Exp Biol* 216: 2771-2782.

Dalla Via GJ (1983) Bacterial growth and antibiotics in animal respiro-
metry. In A Erich Gnaiger, Hellmuth Forstner, eds, *Polarographic
*oxygen sensors*. Springer Vol 216. Springer, Berlin, Heidelberg, 216: pp 202–218.

Ejbye-Ernst R, Michaelsen TY, Tirsgaard B, Wilson JM, Jensen LF, Steffensen JF, Pertoldi C, Aarestrup K, Svendsen JC (2016) Partitioning the metabolic scope: the importance of anaerobic metabolism and implications for the oxygen- and capacity-limited thermal tolerance (OCLTT) hypothesis. *Conserv Physiol* 4: 13.

Fry FEJ (1971) The effect of environmental factors on the physiology of fish. In Hoar WS, Randall DJ, eds. *Fish Physiology*, Vol. 6. Academic Press, New York, pp 1–98.

Gerile S, Pirhonen J (2017) Replacement of fishmeal with corn gluten meal in feeds for juvenile rainbow trout (*Oncorhynchus mykiss*) does not affect oxygen consumption during forced swimming. *Aquaculture* 479: 616–618.

Hancock JR, Place SP (2016) Impact of ocean acidification on the hypoxia tolerance of the woolly sculpin, *Clinocottus analis*. *Conserv Physiol* 4: cow040.

Handelsman CA, Broder ED, Dalton CM, Ruell EW, Myrick CA, Reznick DN, Ghalambor CK (2013) Predator-induced phenotypic plasticity in metabolism and rate of growth: rapid adaptation to a novel environment. *Integr Comp Biol* 53: 975–988.

Hessenauer JM, Vokoun JC, Suski CD, Davis J, Jacobs R, O'Donnell E (2015) Differences in the metabolic rates of exploited and unexploited fish populations: a signature of recreational fisheries induced evolution? *PLoS One* 10: 12.

James D, Hornik K (2018). chron: Chronological objects which can handle dates and times, R package, version 2.3–53, URL: http://cran.r-project.org/package=chron

Jayasundara N, Fernando PW, Osterberg JS, Cammen KM, Schultz TF, Di Giulio RT (2017) Cost of tolerance: physiological consequences of evolved resistance to inhabit a polluted environment in teleost fish *Fundulus heteroclitus*. *Environ Sci Technol* 51: 8763–8772.

Killen SS, Croft DP, Salin K, Darden SK (2016) Male sexually coercive behaviour drives increased swimming efficiency in female guppies. *Funct Ecol* 30: 576–583.

Kreiss CM, Michael K, Lucassen M, Jutfelt F, Motyka R, Dupont S, Pörtner HO (2015) Ocean warming and acidification modulate energy budget and gill ion regulatory mechanisms in Atlantic cod (*Gadus morhua*). *J Comp Physiol B* 185: 767–781.

Kunz KL, Frickenhaus S, Hardenberg S, Johansen T, Leo E, Pörtner HO, Schmidt M, Windisch HS, Knust R, Mark FC (2016) New encounters in Arctic waters: a comparison of metabolism and performance of polar cod (*Boreogadus saida*) and Atlantic cod (*Gadus morhua*) under ocean acidification and warming. *Polar Biol* 39: 1137–1153.

McDonnell LH, Chapman LJ (2015) At the edge of the thermal window: effects of elevated temperature on the resting metabolism, hypoxia tolerance and upper critical thermal limit of a widespread African cichlid. *Conserv Physiol* 3: 13.

Metcalfe NB, Van Leeuwen TE, Killen SS (2016) Does individual variation in metabolic phenotype predict fish behaviour and performance? *J Fish Biol* 88: 298–321.

Morozov S, Leinonen T, Merilä J, McCairns RJS (2018) Selection on the morphology-physiology-performance nexus: lessons from freshwater stickleback morphs. *Ecol Evol* 8: 1286–1299.

Moulton TL (2018). rMR: Importing data from Loligo Systems software, calculating metabolic rates and critical tensions, R package, version 1.1.0, URL: http://cran.r-project.org/package=rMR

Nelson JA (2016) Oxygen consumption rate v. rate of energy utilization of fishes: a comparison and brief history of the two measurements. *J Fish Biol* 88: 10–25.

Norin T, Clark TD (2017) Reply to Zhang & Gilbert (2017): Comment on 'Measurement and relevance of maximum metabolic rate in fishes by Norin & Clark (2016)'. *J Fish Biol* 91: 403–408.

Norin T, Malte H, Clark TD (2016) Differential plasticity of metabolic rate phenotypes in a tropical fish facing environmental change. *Funct Ecol* 30: 369–378.

Ohlberger J, Staaks G, Hölker F (2007) Effects of temperature, swimming speed and body mass on standard and active metabolic rate in vendace (*Coregonus albula*). *J Comp Physiol B-Biochem Syst Environ Physiol* 177: 905–916.

R Development Core Team (2018). R: A Language and Environment for Statistical Computing, R Foundation for Statistical Computing, Vienna, Austria.

Rodgers GG, Tenzing P, Clark TD (2016) Experimental methods in aquatic respirometry: the importance of mixing devices and accounting for background respiration. *J Fish Biol* 88: 65–80.

Sarkar D (2008) *Lattice: Multivariate Data Visualization with R*. Springer Science & Business Media, New York.

Scrucca L, Fop M, Murphy TB, Raftery AE (2016) mclust 5: clustering, classification and density estimation using Gaussian finite mixture models. *R J* 8: 289–317.

Siikavuopio SI, James P (2015) Effects of temperature on feed intake, growth and oxygen consumption in adult male king crab *Paralithodes camtschaticus* held in captivity and fed manufactured diets. *Aquac Res* 46: 602–608.

Steffensen JF (1989) Some errors in respirometry of aquatic breathers: how to avoid and correct for them. *Fish Physiol Biochem* 6: 49–59.

Svendsen MBS, Andersen NR, Hansen PJ, Steffensen JF (2018) Effects of harmful algal blooms on fish: insights from *Prymnesium parvum*. *Fishes* 3: 11.

Svendsen JC, Banet AI, Christensen RHB, Steffensen JF, Aarestrup K (2013) Effects of intraspecific variation in reproductive traits, parental fin use and burst swimming on metabolic rates and swimming performance in the Trinidadian guppy (*Poecilia reticulata*). *J Exp Biol* 216: 3564–3574.
Svendsen MBS, Bushnell PG, Christensen EAF, Steffensen JF (2016a) Sources of variation in oxygen consumption of aquatic animals demonstrated by simulated constant oxygen consumption and respirometers of different sizes. *J Fish Biol* 88: 51–64.

Svendsen MBS, Bushnell PG, Steffensen JF (2016b) Design and setup of intermittent-flow respirometry system for aquatic organisms. *J Fish Biol* 88: 26–50.

Urbanek S (2018). rJava: Low-level R to Java interface, R package, version 0.9-10, URL: http://cran.r-project.org/package=rJava

Wilson AJ (2018) How should we interpret estimates of individual repeatability? *Evol Lett* 2: 4–8.

Zhang Y, Gilbert MJH (2017) Comment on ‘Measurement and relevance of maximum metabolic rate in fishes by Norin & Clark (2016)’. *J Fish Biol* 91: 397–402.

Zhang YF, Mauduit F, Farrell AP, Chabot D, Ollivier H, Rio-Cabello A, Le Floch S, Claireaux G (2017) Exposure of European sea bass (*Dicentrarchus labrax*) to chemically dispersed oil has a chronic residual effect on hypoxia tolerance but not aerobic scope. *Aquat Toxicol* 191: 95–104.