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

@@ -1171,5 +1171,10 @@ void finalizeQueryFromDescription(
}
}
bool isMetal(const Atom &atom) {
static const std::unique_ptr<ATOM_OR_QUERY> q(makeMAtomQuery());
return q->Match(&atom);
}
} // namespace QueryOps
}; // namespace RDKit