Measurement#

class cinnabar.measurements.Measurement(*, labelA: ~typing.Hashable, labelB: ~typing.Hashable, DG: ~openff.models.types.FloatQuantity, uncertainty: ~openff.models.types.FloatQuantity, temperature: ~openff.models.types.FloatQuantity = <Quantity(298.15, 'kelvin')>, computational: bool, source: str = '')[source]#

The free energy difference of moving from A to B

All quantities are accompanied by units, to prevent mix-ups associated with kcal and kJ. This is done via the openff.units package:

>>> m = Measurement(labelA='LigandA', labelB='LigandB',
...                 DG=2.4 * unit.kilocalorie_per_mol,
...                 uncertainty=0.2 * unit.kilocalorie_per_mol,
...                 computational=True,
...                 source='gromacs')

Alternatively strings are automatically coerced into quantities, making this equivalent to above:

>>> m = Measurement(labelA='LigandA', labelB='LigandB',
...                 DG='2.4 kcal/mol',
...                 uncertainty='0.2 kcal/mol',
...                 computational=True,
...                 source='gromacs')

Where a measurement is “absolute” then a ReferenceState can be used as the label at one end of the measurement. I.e. it is relative to a reference ground state. E.g. an absolute measurement for “LigandA” is defined as:

>>> m = Measurement(labelA=ReferenceState(), labelB='LigandA',
...                 DG=-11.2 * unit.kilocalorie_per_mol,
...                 uncertainty=0.3 * unit.kilocalorie_per_mol,
...                 computational=False)

Methods

from_experiment

Shortcut to create a Measurement from experimental data

Attributes

labelA

Label of state A, e.g. a ligand name or any hashable Python object.

labelB

Label of state B

DG

The free energy difference of moving from A to B

uncertainty

The uncertainty of the DG measurement

temperature

Temperature that the measurement was taken as

computational

If this measurement is computationally based (or experimental)

source

An arbitrary label to group measurements from a common source

class Config[source]#
DG: FloatQuantity#

The free energy difference of moving from A to B

computational: bool#

If this measurement is computationally based (or experimental)

classmethod from_experiment(label: str | ~typing.Hashable, Ki: ~pint.util.Quantity, uncertainty: ~pint.util.Quantity = <Quantity(0, 'nanomolar')>, *, source: str = '', temperature: ~pint.util.Quantity = <Quantity(298.15, 'kelvin')>)[source]#

Shortcut to create a Measurement from experimental data

Can perform conversion from Ki values to kcal/mol values.

Parameters:
  • label (str | Hashable) – label for this data point.

  • Ki (unit.Quantity) – experimental Ki value ex.: 500 * unit.nanomolar OR 0.5 * unit.micromolar

  • uncertainty (unit.Quantity) – uncertainty of the experimental value default is zero if no uncertainty is provided (0 * unit.nanomolar)

  • source (str, optional) – source of experimental measurement

  • temperature (unit.Quantity, optional) – temperature in K at which the experimental measurement was carried out. By default: 298 K (298.15 * unit.kelvin)

labelA: Hashable#

Label of state A, e.g. a ligand name or any hashable Python object

labelB: Hashable#

Label of state B

source: str#

An arbitrary label to group measurements from a common source

temperature: FloatQuantity#

Temperature that the measurement was taken as

uncertainty: FloatQuantity#

The uncertainty of the DG measurement