ts_ids_components.solvent_selection package#

Module contents#

This module contains IDS components designed for use in Crystallization in-silico solvent selection processes.

In-Silico Solvent Selection for Crystallization#

Solvent selection is a part of crystallization optimization workflows where a mixture containing an Active Pharmaceutical Ingredient (API) is dissolved in solvent then further processed to separate the crystallized form from impurities. Characterizing the solubility between API and many solvents, as well as common impurities with solvents, is critical to modeling these processes. As there are many individual solvents and countless multi-solvent combinations available for testing, in-silico methods are commonly used.

Examples of in-silico computational models are COSMO-RS, r-UNIFAC and the Hansen equations. Each of these require simple structural knowledge of the solute molecule of interest. The r-UNIFAC and Hansen models also require some actual experimental solubility measures in order to fit specific interaction parameters within the models.

The data schemas herein should be adopted across solvent schema applications to ensure consistency in naming conventions.

Sample components#

Here a sample refers to the solute of interest. This is typically the Active Pharmaceutical Ingredient (API) to be purified, but it could also refer to an impurity to be removed. Two components are provided to support sample definitions:

SoluteMolecule includes fundamental structural characteristics of a solute molecule. These fields are immutable in the sense that it if they changed at all they would describe a different molecule. Repeated experiments to describe them would be exactly the same.

SoluteProperties describes experimental measures of a solute molecule. While these also describe fundamental properties of a molecule the values are sensitive to experimental conditions or floating point precision.

If creating an IDS structure where all properties are provided as a source of truth then your Sample class could just inherit from both:

from ts_ids_components.solvent_selection import SoluteMolecule, SoluteProperties

class Sample(SoluteMolecule, SoluteProperties):
    pass

Otherwise, if these measures are sensitive enough that different values should be evaluated on a separate run then SoluteProperties fields might be better placed a Run object or other data structure.

Run components#

These components describe the setup of an experimental run to support a regression-UNIFAC or Hansen modelling process, which require pre-determined solvent solute solubility measures. Other models, like COSMO-RS, do not require this.

Here a Run will consist of several solubility measurements. PreMeasuredSolubility can be used to describe solvent composition, temperature and solubility.

from ts_ids_components.solvent_selection import PreMeasuredSolubility

class Run(PreMeasuredSolubility):
    pass

Two solvent mixture classes are included, TwoSolventMixture or ThreeSolventMixture. If an application requires a more complex solvent description fields can be added as appropriate

Results components#

Similar to the Run PreMeasuredSolubility class above the SolubilityPrediction class describes a solvent temperature and solubility. A separate class is defined for results here though so that the field names and descriptions can explicitly describe a result.

Model SoluteMolecule[source]#

Bases: IdsElement

The name and structural characteristics of a solute. This may describe an Active Pharmaceutical Ingredient (API) or an impurity.

Show JSON schema
{
   "description": "The name and structural characteristics of a solute. This may describe an Active Pharmaceutical Ingredient (API) or an impurity.",
   "type": "object",
   "properties": {
      "name": {
         "description": "The name of an API or impurity molecule",
         "type": [
            "string",
            "null"
         ]
      },
      "smiles": {
         "description": "The 'smiles' chemical string representation of the molecule.",
         "type": [
            "string",
            "null"
         ]
      },
      "aromatic_rings_number": {
         "description": "The number of aromatic rings in the molecule.",
         "type": [
            "number",
            "null"
         ]
      },
      "non_aromatic_rings_number": {
         "description": "The number of non-aromatic rings in the molecule.",
         "type": [
            "number",
            "null"
         ]
      }
   },
   "additionalProperties": false
}

Validators:

field aromatic_rings_number: float | None#

The number of aromatic rings in the molecule.

field name: str | None#

The name of an API or impurity molecule

field non_aromatic_rings_number: float | None#

The number of non-aromatic rings in the molecule.

field smiles: str | None#

The ‘smiles’ chemical string representation of the molecule.

Model SoluteProperties[source]#

Bases: IdsElement

The measured properties of a solute. These are floating point measures that may be sensitive to experimental conditions and precision.

Show JSON schema
{
   "description": "The measured properties of a solute. These are floating point measures that may be sensitive to experimental conditions and precision.",
   "type": "object",
   "properties": {
      "melting_point": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "The melting point temperature of the molecule"
      },
      "enthalpy_of_fusion": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "The enthalpy of fusion of the molecule"
      },
      "solute_density": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "The density of the solute"
      }
   },
   "additionalProperties": false,
   "definitions": {
      "RawValueUnit": {
         "additionalProperties": false,
         "description": "A value with a unit, including the raw representation of the value from the primary data.",
         "properties": {
            "value": {
               "description": "A numerical value.",
               "type": [
                  "number",
                  "null"
               ]
            },
            "unit": {
               "description": "Unit for the numerical value.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "raw_value": {
               "description": "The raw, untransformed value from the primary data.",
               "type": [
                  "string",
                  "null"
               ]
            }
         },
         "required": [
            "value",
            "unit",
            "raw_value"
         ],
         "type": "object"
      }
   }
}

Validators:

field enthalpy_of_fusion: RawValueUnit#

The enthalpy of fusion of the molecule

field melting_point: RawValueUnit#

The melting point temperature of the molecule

field solute_density: RawValueUnit#

The density of the solute

Model TwoSolventMixture[source]#

Bases: IdsElement

Parameters to define the composition of a solvent mixture composed of up to 2 solvents

Show JSON schema
{
   "description": "Parameters to define the composition of a solvent mixture composed of up to 2 solvents",
   "type": "object",
   "properties": {
      "solvent1": {
         "description": "Name of the 1st solvent in mixture.",
         "type": "string"
      },
      "solvent2": {
         "description": "Name of the 2nd solvent in mixture.",
         "type": [
            "string",
            "null"
         ]
      },
      "volume_fraction1": {
         "description": "Volume fraction of the 1st solvent.",
         "type": [
            "number",
            "null"
         ]
      }
   },
   "additionalProperties": false
}

Validators:

field solvent1: str#

Name of the 1st solvent in mixture.

field solvent2: str | None#

Name of the 2nd solvent in mixture.

field volume_fraction1: float | None#

Volume fraction of the 1st solvent.

Model ThreeSolventMixture[source]#

Bases: TwoSolventMixture

Parameters to define the composition of a solvent mixture composed of up to 3 solvents

Show JSON schema
{
   "description": "Parameters to define the composition of a solvent mixture composed of up to 3 solvents",
   "type": "object",
   "properties": {
      "solvent1": {
         "description": "Name of the 1st solvent in mixture.",
         "type": "string"
      },
      "solvent2": {
         "description": "Name of the 2nd solvent in mixture.",
         "type": [
            "string",
            "null"
         ]
      },
      "volume_fraction1": {
         "description": "Volume fraction of the 1st solvent.",
         "type": [
            "number",
            "null"
         ]
      },
      "solvent3": {
         "description": "Name of the 3rd solvent in mixture.",
         "type": [
            "string",
            "null"
         ]
      },
      "volume_fraction2": {
         "description": "Volume fraction of the 2nd solvent.",
         "type": [
            "number",
            "null"
         ]
      }
   },
   "additionalProperties": false
}

Validators:

field solvent3: str | None#

Name of the 3rd solvent in mixture.

field volume_fraction2: float | None#

Volume fraction of the 2nd solvent.

Model PreMeasuredSolubility[source]#

Bases: IdsElement

A single solubility measurement

