Last active
December 10, 2015 01:34
-
-
Save mojaie/4359213 to your computer and use it in GitHub Desktop.
This file contains 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
// 水素原子の削除 | |
molecule = (IMolecule) AtomContainerManipulator.removeHydrogens((IAtomContainer) molecule); | |
// 末端、ヘテロ原子上の水素のみ表示 | |
CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(molecule.getBuilder()); | |
for (IAtom atom : molecule.atoms()) { | |
try { | |
IAtomType type = matcher.findMatchingAtomType(molecule, atom); | |
atom.setImplicitHydrogenCount( | |
type.getFormalNeighbourCount() - molecule.getConnectedAtomsCount(atom)); | |
} catch (CDKException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment