Visualization
to_image(safe_str, fragments=None, legend=None, mol_size=(300, 300), use_svg=True, highlight_mode='lasso', highlight_bond_width_multiplier=12, **kwargs)
¶
Display a safe string by highlighting the fragments that make it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
safe_str
|
str
|
the safe string to display |
required |
fragments
|
Optional[Union[str, Mol]]
|
list of fragment to highlight on the molecules. If None, will use safe decomposition of the molecule. |
None
|
legend
|
Union[str, None]
|
A string to use as the legend under the molecule. |
None
|
mol_size
|
Union[Tuple[int, int], int]
|
The size of the image to be returned |
(300, 300)
|
use_svg
|
Optional[bool]
|
Whether to return an svg or png image |
True
|
highlight_mode
|
Optional[str]
|
the highlight mode to use. One of ["lasso", "fill", "color"]. If None, no highlight will be shown |
'lasso'
|
highlight_bond_width_multiplier
|
int
|
the multiplier to use for the bond width when using the 'fill' mode |
12
|
**kwargs
|
Any
|
Additional arguments to pass to the drawing function. See RDKit
documentation related to |
{}
|
Source code in safe/viz.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|