create_new_molecule

specatalog.crud_db.create.create_new_molecule(data)[source]

Create a new database entry for the molecule table.

The entry is created and the path for the structural formula is set automatically from the MEASUREMTS_PATH and the molecule-id.

The entry is added and commited.

Parameters:

data (MoleculeModel) – Model from models.creation_pydantic_molecules. The class of the model classifies the group of the molecule e.g. TDP or RP.

Returns:

molecule – Object from the models.molecules.Molecule class (=sqalchemy model). The subclass is dependent on the chosen molecule group.

Return type:

Molecule