Introduction
Not all rumen gas production experiments are conducted using the ANKOM RF Gas Production System.
rumenGP provides the function as_rumen_gp() for
importing manually collected gas-volume datasets and pressure-based
datasets into the standard rumen_gp format.
Once imported, the data can be analyzed using the same:
- Modeling tools
- Visualization tools
- Diagnostic workflows
- Model-comparison procedures
available for ANKOM experiments.
Importing Gas-Volume Data
The simplest workflow is to import cumulative gas-production measurements directly.
manual_volume <- data.frame(
Bottle = c(
1, 1, 1,
2, 2, 2
),
Treatment = c(
"Control",
"Control",
"Control",
"Corn",
"Corn",
"Corn"
),
Time = c(
0, 4, 8,
0, 4, 8
),
Gas = c(
0, 20, 40,
0, 35, 60
)
)Convert the dataset into a rumen_gp object:
gp <- as_rumen_gp(
data = manual_volume,
head_col = "Bottle",
treatment_col = "Treatment",
time_col = "Time",
gas_col = "Gas"
)Inspect the resulting object:
gp
#> Head Bottle Rep Treatment Time_h Gas_mL
#> 1 1 1 1 Control 0 0
#> 2 1 1 1 Control 4 20
#> 3 1 1 1 Control 8 40
#> 4 2 2 1 Corn 0 0
#> 5 2 2 1 Corn 4 35
#> 6 2 2 1 Corn 8 60Verify the class:
class(gp)
#> [1] "rumen_gp" "data.frame"Required Columns
At minimum, gas-volume datasets must contain:
Bottle identifier
Incubation time
Gas production
Column names may vary and are specified through function arguments.
For example:
head_col = "Bottle"
time_col = "Time"
gas_col = "Gas"Importing Pressure Data
rumenGP can also import pressure measurements and convert them to gas volume automatically.
manual_pressure <- data.frame(
Bottle = rep(
1,
10
),
Time = c(
0,
2,
4,
6,
8,
12,
16,
24,
36,
48
),
PSI = c(
0,
0.2,
0.5,
0.8,
1.2,
1.8,
2.5,
3.2,
4.0,
4.5
)
)Convert pressure measurements:
gp_pressure <- as_rumen_gp(
data = manual_pressure,
head_col = "Bottle",
time_col = "Time",
pressure_col = "PSI",
pressure_unit = "psi",
headspace_volume = 60
)Inspect the resulting gas volumes:
head(gp_pressure)
#> Head Bottle Rep Treatment Time_h Gas_mL
#> 1 1 1 1 Unknown 0 0.0000000
#> 2 1 1 1 Unknown 2 0.7140855
#> 3 1 1 1 Unknown 4 1.7852138
#> 4 1 1 1 Unknown 6 2.8563421
#> 5 1 1 1 Unknown 8 4.2845132
#> 6 1 1 1 Unknown 12 6.4267698Pressure Units
Currently supported pressure units are:
psi
kPa
Examples:
pressure_unit = "psi"or
pressure_unit = "kPa"Headspace Volume
Pressure measurements require information about headspace volume.
Headspace volume represents the gas space inside the bottle and is not necessarily the same as the total bottle volume.
Example:
Bottle volume = 125 mL
Liquid volume = 75 mL
Headspace volume = 50 mL
When pressure data are imported:
headspace_volume = 50should represent the headspace volume and not the total bottle capacity.
Headspace Units
Supported headspace units:
mL
L
Examples:
headspace_unit = "mL"
headspace_unit = "L"Negative Pressure Values
Pressure datasets occasionally contain slightly negative readings caused by sensor noise or instrument variability.
These values can be automatically corrected.
negative_pressure <- data.frame(
Bottle = c(
1, 1, 1
),
Time = c(
0, 4, 8
),
PSI = c(
-0.5,
0.2,
1.0
)
)
gp_negative <- as_rumen_gp(
data = negative_pressure,
head_col = "Bottle",
time_col = "Time",
pressure_col = "PSI",
pressure_unit = "psi",
headspace_volume = 60,
zero_negative_pressure = TRUE
)Validation
Imported datasets should be validated before model fitting.
validate_ankom(
gp
)
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2
#> Head Bottle Rep Treatment Time_h Gas_mL
#> 1 1 1 1 Control 0 0
#> 2 1 1 1 Control 4 20
#> 3 1 1 1 Control 8 40
#> 4 2 2 1 Corn 0 0
#> 5 2 2 1 Corn 4 35
#> 6 2 2 1 Corn 8 60The validation procedure checks:
- Required columns
- Missing values
- Duplicate observations
- Time ordering
- Dataset consistency
Fitting Models
Once imported, manually collected datasets can be analyzed exactly like ANKOM datasets.
mm_fit <- fit_mm(gp)
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2
burr_fit <- fit_burr_xii(gp)
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2
gompertz_fit <- fit_gompertz(gp)
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2Inspect one fitted model:
summary(mm_fit)
#>
#> Michaelis-Menten model summary
#> ------------------------------
#> Total bottles: 2
#> Successful fits: 0
#> Failed fits: 2
#> Low R-squared (< 0.90): 0
summary(burr_fit)
#>
#> Burr XII model summary
#> ----------------------
#> Total bottles: 2
#> Successful fits: 0
#> Failed fits: 2
#> Low R-squared (< 0.90): 0
summary(gompertz_fit)
#>
#> Gompertz model summary
#> ----------------------
#> Total bottles: 2
#> Successful fits: 2
#> Failed fits: 0
#> Low R-squared (< 0.90): 0
#> Lambda at boundary: 0Comparing Models
Model performance can be compared using several goodness-of-fit statistics.
comparison <- compare_models(
MichaelisMenten = fit_mm(gp),
BurrXII = fit_burr_xii(gp),
Gompertz = fit_gompertz(gp)
)
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2
#> rumenGP data validation passed.
#> Observations: 6
#> Heads: 2
#> Treatments: 2
comparison
#> Model Bottles Successful_Fits Failed_Fits Mean_R2 Mean_RMSE
#> 1 MichaelisMenten 2 0 2 NaN NaN
#> 2 BurrXII 2 0 2 NaN NaN
#> 3 Gompertz 2 2 0 1 4.951966e-15
#> Mean_RSS Mean_AIC Mean_BIC Lambda_Boundary
#> 1 NaN NaN NaN 0
#> 2 NaN NaN NaN 0
#> 3 7.573139e-29 -181.21 -184.8155 0The comparison table includes:
- Mean R-squared
- Mean RMSE
- Mean RSS
- Mean AIC
- Mean BIC
- Number of successful fits
Model Ranking
rank_models(
comparison
)
#> Model Bottles Successful_Fits Failed_Fits Mean_R2 Mean_RMSE
#> 1 MichaelisMenten 2 0 2 NaN NaN
#> 2 BurrXII 2 0 2 NaN NaN
#> 3 Gompertz 2 2 0 1 4.951966e-15
#> Mean_RSS Mean_AIC Mean_BIC Lambda_Boundary Rank_R2 Rank_RMSE Rank_AIC
#> 1 NaN NaN NaN 0 2 2 2
#> 2 NaN NaN NaN 0 3 3 3
#> 3 7.573139e-29 -181.21 -184.8155 0 1 1 1
#> Rank_BIC
#> 1 2
#> 2 3
#> 3 1Available Models
Current built-in models include:
- Brody
- Burr XII
- Dual Logistic
- EXP0
- EXPL
- Generalized Michaelis-Menten
- Gompertz
- Groot
- Inverse Paralogistic
- LE0
- LEL
- Logistic
- Log-logistic
- Mitscherlich
- Ørskov and McDonald
Model Equivalence
Groot and Generalized Michaelis-Menten
The Groot and generalized Michaelis-Menten models are mathematically equivalent for positive values of time.
Parameter correspondence:
VF = Ab = Kk = c
Both formulations describe the same underlying sigmoidal gas production curve but differ in parameterization.
The Groot model contains the term
and is therefore undefined at
.
Consequently, observations collected at Time_h = 0 are
excluded when fitting the Groot model.
Researchers may choose either formulation depending on the terminology commonly used in their field.
Groot, Generalized Michaelis-Menten, and Log-logistic
The Log-logistic formulation
can be rewritten as
which is mathematically equivalent to both the Groot and generalized Michaelis-Menten models for positive values of time.
Parameter correspondence:
| Groot | Generalized Michaelis-Menten | Log-logistic |
|---|---|---|
| VF | A | VF |
| b | K | 1/r |
| k | c | a |
Therefore, the Groot, Generalized Michaelis-Menten, and Log-logistic models represent mathematically equivalent parameterizations of the same underlying sigmoidal gas production curve.
These formulations differ only in how their parameters are expressed.
Unlike the Groot model, the generalized Michaelis-Menten and Log-logistic formulations are mathematically defined at and therefore retain the initial observation during model fitting.
Consequently, parameter estimates and goodness-of-fit statistics may differ slightly among parameterizations when time-zero observations are present.
rumenGP implements all three parameterizations, allowing researchers to choose the formulation that is most familiar within their field while recognizing their underlying mathematical equivalence.
Recommended Model Selection Workflow
A practical workflow is:
1. Import and validate data
2. Fit several biologically plausible models
3. Verify convergence
4. Inspect fitted curves
5. Examine residuals
6. Compare RMSE
7. Compare AIC and BIC
8. Evaluate parameter plausibility
9. Select the most appropriate model
No single model should be considered universally superior.
Model performance depends on:
- Feed type
- Experimental design
- Data quality
- Fermentation profile characteristics
- Model-selection criteria
Common Errors
No Gas or Pressure Supplied
as_rumen_gp(
data = my_data,
head_col = "Bottle",
time_col = "Time"
)Produces:
Provide either gas_col or pressure_col.
Both Gas and Pressure Supplied
as_rumen_gp(
data = my_data,
gas_col = "Gas",
pressure_col = "PSI"
)Produces:
Provide only one of gas_col or pressure_col.
Missing Headspace Volume
as_rumen_gp(
pressure_col = "PSI"
)Produces:
headspace_volume must be supplied when pressure_col is used.
Summary
The as_rumen_gp() function allows rumenGP to be used
with:
- Manual gas-volume datasets
- Pressure-based datasets
- Non-ANKOM experiments
Once imported, all datasets become standard rumen_gp
objects and can be analyzed using the complete rumenGP workflow,
including:
- Fifteen built-in kinetic models
- User-defined models
- Model comparison
- Treatment-level evaluation
- Diagnostic workflows
- Visualization tools
The same modeling workflow can therefore be applied consistently across ANKOM and non-ANKOM gas-production experiments.