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 : public OEUnaryPredicate<OEAtomBase>
    {
    public:
      bool operator()(const OEAtomBase &atom) const
      {
        return atom.IsAromatic() && OEAtomIsInAromaticRingSize(atom, 6);
      }
      OEUnaryFunction<OEAtomBase,bool> *CreateCopy() const
      {
        return new Pred6MemAromAtom;
      }
    };
    
    class Pred6MemAromBond : public OEUnaryPredicate<OEBondBase>
    {
    public:
      bool operator()(const OEBondBase &bond) const
      {
        return bond.IsAromatic() && OEBondIsInAromaticRingSize(bond, 6);
      }
      OEUnaryFunction<OEBondBase,bool> *CreateCopy() const
      {
        return new Pred6MemAromBond;
      }
    };
    
    void OEAddHighlighting_Predicate(OE2DActiveSiteDisplay& adisp)
    {
      OEHighlightByBallAndStick highlight(OEBlueTint);
      OEAddLigandHighlighting(adisp, highlight, Pred6MemAromAtom());
      OEAddLigandHighlighting(adisp, highlight, Pred6MemAromBond());
    }
    
    void OEAddHighlighting_AtomAndBondPredicate(OE2DActiveSiteDisplay& adisp)
    {
      OEHighlightByColor highlight(OEDarkGreen);
      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)

    void OEAddHighlighting_OEMatch(OE2DActiveSiteDisplay& adisp)
    {
      const OEMolBase* ligand = adisp.GetDisplayedLigand();
      OESubSearch subs("a1aaaaa1");
      OEIter<const OEColor> color = OEGetVividColors();
      bool unique = true;
      for (OEIter<OEMatchBase> match = subs.Match(*ligand, unique); color && match; ++color, ++match)
      {
        OEHighlightByLasso highlight(*color);
        highlight.SetConsiderAtomLabelBoundingBox(true);
        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)

    void OEAddHighlighting_OEAtomBondSet(OE2DActiveSiteDisplay& adisp)
    {
      const OEMolBase* ligand = adisp.GetDisplayedLigand();
      OEHighlightByCogwheel highlight(OEPinkTint);
      highlight.SetInnerContour(false);
      OEAtomBondSet abset(ligand->GetAtoms(Pred6MemAromAtom()),
                          ligand->GetBonds(Pred6MemAromBond()));
      OEAddLigandHighlighting(adisp,highlight, abset);
    }
    
../../_images/OEAddHighlighting-ActiveSite-OEAtomBondSet.png

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