Atoms bonded to metal atoms should always have their H counts explicit in SMILES (#8318)

* refactor the code to determine whether or not an atom is in brackets

* move the definition of isMetal to QueryOps

* atoms bound to metals in SMILES should always be in square brackets

Implementation and some test updates

needs confirmation that all of tests run

* basic tests pass

* java tests pass

* update js tests

* doc updates

* Update Code/GraphMol/catch_graphmol.cpp

Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>

* Update Code/GraphMol/SmilesParse/test.cpp

Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>

* finish fixing tests

* bump yaehmop version to allow compilation to work

---------

Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
This commit is contained in:
Greg Landrum
2025-03-29 07:26:03 +01:00
committed by GitHub
parent 643b13cba4
commit 32608ae0b4
23 changed files with 157 additions and 104 deletions

View File

@@ -696,12 +696,12 @@ public class Chemv2Tests extends GraphMolTest {
RDKFuncs.setAllowNontetrahedralChirality(true);
m = RWMol.MolFromMolBlock(ctab);
assertTrue(m != null);
assertEquals(m.MolToSmiles(), "F[Pt@SP3](F)(Cl)Cl");
assertEquals(m.MolToSmiles(), "[F][Pt@SP3]([F])([Cl])[Cl]");
m.delete();
RDKFuncs.setAllowNontetrahedralChirality(false);
m = RWMol.MolFromMolBlock(ctab);
assertTrue(m != null);
assertEquals(m.MolToSmiles(), "F[Pt](F)(Cl)Cl");
assertEquals(m.MolToSmiles(), "[F][Pt]([F])([Cl])[Cl]");
m.delete();
RDKFuncs.setAllowNontetrahedralChirality(allowNonTetrahedralChirality);
} finally {