Skip to content

Commit

Permalink
Watch out for strange valences
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay authored and egonw committed May 9, 2021
1 parent 624a6c3 commit 6922392
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ private Type supportedType(int i, int v, int d, int h, int x) {
if (x == 4 && h == 0 && (q == 0 && v == 5 || q == 1 && v == 4))
return verifyTerminalHCount(i) ? Type.Tetracoordinate : Type.None;
// note: bridgehead not allowed by InChI but makes sense
return x == 3 && h == 0 && (isBridgeHead(i) || inThreeMemberRing(i)) ? Type.Tetracoordinate : Type.None;
return x == 3 && h == 0 && v == 3 && q == 0 &&
(isBridgeHead(i) || inThreeMemberRing(i)) ? Type.Tetracoordinate : Type.None;

case 14: // silicon
if (v != 4 || q != 0) return Type.None;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public void nitrogen_v4_cation_reject_h() throws Exception {
none("[NH4+]");
}


/**
* An atom or positive ion N, P, As, S, or Se is not treated as stereogenic
* if it has - (b) At least two terminal neighbors, XHm and XHn, (n+m>0)
Expand Down Expand Up @@ -789,6 +790,8 @@ public void bridgehead_nitrogens() throws Exception {
none("N1(CCCC2)CCCC12");
// adjacent to fused (but not fused)
tetrahedral("N1(c(cccc3)c32)CC2CC1");

none("[N]2([Mn+]1)=CC=CC3=C2C2=[N]1C=CC=C2C=C3");
}

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

0 comments on commit 6922392

Please sign in to comment.