Closed ChayaSt closed 5 years ago
@dgasmith, thanks for the review but the request was my mistake. I meant to ask @j-wags since he's taking over maintenance of this repo.
We decided not to worry about self symmetries when generating atom maps as long as the molecules are chemically equivalent.
In get_atom_map
, instead of using the mapped SMILES as the SMARTS pattern for substructure search, I create a molecule from the mapped SMILES so the atoms not have the atom map, then canonicalize the order with canonical_order_atoms
and used this molecule as the pattern for the substructure search. This seems to give the same order without flipping symmetrical atoms for the molecules I tested, but there is no guarantee that this is exhaustive.
Edit: Actually, it still flips the atoms but that's OK.
The following changes were made in this PR to address the issue in https://github.com/openforcefield/fragmenter/issues/27
strict
is True, to_molecule_ids
does not return a mapped SMILE unless the input molecule has geometryget_atom_map
will use a substructure search the geometry will be ordered with the atom map.
Description
The PR addresses several issues with atom map indices.
Get an atom map for a molecule to the map indices on the mapped SMILES
{MapIdx:Idx}
There are 2 ways to get an atom map {MapIdx:atomIdx}:Conformations generated from molecules that have map indices are different than ones generated without map indices. From openeye support:
has_atom_map
returnedFalse
even if only one atom did not have a map index.Todos
Notable points that this PR has either accomplished or will accomplish.
has_atom_map
returnsTrue
if one atom has a map index.is_missing_atom_map
to returnTrue
if any atom is missing a map index.get_atom_map
to create atom map from map indices on molecule (check order first)Status