src package

Submodules

src.Molecule module

src.sketchedMolecule module

class src.sketchedMolecule.sketchedMolecule(mol_block)

Bases: object

descriptors()

Calculate molecule descriptor metrics as dict: | mol - RDKit molecule | MW - molecular weight | logP - logP | TPSA - topological polar surface area | HA - heavy atom count | h_acc - H acceptor count | h_don - H donator count | rings - ring count

Returns:

molecule descriptor metrics

Return type:

dict

drawMoleculeAsByteStream(size=None)

Returns png image of molecule as bytestream

Returns:

base64 png image bytestream

Return type:

str

drug_properties()

Predicts properties of the final drug from the models trained on the MMP12 dataset (assay_ml_models). See assays_models.ipynb.

Returns:

dictionary with each property as a key and the predicted value

from the ML models as the value :rtype: dict

filter_properties()

Calculates whether molecule passes or fails PAINS filters (PAINS, ZINC, BRENK, NIH).

Returns:

Dictionary of if it passes each type of PAINS filters for

each case. :rtype: dict

lipinski()

Calculate Lipinski from the descriptor dictionary. Returns the number of rules broken and whether the molecule passes.

Parameters:

desc_dict – Molecule descriptor metrics calculated by

descriptors(). :type desc_dict: dict :return: Dictionary of it passes the Lipinski Rules for each case. :rtype: dict

property smiles

Returns smile string for the molecule

Returns:

smiles string

Type:

str

src.user module

class src.user.User(username, session_data=None)

Bases: object

User class that defines the users of the game. Stores the game information.

get_chosen_molecule()

Returns chosen molecule as final molecule

Returns:

Chosen molecule as a list of keys

Return type:

list

get_molecule_info()

Returns molecules saved and their info during a game

Returns:

Molecule information

Return type:

dict

save_game(game_data)

Saves user information as a dictionaruy and saves to file. File is named after user and the time of saving.

set_chosen_molecule(chosen_mol)

Set chosen molecule in object as chosen_mol

Parameters:

chosen_mol (list) – The chosen mol, sent from the front-end

Returns:

The chosen molecule

Return type:

list

update_molecule_info(update_dict)

Updated molecule_info with a new dictionary, update_dict

Parameters:

update_dict (dict) – The updated saved molecules and their information

Returns:

None

Return type:

None

Module contents