Skip to content

Synthesis

albert.resources.synthesis

ColumnDescriptor

Bases: BaseAlbertModel

A single column in the reaction worksheet table.

Show JSON schema:
{
  "description": "A single column in the reaction worksheet table.",
  "properties": {
    "id": {
      "description": "The column identifier.",
      "title": "Id",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The human-readable column heading.",
      "title": "Label"
    },
    "category": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The category the column belongs to.",
      "title": "Category"
    },
    "default": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The default value for cells in this column.",
      "title": "Default"
    },
    "type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The data type of the column's values.",
      "title": "Type"
    }
  },
  "required": [
    "id"
  ],
  "title": "ColumnDescriptor",
  "type": "object"
}

Fields:

id

id: str

The column identifier.

label

label: str | None = None

The human-readable column heading.

category

category: str | None = None

The category the column belongs to.

default

default: Any | None = None

The default value for cells in this column.

type

type: str | None = None

The data type of the column's values.

ColumnSequence

Bases: BaseAlbertModel

The ordered columns shown for reactants and products in the table.

Show JSON schema:
{
  "$defs": {
    "ColumnDescriptor": {
      "description": "A single column in the reaction worksheet table.",
      "properties": {
        "id": {
          "description": "The column identifier.",
          "title": "Id",
          "type": "string"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The human-readable column heading.",
          "title": "Label"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The category the column belongs to.",
          "title": "Category"
        },
        "default": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default value for cells in this column.",
          "title": "Default"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The data type of the column's values.",
          "title": "Type"
        }
      },
      "required": [
        "id"
      ],
      "title": "ColumnDescriptor",
      "type": "object"
    }
  },
  "description": "The ordered columns shown for reactants and products in the table.",
  "properties": {
    "reactants": {
      "description": "The columns, in display order, for the reactant rows.",
      "items": {
        "$ref": "#/$defs/ColumnDescriptor"
      },
      "title": "Reactants",
      "type": "array"
    },
    "products": {
      "description": "The columns, in display order, for the product rows.",
      "items": {
        "$ref": "#/$defs/ColumnDescriptor"
      },
      "title": "Products",
      "type": "array"
    }
  },
  "title": "ColumnSequence",
  "type": "object"
}

Fields:

reactants

reactants: list[ColumnDescriptor]

The columns, in display order, for the reactant rows.

products

The columns, in display order, for the product rows.

RowSequence

Bases: BaseAlbertModel

The ordered row IDs for reactants and products in the table.

Show JSON schema:
{
  "description": "The ordered row IDs for reactants and products in the table.",
  "properties": {
    "reactants": {
      "description": "The reactant row IDs, in display order.",
      "items": {
        "type": "string"
      },
      "title": "Reactants",
      "type": "array"
    },
    "products": {
      "description": "The product row IDs, in display order.",
      "items": {
        "type": "string"
      },
      "title": "Products",
      "type": "array"
    }
  },
  "title": "RowSequence",
  "type": "object"
}

Fields:

reactants

reactants: list[str]

The reactant row IDs, in display order.

products

products: list[str]

The product row IDs, in display order.

ReactionParticipant

Bases: BaseAlbertModel

A single reactant or product row in a reaction.

Show JSON schema:
{
  "description": "A single reactant or product row in a reaction.",
  "properties": {
    "rowId": {
      "description": "The identifier of this row, used to target it in [`update_reactant_row_values`][albert.collections.synthesis.SynthesisCollection.update_reactant_row_values].",
      "title": "Rowid",
      "type": "string"
    },
    "smiles": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The SMILES string of this participant's structure.",
      "title": "Smiles"
    },
    "values": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The quantities entered for this row, keyed by column.",
      "title": "Values"
    },
    "type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The kind of participant (for example, reactant or product).",
      "title": "Type"
    },
    "limitingReagent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether this participant is the limiting reagent.",
      "title": "Limitingreagent"
    }
  },
  "required": [
    "rowId"
  ],
  "title": "ReactionParticipant",
  "type": "object"
}

Fields:

row_id

row_id: str

The identifier of this row, used to target it in update_reactant_row_values.

smiles

smiles: str | None = None

The SMILES string of this participant's structure.

values

