Measurement#
- class cinnabar.measurements.Measurement(labelA: Hashable, labelB: Hashable, DG: Quantity | str, uncertainty: Quantity | str, computational: bool, source: str = '', temperature: Quantity | str = <Quantity(298.15, 'kelvin')>)[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
Shortcut to create a Measurement from experimental data
Attributes
An arbitrary label to group measurements from a common source
298 K (298.15 * unit.kelvin)
Label of state A, e.g. a ligand name or any hashable Python object.
Label of state B
The free energy difference of moving from A to B in kcal/mol
The uncertainty of the DG measurement in kcal/mol
If this measurement is computationally based (or experimental)
- DG: Quantity#
The free energy difference of moving from A to B in kcal/mol
- computational: bool#
If this measurement is computationally based (or experimental)
- classmethod from_experiment(label: str | Hashable, Ki: Quantity | str, uncertainty: Quantity | str = <Quantity(0, 'nanomolar')>, *, source: str = '', temperature: Quantity | str = <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 | str) – experimental Ki value ex.: 500 * unit.nanomolar OR 0.5 * unit.micromolar or “0.5 * unit.nanomolar”
uncertainty (unit.Quantity | str) – 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 | str, 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: Quantity = <Quantity(298.15, 'kelvin')>#
298 K (298.15 * unit.kelvin)
- Type:
Temperature that the measurement was taken at in K. By default
- uncertainty: Quantity#
The uncertainty of the DG measurement in kcal/mol