Acid: Acid

View source: R/acide.R

AcidR Documentation

Acid

Description

Modeling of an acid with alpha its sensitivity and MIC its minimum inhibition concentration. The default concentration is 1g/L.

Usage

Acid(alpha, MIC, concentration = 1)

Arguments

alpha

sensitivity.

MIC

concentration minimale d'inhibition.

concentration

acid concentration (in g/L).

Details

The arguments alpha and MIC can be given as one to three values.

A single value means that getCoefMin, getCoefMid and getCoefMax will return the same coefficient.

Two values symbolize some sort of uncertainty about alpha and/or MIC. The functions getCoefMin and getCoefMax will use the pair (alpha, MIC) which respectively minimizes and maximizes the coefficients. The getCoefMid function will return a coefficient based on the average of the values entered.

Three values act as for two values except that for the function getCoefMid will use this third value (middle value) for the calculation of the coefficient.

Please note, entering several values acts as a pool of available values, and not as pairs (alpha, MIC). For example, the getCoefMin function will use the minimum value alpha and the minimum value MIC. If you wish to specify pairs (alpha, MIC), see Acid.SpecificPair which will determine, for example for getCoefMin, the pair (alpha, MIC) minimizing the coefficient.

Value

the acid modeled with the following accessible attributes:

alpha

the alpha value or list of values.

MIC

the MIC value or list of values.

concentration

the acid concentration (in g/L).

getCoefMin

function returning the minimum coefficient to apply to a MicrobialGrowth-object (see details section).

getCoefMid

function returning the "middle" coefficient to apply to a MicrobialGrowth-object (see details section).

getCoefMax

function returning the maximum coefficient to apply to a MicrobialGrowth-object (see details section).

See Also

Acid.SpecificPair

Examples

# Classic instantiation
aceticAcid <- Acid(1.245, 5.47)
print(aceticAcid)
## acid {alpha=1.245, MIC=5.47g/L, concentration=1g/L}

# Classic instantiation by specifying a concentration
print( Acid(1.245, 5.47, 3) )
## acid {alpha=1.245, MIC=5.47g/L, concentration=3g/L}

# Instantiation with multiple `alpha` and `MIC` values (see details section)
print( Acid(c(0.98, 1.1, 1.51), c(5.26, 5.68)) )
## acid {alpha=[0.98, 1.1, 1.51], MIC=[5.26, 5.68]g/L, concentration=1g/L}

# Generic operators (`+`, `*`, etc.) can change the `concentration` of the acid.
print(aceticAcid / 2)
## acid {alpha=1.245, MIC=5.47g/L, concentration=0.5g/L}
print(aceticAcid + 2)
## acid {alpha=1.245, MIC=5.47g/L, concentration=3g/L}

# Without having to pre-define specific concentrations, and with the default `concentration` (1g/L),
# you can dynamically change the acid concentration as follows:
for (concentration in c(0.5, 1, 5, 10)) {
  print(concentration * aceticAcid)
}
## acid {alpha=1.245, MIC=5.47g/L, concentration=0.5g/L}
## acid {alpha=1.245, MIC=5.47g/L, concentration=1g/L}
## acid {alpha=1.245, MIC=5.47g/L, concentration=5g/L}
## acid {alpha=1.245, MIC=5.47g/L, concentration=10g/L}

try({
  # Acid can be applied to a MicrobilogicalGrowth-object with the `+` addition operator.
  # Note that the acid should be on the right side, otherwise an error is raised.
  MyMicrobialGrowthObject + aceticAcid
  ## returns the MicrobialGrowth-object affected by the acid (several acids can be applied)
})

MicrobialGrowth documentation built on April 12, 2025, 1:34 a.m.