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 )
static class Pred6MemAromAtom extends OEUnaryAtomPred { @Override public boolean constCall(OEAtomBase atom) { return atom.IsAromatic() && oechem.OEAtomIsInAromaticRingSize(atom, 6); } @Override public OEUnaryAtomBoolFunc CreateCopy() { OEUnaryAtomBoolFunc copy = new Pred6MemAromAtom(); copy.swigReleaseOwnership(); return copy; } } static class Pred6MemAromBond extends OEUnaryBondPred { @Override public boolean constCall(OEBondBase bond) { return bond.IsAromatic() && oechem.OEBondIsInAromaticRingSize(bond, 6); } @Override public OEUnaryBondBoolFunc CreateCopy() { OEUnaryBondBoolFunc copy = new Pred6MemAromBond(); copy.swigReleaseOwnership(); return copy; } } private static void OEAddHighlighting_Predicate(OE2DActiveSiteDisplay adisp) { OEHighlightByBallAndStick highlight = new OEHighlightByBallAndStick(oechem.getOEBlueTint()); oegrapheme.OEAddLigandHighlighting(adisp, highlight, new Pred6MemAromAtom()); oegrapheme.OEAddLigandHighlighting(adisp, highlight, new Pred6MemAromBond()); } private static void OEAddHighlighting_AtomAndBondPredicate(OE2DActiveSiteDisplay adisp) { OEHighlightByColor highlight = new OEHighlightByColor(oechem.getOEDarkGreen()); oegrapheme.OEAddLigandHighlighting(adisp, highlight, new Pred6MemAromAtom(), new 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)
private static void OEAddHighlighting_OEMatch(OE2DActiveSiteDisplay adisp) { OEMolBase ligand = adisp.GetDisplayedLigand(); OESubSearch subs = new OESubSearch("a1aaaaa1"); OEColorIter citer = oechem.OEGetVividColors(); boolean unique = true; for (OEMatchBase match : subs.Match(ligand, unique)) { if (citer.hasNext()) { OEHighlightByLasso highlight = new OEHighlightByLasso(citer.next()); highlight.SetConsiderAtomLabelBoundingBox(true); oegrapheme.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)
private static void OEAddHighlighting_OEAtomBondSet(OE2DActiveSiteDisplay adisp) { OEMolBase ligand = adisp.GetDisplayedLigand(); OEAtomBondSet abset = new OEAtomBondSet(ligand.GetAtoms(new Pred6MemAromAtom()), ligand.GetBonds(new Pred6MemAromBond())); OEHighlightByCogwheel highlight = new OEHighlightByCogwheel(oechem.getOEPinkTint()); highlight.SetInnerContour(false); oegrapheme.OEAddLigandHighlighting(adisp, highlight, abset); }