API Documentation for Drawer
- class mdonatello.drawer.FunctionalGroupHighlighter(molecule: Mol, checkboxes: Dict[str, Checkbox])[source]
Bases:
objectA class responsible for highlighting of the functional groups in a molecule.
Parameters:
- moleculeRDKit.Chem.Mol
An RDKit molecule object representing the molecule that should be highlighted.
- checkboxesdict
A dictionary of checkbox widgets indicating which functional groups to highlight. Keys are functional group names (e.g., “Alcohol”), and values are the corresponding checkbox widgets.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted, respectively.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- determine_highlights() Tuple[Dict[str, List[int]], Dict[int, str]][source]
Determine the atom and bond indices to highlight based on the selected functional groups.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- class mdonatello.drawer.MoleculeDrawer(molecule: Mol, pharmacophore_checkboxes: Dict[str, Checkbox], functional_groups_checkboxes: Dict[str, Checkbox], rotatable_bonds_checkbox: Checkbox, partial_charges_checkbox: Checkbox, partial_charges_heatmap_checkbox: Checkbox, stereocenters_checkbox: Checkbox, murcko_scaffold_checkbox: Checkbox, factory: MolChemicalFeatureFactory)[source]
Bases:
objectA class for drawing a molecule with various highlighted features.
Parameters:
- moleculeRDKit.Chem.Mol
An RDKit molecule object representing the molecule to be drawn.
- pharmacophore_checkboxesdict
A dictionary of checkbox widgets indicating which pharmacophore features to highlight. Keys are pharmacophore feature names (e.g., “Aromatic”), and values are the corresponding checkbox widgets.
- functional_groups_checkboxesdict
A dictionary of checkbox widgets indicating which functional groups to highlight. Keys are functional group names (e.g., “Alcohol”), and values are the corresponding checkbox widgets.
- rotatable_bonds_checkboxCheckbox
A checkbox widget indicating whether to highlight rotatable bonds of the molecule.
- partial_charges_checkboxCheckbox
A checkbox widget indicating whether to display partial charges of the molecule.
- partial_charges_heatmap_checkboxCheckbox
A checkbox widget indicating whether to use a heatmap for partial charges of the molecule.
- stereocenters_checkboxCheckbox
A checkbox widget indicating whether to highlight the stereocenters of the molecule.
- murcko_scaffold_checkboxCheckbox
A checkbox widget indicating whether to highlight the Murcko scaffold of the molecule.
- factoryChemicalFeatures.MolChemicalFeatureFactory
A factory object used to generate pharmacophore features for the molecule.
Returns:
- svgstr
An SVG string representing the drawn molecule with highlighted features.
- draw_molecule(show_atom_indices: bool, width: int, height: int) str[source]
Draws the molecule with the highlighted features.
Parameters:
- show_atom_indicesbool
Whether to show atom indices on the drawn molecule.
- widthint
Width of the drawing canvas.
- heightint
Height of the drawing canvas.
Returns:
- svgstr
An SVG string representing the drawn molecule with highlighted features.
- class mdonatello.drawer.MurckoScaffoldHighlighter(molecule: Mol, checkbox: Dict[str, Checkbox])[source]
Bases:
objectA class responsible for highlighting of the Murcko scaffold in a molecule.
Parameters:
- moleculeRDKit.Chem.rdchem.Mol
An RDKit molecule object representing the molecule that should be highlighted.
- checkboxCheckbox
A checkbox widget indicating whether to highlight the Murcko scaffold of the molecule.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted, respectively.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- determine_highlights() Tuple[Dict[str, List[int]], Dict[int, str]][source]
Determines the atom and bond indices to highlight them based on the presence of Murcko scaffolds.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- class mdonatello.drawer.PartialChargeHighlighter(molecule: Mol, checkbox: Dict[str, Checkbox])[source]
Bases:
objectA class responsible for highlighting of partial charges in a molecule.
Parameters:
- moleculeRDKit.Chem.rdchem.Mol
An RDKit molecule object representing the molecule that should be highlighted.
- checkboxCheckbox
A checkbox widget indicating whether to highlight the partial charges of the molecule.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted, respectively.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- determine_highlights() Tuple[Dict[str, List[int]], Dict[int, str]][source]
Determines the atom and bond indices to highlight them based on the partial charges.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- class mdonatello.drawer.PharmacophoreHighlighter(molecule: Mol, pharmacophore_checkboxes: Dict[str, Checkbox], factory: MolChemicalFeatureFactory)[source]
Bases:
objectA class responsible for highlighting of pharmacophore features in a molecule.
Parameters:
- moleculeRDKit.Chem.Mol
An RDKit molecule object representing the molecule that should be highlighted.
- pharmacophore_checkboxesdict
A dictionary of checkbox widgets indicating which pharmacophore features to highlight. Keys are pharmacophore feature names (e.g., “Aromatic”), and values are the corresponding checkbox widgets.
- factoryRDKit.Chem.ChemicalFeatures.MolChemicalFeatureFactory
A factory object used to generate pharmacophore features available in RDKit for the given molecule.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted, respectively.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective colors that should be used for highlighting.
- determine_highlights() Tuple[Dict[str, List[int]], Dict[int, str]][source]
Determines the atom and bond indices to highlight them based on the selected pharmacophore features.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- class mdonatello.drawer.RotatableBondsHighlighter(molecule: Mol, checkbox: Dict[str, Checkbox])[source]
Bases:
objectA class responsible for highlighting of rotatable bonds in a molecule.
Parameters:
- moleculeRDKit.Chem.rdchem.Mol
An RDKit molecule object representing the molecule that should be highlighted.
- checkboxCheckbox
A checkbox widget indicating whether to highlight rotatable bonds.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted, respectively.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- determine_highlights() Tuple[Dict[str, List[int]], Dict[int, str]][source]
Determines the atom and bond indices to highlight them based on the presence of rotatable bonds.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- class mdonatello.drawer.StereocenterHighlighter(molecule: Mol, checkbox: Dict[str, Checkbox])[source]
Bases:
objectA class responsible for highlighting of stereocenters in a molecule.
Parameters:
- moleculeRDKit.Chem.rdchem.Mol
An RDKit molecule object representing the molecule that should be highlighted.
- checkboxCheckbox
A checkbox widget indicating whether to highlight the stereocenters of the molecule.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted, respectively.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
- determine_highlights() Tuple[Dict[str, List[int]], Dict[int, str]][source]
Determine the atom and bond indices to highlight based on their stereocenter configuration.
Returns:
- highlightsdict
A dictionary with keys “atoms” and “bonds”, each containing lists of atom indices and bond indices that should be highlighted.
- highlight_colorsdict
A dictionary mapping atom indices and bond indices to their respective highlight colors.
|
A class responsible for highlighting of pharmacophore features in a molecule. |
|
A class responsible for highlighting of the functional groups in a molecule. |
|
A class responsible for highlighting of rotatable bonds in a molecule. |
|
A class responsible for highlighting of partial charges in a molecule. |
|
A class responsible for highlighting of stereocenters in a molecule. |
|
A class responsible for highlighting of the Murcko scaffold in a molecule. |
|
A class for drawing a molecule with various highlighted features. |