Show JSON schema
{
   "description": "A single solubility measurement",
   "type": "object",
   "properties": {
      "solvent_composition": {
         "$ref": "#/definitions/ThreeSolventMixture",
         "description": "Composition of the solvent mixture used for the solubility measure."
      },
      "temperature": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "Temperature at which solubility is measured."
      },
      "premeasured_solubility": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "Measured solubility with unit."
      }
   },
   "additionalProperties": false,
   "definitions": {
      "RawValueUnit": {
         "additionalProperties": false,
         "description": "A value with a unit, including the raw representation of the value from the primary data.",
         "properties": {
            "value": {
               "description": "A numerical value.",
               "type": [
                  "number",
                  "null"
               ]
            },
            "unit": {
               "description": "Unit for the numerical value.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "raw_value": {
               "description": "The raw, untransformed value from the primary data.",
               "type": [
                  "string",
                  "null"
               ]
            }
         },
         "required": [
            "value",
            "unit",
            "raw_value"
         ],
         "type": "object"
      },
      "ThreeSolventMixture": {
         "additionalProperties": false,
         "description": "Parameters to define the composition of a solvent mixture composed of up to 3 solvents",
         "properties": {
            "solvent1": {
               "description": "Name of the 1st solvent in mixture.",
               "type": "string"
            },
            "solvent2": {
               "description": "Name of the 2nd solvent in mixture.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "volume_fraction1": {
               "description": "Volume fraction of the 1st solvent.",
               "type": [
                  "number",
                  "null"
               ]
            },
            "solvent3": {
               "description": "Name of the 3rd solvent in mixture.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "volume_fraction2": {
               "description": "Volume fraction of the 2nd solvent.",
               "type": [
                  "number",
                  "null"
               ]
            }
         },
         "type": "object"
      }
   }
}

Validators:

field premeasured_solubility: RawValueUnit#

Measured solubility with unit.

field solvent_composition: ThreeSolventMixture#

Composition of the solvent mixture used for the solubility measure.

field temperature: RawValueUnit#

Temperature at which solubility is measured.

Model PredictedSolubility[source]#

Bases: IdsElement

A single solubility prediction

Show JSON schema
{
   "description": "A single solubility prediction",
   "type": "object",
   "properties": {
      "solvent_composition": {
         "$ref": "#/definitions/ThreeSolventMixture",
         "description": "Composition of the solvent mixture used for the solubility prediction."
      },
      "temperature": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "Temperature at which solubility is predicted."
      },
      "predicted_solubility": {
         "$ref": "#/definitions/RawValueUnit",
         "description": "Predicted solubility in the solvent mixture."
      }
   },
   "additionalProperties": false,
   "definitions": {
      "RawValueUnit": {
         "additionalProperties": false,
         "description": "A value with a unit, including the raw representation of the value from the primary data.",
         "properties": {
            "value": {
               "description": "A numerical value.",
               "type": [
                  "number",
                  "null"
               ]
            },
            "unit": {
               "description": "Unit for the numerical value.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "raw_value": {
               "description": "The raw, untransformed value from the primary data.",
               "type": [
                  "string",
                  "null"
               ]
            }
         },
         "required": [
            "value",
            "unit",
            "raw_value"
         ],
         "type": "object"
      },
      "ThreeSolventMixture": {
         "additionalProperties": false,
         "description": "Parameters to define the composition of a solvent mixture composed of up to 3 solvents",
         "properties": {
            "solvent1": {
               "description": "Name of the 1st solvent in mixture.",
               "type": "string"
            },
            "solvent2": {
               "description": "Name of the 2nd solvent in mixture.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "volume_fraction1": {
               "description": "Volume fraction of the 1st solvent.",
               "type": [
                  "number",
                  "null"
               ]
            },
            "solvent3": {
               "description": "Name of the 3rd solvent in mixture.",
               "type": [
                  "string",
                  "null"
               ]
            },
            "volume_fraction2": {
               "description": "Volume fraction of the 2nd solvent.",
               "type": [
                  "number",
                  "null"
               ]
            }
         },
         "type": "object"
      }
   }
}

Validators:

field predicted_solubility: RawValueUnit#

Predicted solubility in the solvent mixture.

field solvent_composition: ThreeSolventMixture#

Composition of the solvent mixture used for the solubility prediction.

field temperature: RawValueUnit#

Temperature at which solubility is predicted.