Skip to content

Commit 6922392

Browse files
johnmayegonw
authored andcommitted
Watch out for strange valences
1 parent 624a6c3 commit 6922392

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

base/standard/src/main/java/org/openscience/cdk/stereo/Stereocenters.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ private Type supportedType(int i, int v, int d, int h, int x) {
527527
if (x == 4 && h == 0 && (q == 0 && v == 5 || q == 1 && v == 4))
528528
return verifyTerminalHCount(i) ? Type.Tetracoordinate : Type.None;
529529
// note: bridgehead not allowed by InChI but makes sense
530-
return x == 3 && h == 0 && (isBridgeHead(i) || inThreeMemberRing(i)) ? Type.Tetracoordinate : Type.None;
530+
return x == 3 && h == 0 && v == 3 && q == 0 &&
531+
(isBridgeHead(i) || inThreeMemberRing(i)) ? Type.Tetracoordinate : Type.None;
531532

532533
case 14: // silicon
533534
if (v != 4 || q != 0) return Type.None;

base/test-standard/src/test/java/org/openscience/cdk/stereo/StereocentersTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public void nitrogen_v4_cation_reject_h() throws Exception {
212212
none("[NH4+]");
213213
}
214214

215+
215216
/**
216217
* An atom or positive ion N, P, As, S, or Se is not treated as stereogenic
217218
* if it has - (b) At least two terminal neighbors, XHm and XHn, (n+m>0)
@@ -789,6 +790,8 @@ public void bridgehead_nitrogens() throws Exception {
789790
none("N1(CCCC2)CCCC12");
790791
// adjacent to fused (but not fused)
791792
tetrahedral("N1(c(cccc3)c32)CC2CC1");
793+
794+
none("[N]2([Mn+]1)=CC=CC3=C2C2=[N]1C=CC=C2C=C3");
792795
}
793796

794797
// assert the first atom of the SMILES is accepted as a tetrahedral center

0 commit comments

Comments
 (0)