COCONUT Modules#

app.modules.coconut.preprocess module#

app.modules.coconut.preprocess.get_COCONUT_preprocessing(input_text)[source]#

Preprocess user input text suitable for the COCONUT database submission.

data.

Return type:

dict

Args:

input_text (str): Input text (Mol/str).

Returns:

dict: COCONUT preprocessed data.

app.modules.coconut.preprocess.get_mol_block(input_text)[source]#

Generate a Molblock from input text using CDK.

Return type:

str

Args:

input_text (str): Input text (Mol/SMILES).

Returns:

str: Molblock representation.

Raises:

ValueError: If input_text is not a valid Mol or SMILES.

app.modules.coconut.preprocess.get_molecule_hash(molecule)[source]#

Return various molecule hashes for the provided SMILES.

Return type:

dict

Args:

smiles (str): Standardized SMILES string.

Returns:

dict: Dictionary containing Formula, Isomeric SMILES, and Canonical SMILES.

app.modules.coconut.preprocess.get_representations(molecule)[source]#

Return COCONUT representations for the provided SMILES.

Return type:

dict

Args:

smiles (str): SMILES string.

Returns:

dict: Dictionary containing InChI, InChi Key, and Murko framework.

app.modules.coconut.descriptors module#

app.modules.coconut.descriptors.get_COCONUT_descriptors(smiles, toolkit)[source]#

Calculate COCONUT descriptors using RDKit or CDK toolkit for the given.

SMILES.

Return type:

Union[Dict[str, float], str]

Args:

smiles (str): SMILES input. toolkit (str): Toolkit choice (“rdkit” or “cdk”).

Returns:
dict or str: Dictionary of COCONUT descriptors and their values if successful,

or an error message if the toolkit choice is invalid or SMILES is invalid.

app.modules.coconut.descriptors.get_descriptors(smiles, toolkit)[source]#

Calculate descriptors using RDKit or CDK toolkit for the given SMILES.

Return type:

Union[tuple, str]

Args:

smiles (str): SMILES input. toolkit (str): Toolkit choice (“rdkit” or “cdk”).

Returns:
dict or str: Dictionary of descriptors and their values if successful,

or an error message if the toolkit choice is invalid or SMILES is invalid.