Created
October 15, 2015 11:42
-
-
Save johnmay/3ee0e6fa913464b1a9f7 to your computer and use it in GitHub Desktop.
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
| // Pattern interface should be used for matching rather than SMARTSQueryTool, | |
| // more efficient and easier to use. | |
| Pattern carboxy = SmartsPattern.compile("[Ov2X2H1+0]-[Cv4X3]=[Ov2X1H0]", bldr); | |
| // Mappings object has several utils, we need basics only here | |
| for (int[] mapping : caboxy.matchAll(mol).uniqueAtoms()) { | |
| IAtom hydroxy = mol.getAtom(mapping[0]); | |
| hydroxy.setImplicitHydrogenCount(0); | |
| hydroxy.setFormalCharge(-1); | |
| } | |
| // don't output Canonical SMILES | |
| String smi = SmilesGenerator.isomeric().create(mol); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment