smartsexplore.molecules.actions module

Functions that interact with the database and external programs to manage molecule and molecule-SMARTS match data.

smartsexplore.molecules.actions.calculate_molecule_matches(uploaded_molecules_file: BinaryIO)smartsexplore.database.models.MoleculeSet

Calculate molecule matches of all SMARTS in the database given a molecule file, and store the Molecule and Match instances in the database.

Parameters

uploaded_molecules_file – An open file handle to a molecule file to match

smartsexplore.molecules.actions.create_molecules_from_smiles_file(file: BinaryIO)smartsexplore.database.models.MoleculeSet

Reads in a .smiles file and constructs Molecule instances from it, all linked to a single new MoleculeSet instance.

Parameters

file – A file handle to a .smiles file.

Returns

The newly created MoleculeSet instance. The created Molecule instances are available as its .molecules property.