Acid.SpecificPair: Acid - specific pair ('alpha', 'MIC')

View source: R/acide.R

Acid.SpecificPairR Documentation

Acid - specific pair (alpha, MIC)

Description

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

Usage

Acid.SpecificPair(pairs, concentration = 1)

Arguments

pairs

list of pairs (alpha, MIC).

concentration

acid concentration (in g/L).

Details

The pairs argument can be given as one to three pairs.

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

Two pairs means that one of them will be used for getCoefMin and the other for getCoefMax. The getCoefMid function will use an average value of the two pairs.

Three pairs acts like two pairs except that the getCoefMid function will use this third pair (middle value) to calculate the coefficient. Note that the pair (alpha, MIC) used by getCoefMid neither minimizes nor maximizes the coefficient (in other words, it is the pair which is neither used in getCoefMin nor in getCoefMax).

Please note that if you do not want to use specific pairs but ranges of values for alpha and/or MIC, use the parent function Acid.

Value

the acid modeled with the following accessible attributes:

pairs

list of pairs (alpha, MIC).

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

Examples

# Classic instantiation
print(Acid.SpecificPair(list(c(1.245, 5.47))))
## acid {{alpha=1.245, MIC=5.47g/L}, concentration=1g/L}

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

# Instantiation with multiple couples (`alpha`, `MIC`) (see details section)
aceticAcid <- Acid.SpecificPair(list(c(0.98,5.68),c(1.51,5.26)))
print(aceticAcid)
## acid {{alpha=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/L}, concentration=1g/L}

# Generic operators (`+`, `*`, etc.) can change the `concentration` of the acid.
print(aceticAcid / 2)
## acid {{alpha=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/L}, concentration=0.5g/L}
print(aceticAcid + 2)
## acid {{alpha=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/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=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/L}, concentration=0.5g/L}
## acid {{alpha=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/L}, concentration=1g/L}
## acid {{alpha=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/L}, concentration=5g/L}
## acid {{alpha=0.98, MIC=5.68g/L},
##       {alpha=1.51, MIC=5.26g/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.