OEAddLigandHighlighting¶
Highlights atoms and/or bonds of the displayed ligand.
Link |
Description |
---|---|
highlights ligand atoms with OEHighlightBase |
|
highlights ligand bonds with OEHighlightBase |
|
OEAddLigandHighlighting(adisp, highlight, atompred, bondpred) |
highlights ligand atoms and bonds with OEHighlightBase |
highlights ligand atoms and bonds of a match with OEHighlightBase |
|
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.
See also
OEHighlightByColor class
OEHighlightByCogwheel class
OEHighlightByStick class
OEHighlightByLasso class
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()); }
See also
Predicate Functors chapter in the OEChem TK manual
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); } }
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); }