-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add rdkit2oechem atommapper wrapper #24
Comments
So as far as I see it, there are two things that need implementing here right?
|
Maybe this was already linked, but here is a notebook that goes into point 1 https://gist.github.com/bannanc/810ccc4636b930a4522636baab1965a6 |
+1 we pinged the author today and they were ok to get it out under MIT. They did point out that maybe it'd be better long term to leverage the openff code paths for this (since that notebook was exploratory work for that). I think we could do rdkit -> OpenFF -> oechem with minimal code (adds an extra optional dependency but I think long term we'd need it anyways) |
I'm going to bump up the priority to medium here since I'm pretty sure it's necessary to get perses mappers working (we could just send through the original smiles / mol file, but we need to have a mapping between the oechem object and the rdkit molecule). So I thought would have been possible to just rely on openff tk here and avoid spending time on this, but the issue is that we need to keep the mapping on the rdkit <-> oechem transforms so that we can use that to swap around atom mappings come out of things like perses. i.e. what I'm thinking of is the following: def rdkit_to_oechem(rdmol):
... create an oechem molecule from scratch and populate it with the rdkit molecule stuff
return OEmol rdkit_to_oechem_mapping |
In my mind we could do this with a decorator which intercepts rdkit molecules and converts the args, then sniffs outputs of the function it is wrapping and remaps and |
I think so, you'd need to set it up to store the atom index map between the two objects on the way in and remap on the way out? i.e. def _remap(alchemical_map, transform_dictionary):
return remapped_alchemical_map
def perses_mapper(rdkitmol, foo, bar):
oemol, rd_to_oe_map = rkdit_to_oechem(rdkitmol)
alchemical_atom_map = _perses_mapper(oemol)
return AtomMapping(_remap(alchemical_atom_map, rd_to_oe_map)) You can make it fancy with a decorator once that works I guess? |
No description provided.
The text was updated successfully, but these errors were encountered: