for (IAtomContainer container : ChemModelManipulator
.getAllAtomContainers(chemModel)) {
for (IAtom atom : container.atoms()) {
if (!(atom instanceof IPseudoAtom)) {
try {
IAtomType type = matcher.findMatchingAtomType(container, atom);
if (type != null
&& !type.getAtomTypeName().equals("X")
&& type.getFormalNeighbourCount() != null) {
int connectedAtomCount = container
.getConnectedAtomsCount(atom);
atomHydrogenCountsMap.put(atom, new Integer[]{
type.getFormalNeighbourCount()
- connectedAtomCount,
atom.getImplicitHydrogenCount()});
atom.setImplicitHydrogenCount(type.getFormalNeighbourCount()
- connectedAtomCount);
} else {
atom.setImplicitHydrogenCount(0);
}