OEAddLigandHighlighting

Highlights atoms and/or bonds of the displayed ligand.

The overloaded versions of the OEAddLigandHighlighting function

Link

Description

OEAddLigandHighlighting(disp, highlight, atompred)

highlights ligand atoms with OEHighlightBase

OEAddLigandHighlighting(adisp, highlight, bondpred)

highlights ligand bonds with OEHighlightBase

OEAddLigandHighlighting(adisp, highlight, atompred, bondpred)

highlights ligand atoms and bonds with OEHighlightBase

OEAddLigandHighlighting(adisp, highlight, match)

highlights ligand atoms and bonds of a match with OEHighlightBase

OEAddLigandHighlighting(adisp, highlight, abset)

highlights ligand atoms and bonds of a set with OEHighlightBase

Parameters :

adisp

The OE2DActiveSiteDisplay object of which ligand atoms add/or ligand bonds being highlighted.

highlight

The OEHighlightBase object that specifies the style of the highlighting.

atompred

OEAddLigandHighlighting function highlights only ligand atoms for which the given atom predicate returns true.

bondpred

OEAddLigandHighlighting function highlights only ligand bonds for which the given bond predicate returns true.

match

OEAddLigandHighlighting function highlights the target atoms and bonds of the OEMatchBase object.

abset

Stores the ligand atoms and bonds being highlighted.

  1. Highlighting using atom and bond predicates:

    void OEAddLigandHighlighting(OE2DActiveSiteDisplay &adisp, const OEDepict::OEHighlightBase &highlight,
                                 const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &atompred)
    

    Highlights ligand atoms with the style implemented in the given OEHighlightBase object. The atoms being highlighted are specified by given atom predicate.

    void OEAddLigandHighlighting(OE2DActiveSiteDisplay &adisp, const OEDepict::OEHighlightBase &highlight,
                                 const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &bondpred)
    

    Highlights ligand bonds with the style implemented in the given OEHighlightBase object. The bonds being highlighted are specified by given bond predicates.

    void OEAddLigandHighlighting(OE2DActiveSiteDisplay &adisp, const OEDepict::OEHighlightBase &highlight,
                                 const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &atompred,
                                 const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &bondpred)
    

    Highlights ligand atoms and bonds with the style implemented in the given OEHighlightBase object. The atoms and bonds being highlighted are specified by given atom and bond predicates, respectively.

    Example: (See image generated in Example of highlighting 6-membered rings of a ligand using ‘ball and stick’ style and Example of highlighting 6-membered rings of a ligand using ‘color’ style )

    class Pred6MemAromAtom(oechem.OEUnaryAtomPred):
        def __call__(self, atom):
            return atom.IsAromatic() and oechem.OEAtomIsInAromaticRingSize(atom, 6)
    
    
    class Pred6MemAromBond(oechem.OEUnaryBondPred):
        def __call__(self, bond):
            return bond.IsAromatic() and oechem.OEBondIsInAromaticRingSize(bond, 6)
    
    
    def OEAddHighlighting_Predicate(adisp):
        highlight = oedepict.OEHighlightByBallAndStick(oechem.OEBlueTint)
        oegrapheme.OEAddLigandHighlighting(adisp, highlight, Pred6MemAromAtom())
        oegrapheme.OEAddLigandHighlighting(adisp, highlight, Pred6MemAromBond())
    
    
    def OEAddHighlighting_AtomAndBondPredicate(adisp):
        highlight = oedepict.OEHighlightByColor(oechem.OEDarkGreen)
        oegrapheme.OEAddLigandHighlighting(adisp, highlight, Pred6MemAromAtom(), Pred6MemAromBond())
    
../../_images/OEAddHighlighting-ActiveSite-Predicate.png

Example of highlighting 6-membered rings of a ligand using ‘ball and stick’ style

../../_images/OEAddHighlighting-ActiveSite-AtomAndBondPredicate.png

Example of highlighting 6-membered rings of a ligand using ‘color’ style

See also

  1. Highlighting using an OEMatchBase object that is initialized by substructure search or maximum common substructure search:

    void OEAddLigandHighlighting(OE2DActiveSiteDisplay &adisp, const OEDepict::OEHighlightBase &highlight,
                                 const OEChem::OEMatchBase &match)
    

    Example: (See image generated in Example of highlighting 6-membered rings of a ligand using ‘lasso’ style)

    def OEAddHighlighting_OEMatch(adisp):
        ligand = adisp.GetDisplayedLigand()
        subs = oechem.OESubSearch("a1aaaaa1")
        colors = oechem.OEGetVividColors()
        unique = True
        for match, color in zip(subs.Match(ligand, unique), colors):
            highlight = oedepict.OEHighlightByLasso(color)
            highlight.SetConsiderAtomLabelBoundingBox(True)
            oegrapheme.OEAddLigandHighlighting(adisp, highlight, match)
    
../../_images/OEAddHighlighting-ActiveSite-OEMatch.png

Example of highlighting 6-membered rings of a ligand using ‘lasso’ style

  1. Highlighting using an OEAtomBondSet object that stores the atoms and bonds being highlighted:

    void OEAddLigandHighlighting(OE2DActiveSiteDisplay &adisp, const OEDepict::OEHighlightBase &highlight,
                                 const OEChem::OEAtomBondSet &abset)
    

    Example: (See image generated in Example of highlighting 6-membered rings of a ligand using ‘cogwheel’ style)

    def OEAddHighlighting_OEAtomBondSet(adisp):
        ligand = adisp.GetDisplayedLigand()
        highlight = oedepict.OEHighlightByCogwheel(oechem.OEPinkTint)
        highlight.SetInnerContour(False)
        abset = oechem.OEAtomBondSet(ligand.GetAtoms(Pred6MemAromAtom()),
                                     ligand.GetBonds(Pred6MemAromBond()))
    
        oegrapheme.OEAddLigandHighlighting(adisp, highlight, abset)
    
../../_images/OEAddHighlighting-ActiveSite-OEAtomBondSet.png

Example of highlighting 6-membered rings of a ligand using ‘cogwheel’ style