private byte[] RenderHighlightedObject(IndigoObject mol, IndigoObject query) { query.aromatize(); IndigoObject matcher = indigo.substructureMatcher(mol); foreach (IndigoObject match in matcher.iterateMatches(query)) { foreach (IndigoObject queryAtom in query.iterateAtoms()) { IndigoObject atom = match.mapAtom(queryAtom); atom.highlight(); foreach (IndigoObject nei in atom.iterateNeighbors()) { if (!nei.isPseudoatom() && !nei.isRSite() && nei.atomicNumber() == 1) { nei.highlight(); nei.bond().highlight(); } } } foreach (IndigoObject bond in query.iterateBonds()) { match.mapBond(bond).highlight(); } } indigo.setOption("render-coloring", false); mol.dearomatize(); mol.layout(); return(renderer.renderToBuffer(mol)); }
private IndigoObject CreateIndigoStructure(Indigo indigo) { // Load the molfile as an Indigo object and set basic properties. IndigoObject structure = indigo.loadMolecule(this.MolfileContents); structure.aromatize(); structure.clearCisTrans(); structure.clearStereocenters(); return(structure); }