Skip to content

Commit

Permalink
Merge pull request #172 from cdk/DyAromSValence
Browse files Browse the repository at this point in the history
Looks good.
  • Loading branch information
egonw committed Nov 10, 2015
2 parents 81c437a + e9e3fd5 commit c4c50b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -271,10 +271,12 @@ private static boolean normal(int element, int charge, int valence) {
if (charge == +1) return valence == 4;
return charge == 0 && (valence == 3 || (valence == 5 && element == NITROGEN));
case OXYGEN:
if (charge == +1) return valence == 3;
return charge == 0 && valence == 2;
case SULPHUR:
case SELENIUM:
if (charge == +1) return valence == 3;
return charge == 0 && valence == 2;
return charge == 0 && (valence == 2 || valence == 4 || valence == 6);
}
return false;
}
Expand Down
Expand Up @@ -208,6 +208,10 @@ public void abnormalValence_nitrogenCation() throws Exception {
test(smiles("C1=CC(=C([N+]=C1)N)[N+](=O)[O-]"), 1, 1, 1, 1, -1, 1, -1, -1, -1, -1);
}

@Test public void thiazole1oxide() throws Exception {
test(smiles("O=S1C=NC=C1"), -1, 2, 1, 1, 1, 1);
}

static IAtomContainer addHydrogens(IAtomContainer container) throws CDKException {
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(container);
CDKHydrogenAdder.getInstance(container.getBuilder()).addImplicitHydrogens(container);
Expand Down

0 comments on commit c4c50b3

Please sign in to comment.