Grouper.visualization.visualize_node module

Grouper.visualization.visualize_node.visualize_group(node, text='', draw_numbers=False, sanitize_smiles=False, highlight_color=(1.0, 0.5, 0.5, 1.0), draw_options=None)

A method to visualize a node trace, which definies a node and what that node is connected to.

Uses RDKit and PIL to create an image of the Group Node and where is definited to be located in a molecule. Extra arguments can help tune the look of this output image.

Parameters:
Return type:

Image

Notes

This can fail if SMARTS or SMILES are definied incorrectly, or RDKit has trouble parsing them. Parsing info can be found here:

  1. Daylight SMARTS: https://www.daylight.com/dayhtml/doc/theory/theory.smarts.html

  2. Daylight SMILES: https://www.daylight.com/dayhtml/doc/theory/theory.smiles.html

  3. RDKit SMARTS: https://www.rdkit.org/docs/RDKit_Book.html#smarts-support-and-extensions

  4. RDKit SMILES: https://www.rdkit.org/docs/RDKit_Book.html#smiles-support-and-extensions

Grouper.visualization.visualize_node.visualize_group_extension(group_extension, text='Matching Subgraph', sanitize_smiles=False, highlight_color=(1.0, 0.5, 0.5, 1.0), draw_options=None)

A method to visualize a GroupExtension, which definies a node and what that node is connected to.

Uses RDKit and PIL to create an image of the Group Node and where is definited to be located in a molecule. Extra arguments can help tune the look of this output image.

Parameters:
Return type:

Image

Notes

This can fail if SMARTS or SMILES are definied incorrectly, or RDKit has trouble parsing them. Parsing info can be found here:

  1. Daylight SMARTS: https://www.daylight.com/dayhtml/doc/theory/theory.smarts.html

  2. Daylight SMILES: https://www.daylight.com/dayhtml/doc/theory/theory.smiles.html

  3. RDKit SMARTS: https://www.rdkit.org/docs/RDKit_Book.html#smarts-support-and-extensions

  4. RDKit SMILES: https://www.rdkit.org/docs/RDKit_Book.html#smiles-support-and-extensions