<jupyter_start><jupyter_text>ExampleDocumentation at https://github.com/SimonBoothroyd/constructure<jupyter_code># Import the scaffold object which stores the scaffold definition.
from constructure.scaffolds import Scaffold

# Create the imine scaffold.
scaffold = Scaffold(
    smiles="C([R1])([R2])=N([R3])",
    r_groups={
        1: ["hydrogen", "alkyl", "aryl"],
        2: ["hydrogen", "alkyl", "aryl"],
        3: ["hydrogen", "alkyl", "aryl"],
    },
)
# Import the default scaffolds dictionary
from constructure.scaffolds import SCAFFOLDS

# Retrieve the imine scaffold.
scaffold = SCAFFOLDS["imine"]<jupyter_output><empty_output><jupyter_text>Using Openeye based constructor<jupyter_code>from constructure.constructors import OpenEyeConstructor as Constructor
smiles = Constructor.enumerate_combinations(
    scaffold,
    substituents={
        1: ["[R]C", "[R]c1ccccc1"],
        2: ["[R]C(C)(C)", "[R]CC"],
        3: ["[R][H]", "[R]CC"]
    }
)
smiles<jupyter_output><empty_output><jupyter_text>Using in-built substitutents dict<jupyter_code># Import the default substituents dictionary.
from constructure.substituents import SUBSTITUENTS

smiles = Constructor.enumerate_combinations(
    scaffold,
    substituents={
        1: [SUBSTITUENTS["methyl"], SUBSTITUENTS["phenyl"]],
        2: [SUBSTITUENTS["isopropyl"], SUBSTITUENTS["ethyl"]],
        3: [SUBSTITUENTS["hydrogen"], SUBSTITUENTS["ethyl"]]
    }
)
smiles<jupyter_output><empty_output><jupyter_text>Visualizing<jupyter_code># OpenEye
from constructure.utilities.openeye import smiles_to_image_grid

# Save the 2D structures to an image file.
smiles_to_image_grid(smiles, "imines.png", cols=4)
from IPython.display import Image
Image(filename='imines.png')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13458262350936967, 'fraction_numerical': 0.009085746734809767, 'mean_word_length': 5.574626865671642, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '197432', 'license': 'MIT', 'n_tokens_mistral': 652, 'n_tokens_neox': 601, 'n_words': 120, 'path': 'datasets/constructure_sample.ipynb', 'repo_name': 'origamimantis/wbointerpolation', 'size': '1761'}