values: dict[str, Any] | None = None

The quantities entered for this row, keyed by column.

type

type: str | None = None

The kind of participant (for example, reactant or product).

limiting_reagent

limiting_reagent: str | bool | None = None

Whether this participant is the limiting reagent.

Synthesis

Bases: BaseAlbertModel

A synthesis (reaction) record documenting a chemical reaction.

Captures a reaction drawn on a Ketcher canvas together with its reactant and product rows and their quantities. Retrieve one with get_by_id, edit the updatable fields, and save with update.

Show JSON schema:
{
  "$defs": {
    "AuditFields": {
      "description": "The audit fields for a resource",
      "properties": {
        "by": {
          "default": null,
          "title": "By",
          "type": "string"
        },
        "byName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Byname"
        },
        "at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "At"
        }
      },
      "title": "AuditFields",
      "type": "object"
    },
    "ColumnDescriptor": {
      "description": "A single column in the reaction worksheet table.",
      "properties": {
        "id": {
          "description": "The column identifier.",
          "title": "Id",
          "type": "string"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The human-readable column heading.",
          "title": "Label"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The category the column belongs to.",
          "title": "Category"
        },
        "default": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The default value for cells in this column.",
          "title": "Default"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The data type of the column's values.",
          "title": "Type"
        }
      },
      "required": [
        "id"
      ],
      "title": "ColumnDescriptor",
      "type": "object"
    },
    "ColumnSequence": {
      "description": "The ordered columns shown for reactants and products in the table.",
      "properties": {
        "reactants": {
          "description": "The columns, in display order, for the reactant rows.",
          "items": {
            "$ref": "#/$defs/ColumnDescriptor"
          },
          "title": "Reactants",
          "type": "array"
        },
        "products": {
          "description": "The columns, in display order, for the product rows.",
          "items": {
            "$ref": "#/$defs/ColumnDescriptor"
          },
          "title": "Products",
          "type": "array"
        }
      },
      "title": "ColumnSequence",
      "type": "object"
    },
    "ReactionParticipant": {
      "description": "A single reactant or product row in a reaction.",
      "properties": {
        "rowId": {
          "description": "The identifier of this row, used to target it in [`update_reactant_row_values`][albert.collections.synthesis.SynthesisCollection.update_reactant_row_values].",
          "title": "Rowid",
          "type": "string"
        },
        "smiles": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The SMILES string of this participant's structure.",
          "title": "Smiles"
        },
        "values": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The quantities entered for this row, keyed by column.",
          "title": "Values"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The kind of participant (for example, reactant or product).",
          "title": "Type"
        },
        "limitingReagent": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether this participant is the limiting reagent.",
          "title": "Limitingreagent"
        }
      },
      "required": [
        "rowId"
      ],
      "title": "ReactionParticipant",
      "type": "object"
    },
    "RowSequence": {
      "description": "The ordered row IDs for reactants and products in the table.",
      "properties": {
        "reactants": {
          "description": "The reactant row IDs, in display order.",
          "items": {
            "type": "string"
          },
          "title": "Reactants",
          "type": "array"
        },
        "products": {
          "description": "The product row IDs, in display order.",
          "items": {
            "type": "string"
          },
          "title": "Products",
          "type": "array"
        }
      },
      "title": "RowSequence",
      "type": "object"
    }
  },
  "description": "A synthesis (reaction) record documenting a chemical reaction.\n\nCaptures a reaction drawn on a Ketcher canvas together with its reactant and\nproduct rows and their quantities. Retrieve one with\n[`get_by_id`][albert.collections.synthesis.SynthesisCollection.get_by_id], edit the\nupdatable fields, and save with\n[`update`][albert.collections.synthesis.SynthesisCollection.update].",
  "properties": {
    "albertId": {
      "description": "The Synthesis ID (format ``SYN...``).",
      "title": "Albertid",
      "type": "string"
    },
    "parentId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Notebook ID that owns this record (format ``NTB...``).",
      "title": "Parentid"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The human-readable name of the synthesis.",
      "title": "Name"
    },
    "status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the synthesis record.",
      "title": "Status"
    },
    "blockId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Ketcher block ID this synthesis is associated with.",
      "title": "Blockid"
    },
    "inventoryId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Inventory ID backing the reaction worksheet, set once the reactant/product table is initialized.",
      "title": "Inventoryid"
    },
    "hideReactionWorksheet": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the reaction worksheet table is hidden.",
      "title": "Hidereactionworksheet"
    },
    "s3Key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The storage key for the record's canvas assets.",
      "title": "S3Key"
    },
    "canvasData": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The serialized Ketcher canvas data and preview image.",
      "title": "Canvasdata"
    },
    "smiles": {
      "description": "The reaction SMILES strings for the drawn reaction.",
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": "Smiles",
      "type": "array"
    },
    "reactants": {
      "description": "The reactant rows of the reaction.",
      "items": {
        "$ref": "#/$defs/ReactionParticipant"
      },
      "title": "Reactants",
      "type": "array"
    },
    "products": {
      "description": "The product rows of the reaction.",
      "items": {
        "$ref": "#/$defs/ReactionParticipant"
      },
      "title": "Products",
      "type": "array"
    },
    "columnSequence": {
      "anyOf": [
        {
          "$ref": "#/$defs/ColumnSequence"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ordered columns for the reactant and product tables."
    },
    "rowSequence": {
      "anyOf": [
        {
          "$ref": "#/$defs/RowSequence"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ordered reactant and product row IDs."
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit information about when and by whom the record was created."
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit information about the most recent update."
    }
  },
  "required": [
    "albertId"
  ],
  "title": "Synthesis",
  "type": "object"
}

Fields:

id

The Synthesis ID (format SYN...).

parent_id

parent_id: NotebookId | str | None = None

The Notebook ID that owns this record (format NTB...).

name

name: str | None = None

The human-readable name of the synthesis.

status

status: str | None = None

The status of the synthesis record.

block_id

block_id: str | None = None

The Ketcher block ID this synthesis is associated with.

inventory_id

inventory_id: str | None = None

The Inventory ID backing the reaction worksheet, set once the reactant/product table is initialized.

hide_reaction_worksheet

hide_reaction_worksheet: str | bool | None = None

Whether the reaction worksheet table is hidden.

s3_key

s3_key: str | None = None

The storage key for the record's canvas assets.

canvas_data

canvas_data: dict[str, Any] | None = None

The serialized Ketcher canvas data and preview image.

smiles

smiles: list[str | None]

The reaction SMILES strings for the drawn reaction.

reactants

The reactant rows of the reaction.

products

The product rows of the reaction.

column_sequence

column_sequence: ColumnSequence | None = None

The ordered columns for the reactant and product tables.

row_sequence

row_sequence: RowSequence | None = None

The ordered reactant and product row IDs.

created

created: AuditFields | None = None

Audit information about when and by whom the record was created.

updated

updated: AuditFields | None = None

Audit information about the most recent update.

ReactantValues

Bases: BaseAlbertModel

The quantities entered for a single reactant row.

Passed to update_reactant_row_values to set a reactant's amounts. Any field left as None is not set.

Example

from albert.resources.synthesis import ReactantValues
values = ReactantValues(mass=10.0, eq=1.0)
Show JSON schema:
{
  "description": "The quantities entered for a single reactant row.\n\nPassed to\n[`update_reactant_row_values`][albert.collections.synthesis.SynthesisCollection.update_reactant_row_values]\nto set a reactant's amounts. Any field left as ``None`` is not set.\n\n!!! example\n    ```python\n    from albert.resources.synthesis import ReactantValues\n    values = ReactantValues(mass=10.0, eq=1.0)\n    ```",
  "properties": {
    "mass": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The mass of the reactant.",
      "title": "Mass"
    },
    "moles": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The amount of the reactant in moles.",
      "title": "Moles"
    },
    "eq": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The number of equivalents of the reactant.",
      "title": "Eq"
    },
    "concentration": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The concentration of the reactant.",
      "title": "Concentration"
    }
  },
  "title": "ReactantValues",
  "type": "object"
}

Fields:

mass

mass: float | None = None

The mass of the reactant.

moles

moles: float | None = None

The amount of the reactant in moles.

eq

eq: float | None = None

The number of equivalents of the reactant.

concentration

concentration: float | int | None = None

The concentration of the reactant.