Skip to content

stats.ddi

Classification of drug-drug interactions by the change of the exposure, and its publication table.

The FDA guidance (FDA 2020) classifies a perpetrator by the ratio of the AUC of a sensitive substrate with and without it: a strong, moderate or weak inhibitor raises the AUC at least 5-fold, 2- to 5-fold or 1.25- to 2-fold; a strong, moderate or weak inducer lowers it by at least 80 %, 50-80 % or 20-50 %. A substrate is sensitive when a strong inhibitor raises its AUC at least 5-fold and moderately sensitive at 2- to 5-fold. The EMA guideline (EMA 2012) uses the same thresholds; the index substrates, inhibitors and inducers are the FDA's tables (FDA drug interaction table), the study designs follow the industry perspective of Bjornsson et al. (2003).

DDIKind

Bases: StrEnum

Direction of an interaction.

DDIStrength

Bases: StrEnum

Strength of an interaction.

Sensitivity

Bases: StrEnum

Sensitivity of a substrate to a strong inhibitor.

DDIThresholds dataclass

DDIThresholds(
    inhibitor_weak=1.25,
    inhibitor_moderate=2.0,
    inhibitor_strong=5.0,
    inducer_weak=0.8,
    inducer_moderate=0.5,
    inducer_strong=0.2,
    sensitive=5.0,
    moderately_sensitive=2.0,
    source="FDA 2020",
)

Thresholds of the classification, as AUC ratios with / without the perpetrator.

An inhibitor threshold is the smallest ratio of its class, an inducer threshold the largest (inducer_strong = 0.2 is an 80 % decrease).

Attributes:

Name Type Description
inhibitor_weak float

weak inhibitor at or above this ratio

inhibitor_moderate float

moderate inhibitor at or above this ratio

inhibitor_strong float

strong inhibitor at or above this ratio

inducer_weak float

weak inducer at or below this ratio

inducer_moderate float

moderate inducer at or below this ratio

inducer_strong float

strong inducer at or below this ratio

sensitive float

sensitive substrate at or above this ratio

moderately_sensitive float

moderately sensitive substrate at or above this ratio

source str

the guidance the thresholds come from

fda classmethod

fda()

The thresholds of the FDA clinical drug interaction guidance (FDA 2020).

Returns:

Type Description
DDIThresholds

The thresholds.

ema classmethod

ema()

The thresholds of the EMA guideline on the investigation of drug interactions (EMA 2012).

These equal the FDA ones.

Returns:

Type Description
DDIThresholds

The thresholds.

classify

classify(auc_ratio)

Kind and strength of an interaction from an AUC ratio.

Parameters:

Name Type Description Default
auc_ratio float

AUC with / without the perpetrator, positive.

required

Returns:

Type Description
tuple[DDIKind, DDIStrength]

The kind and the strength.

Raises:

Type Description
ValueError

if the ratio is not positive.

DDIResult dataclass

DDIResult(
    kind,
    strength,
    auc_ratio,
    cmax_ratio,
    ci_low,
    ci_high,
    uncertain,
    kind_low,
    strength_low,
    kind_high,
    strength_high,
    thresholds,
)

Classification of an interaction.

Attributes:

Name Type Description
kind DDIKind

the classification (from the bound of the interval closer to 1 when an interval is given)

strength DDIStrength

the strength

auc_ratio float

the AUC ratio

cmax_ratio float | None

the Cmax ratio, reported only

ci_low float

lower bound of the interval of the AUC ratio, NaN without one

ci_high float

upper bound of the interval

uncertain bool

whether the interval spans a boundary of the classes

kind_low DDIKind

classification of ci_low

strength_low DDIStrength

strength of ci_low

kind_high DDIKind

classification of ci_high

strength_high DDIStrength

strength of ci_high

thresholds DDIThresholds

the thresholds used

to_dict

to_dict()

The fields as a dictionary with the enumerations as strings.

Returns:

Type Description
dict[str, Any]

Field name to value.

ddi_classification

ddi_classification(
    auc_ratio, *, cmax_ratio=None, ci=None, thresholds=None
)

Classify a perpetrator by the AUC ratio of a substrate with and without it.

With an interval (given as ci or carried by a RatioResult) the classification is conservative: it uses the bound closer to 1 (the lower bound of an increase, the upper bound of a decrease), an interval which contains 1 gives no interaction, and uncertain is set when the two bounds fall into different classes.

Parameters:

Name Type Description Default
auc_ratio float | RatioResult

AUC ratio with / without the perpetrator, or the ratio result.

required
cmax_ratio float | RatioResult | None

Cmax ratio, reported next to the classification.

None
ci tuple[float, float] | None

interval of the AUC ratio; overrides the interval of a RatioResult.

None
thresholds DDIThresholds | None

the thresholds, FDA 2020 by default.

None

Returns:

Type Description
DDIResult

The classification.

Raises:

Type Description
ValueError

if the interval is reversed or a ratio is not positive.

substrate_sensitivity

substrate_sensitivity(auc_ratio, *, thresholds=None)

Sensitivity of a substrate from its AUC ratio with a strong inhibitor.

Parameters:

Name Type Description Default
auc_ratio float | RatioResult

AUC ratio with / without the strong inhibitor.

required
thresholds DDIThresholds | None

the thresholds, FDA 2020 by default.

None

Returns:

Type Description
Sensitivity

SENSITIVE at or above thresholds.sensitive, MODERATELY_SENSITIVE

Sensitivity

at or above thresholds.moderately_sensitive, else NONE.

Raises:

Type Description
ValueError

if the ratio is not positive.

ddi_table

ddi_table(
    test,
    reference,
    parameters=("auc_inf_obs", "cmax"),
    *,
    dim="individual",
    thresholds=None,
    digits=3,
    ci_level=0.9,
    paired=None,
    include_excluded=False,
    **indexers,
)

The interaction table of a publication: one row per parameter, formatted.

Every parameter is taken from both results with ParameterResult.sample(name, dim, **indexers), its geometric mean ratio with and without the perpetrator is computed with pkpdutils.stats.ratio and classified with ddi_classification, which reads the bound of the interval closer to 1 (FDA 2020; EMA 2012). The classes are defined for the AUC; they are applied to every parameter of the table, so that the row of the maximum is read next to the row of the exposure.

Parameters:

Name Type Description Default
test ParameterResult

the result with the perpetrator.

required
reference ParameterResult

the result without it.

required
parameters Sequence[str]

the parameters of the table.

('auc_inf_obs', 'cmax')
dim str

the sample dimension of the individuals.

'individual'
thresholds DDIThresholds | None

the thresholds, FDA 2020 by default.

None
digits int

significant digits of the numbers.

3
ci_level float

level of the intervals, 0.90 as in bioequivalence.

0.9
paired bool | None

pair the samples, None pairs when both carry the same labels, as in pkpdutils.stats.ratio.

None
include_excluded bool

read the samples a result marks excluded (pkpdutils.nca.NCAResult.exclude) as well.

False
**indexers Any

coordinate label per remaining sample dimension.

{}

Returns:

Type Description
DataFrame

The table with the columns parameter, unit, n_test,

DataFrame

n_reference, ratio, ci_low, ci_high, kind, strength,

DataFrame

uncertain and source; every cell is a string.

Raises:

Type Description
ValueError

as ParameterResult.sample and pkpdutils.stats.ratio.