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.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.