This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (GeometryTools.has2DCoordinates(container)) { | |
renderer.paint(container, new AWTDrawVisitor(g2), bounds, true); | |
} else { | |
// can log or invoke g2.drawString() to display "no coordinates" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// creating the custom matcher | |
IAtomMatcher matcher = and(SymbolMatcher.class, ChargeMatcher.class); | |
if(UniversalIsomorphismTester.isIsomorph(container1, container2, matcher)){ | |
// atoms match charge and symbol | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new AbstractAtomMatcher(){ | |
@Override | |
public Object getAttribute(IAtom atom) { | |
return atom.getProperty("my.custom.property"); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new AbstractAtomMatcher(){ | |
@Override | |
public Object getAttribute(IAtom atom) { | |
return atom.getProperty("stereo.descriptor"); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IMultiOrderQueryBond extends IQueryBond { | |
/** | |
* Access the alternate bond order | |
*/ | |
public IBond.Order getAuxiliaryOrder(); | |
/** | |
* Flips the bond primary and auxiliary orders | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IAtom atom = g1.getAtom(0); | |
// ... | |
String atomSymbol = atom.getSymbol(); | |
return g1.getAtom(0).getSymbol().equals(atomSymbol); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new AbstractAtomMatcher(){ | |
@Override | |
public boolean matchers(IAtom query, IAtom subject) { | |
Object descriptor1 = query.getProperty("stereo.descriptor"); | |
Object descriptor2 = subject.getProperty("stereo.descriptor"); | |
return descriptor1 != null ? descriptor1.equals(descriptor2) : descriptor2 == null; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} else if ("bondStereo".equals(name)) { | |
for (int i = 0; i < atts.getLength(); i++) { | |
if (atts.getQName(i).equals("dictRef")) { | |
if (atts.getValue(i).startsWith("cml:")) | |
bondStereo.add(atts.getValue(i).substring(4)); | |
stereoGiven=true; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- CDK expects --> | |
<bond atomRefs2="a2 a4" order="1"> | |
<bondStereo dictRef="cml:W"/> | |
</bond> | |
<!-- Normally my files have this --> | |
<bond atomRefs2="a2 a4" order="1"> | |
<bondStereo>W</bondStereo> | |
</bond> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void generateImageWithBondsHighlighted() throws Exception { | |
IAtomContainer molecule = MoleculeFactory.makeAdenine(); | |
IAtomContainer selectionMolecule = molecule.getBuilder().newInstance(IAtomContainer.class); | |
for (int i = 0; i < 3; i++) { | |
selectionMolecule.addBond(molecule.getBond(i)); | |
} | |
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); |
OlderNewer