-
Notifications
You must be signed in to change notification settings - Fork 11
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
RDkit MCS Subgraph search failed #60
Comments
But why do you need to set hydrogens=True? In general, rdkit MCS works much slower with hydrogens, and can produce poor results. |
I believe, that with Also, I think that you can achieve what you want, without using a mcs = lomap_mcs.MCS(mol1, mol2)
mapping_string = mcs.all_atom_match_list()
mapping_dict = dict(
(map(int, v.split(':')) for v in mapping_string.split(','))
) |
With the example above, I get this: mapping = dict(lomap.MCS.getMapping(small_mol, parent_mol, hydrogens=True))
print("Hydrogen = True",mapping) # 17 atoms are matched {0: 2, 1: 1, 2: 3, 3: 0, 4: 9, 5: 13, 6: 14, 7: 7, 12: 5, 14: 10, 15: 15, 16: 16, 9: 6, 10: 11, 11: 12, 13: 4, 8: 8}
mapping = dict(lomap.MCS.getMapping(small_mol, parent_mol, hydrogens=False))
print("Hydrogen = False",mapping) # 8 atoms are matched {0: 2, 1: 1, 2: 0, 3: 6, 4: 5, 6: 3, 7: 7, 5: 4}
mcs = lomap.MCS(mol1, mol2)
mapping_string = mcs.all_atom_match_list()
print('mapping_string',mapping_string)
mapping_dict = dict(
(map(int, v.split(':')) for v in mapping_string.split(','))
)
print("Mapping dict", mapping_dict) # 2 atoms are matched, {1: 1, 2: 2} It works (definition of works: No error, I get a mapping) when I change the following lines
to
mcs_sub is only needed if a png file is generated. Maybe, this code block could go into |
I am getting 17 atoms matched:
Note, that I am using |
With threed, I get the same results. I have to test, if this method will give me the right results for all other molecules. |
I am not sure what |
I have a problem, that the MCS routine fails depending on atom ordering.
I manipulate a molecule and try to find my original atoms back.
Important is, that it fails when 'removeHs = False'.
Without H it works.
Here is a minimal example:
The text was updated successfully, but these errors were encountered: