We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I discovered some strange behavior of removeHs function applied for '[H][*:1]' molecule.
If I create that mol from smiles, RemoveHs does not remove a single H from the mol:
mmm = Chem.MolFromSmiles('[H][*:1]') Chem.MolToSmiles(Chem.RemoveHs(mmm))
output:
'[H][*:1]'
If I apply RemoveHs to fragments obtained after MMPA cuts it removes H and keeps only '[*:1]'
mmm = Chem.MolFromSmiles('c1ccccc1C') mmm = Chem.AddHs(mmm) fr = rdMMPA.FragmentMol(mmm, pattern="[*]!@!=!#[!#1]", maxCuts=1, resultsAsMols=True) for f in fr: ff = Chem.GetMolFrags(f[1], asMols=True) print(Chem.MolToSmiles(ff[0]), Chem.MolToSmiles(Chem.RemoveHs(ff[0]))) print(Chem.MolToSmiles(ff[1]), Chem.MolToSmiles(Chem.RemoveHs(ff[1])))
[H]c1c([H])c([H])c([*:1])c([H])c1[H] c1ccc([*:1])cc1 [H]C([H])([H])[*:1] C[*:1] [H]c1c([H])c([H])c([*:1])c(C([H])([H])[H])c1[H] Cc1ccccc1[*:1] [H][*:1] [*:1] [H]c1c([H])c(C([H])([H])[H])c([H])c([*:1])c1[H] Cc1cccc([*:1])c1 [H][*:1] [*:1] [H]c1c([H])c([*:1])c([H])c([H])c1C([H])([H])[H] Cc1ccc([*:1])cc1 [H][*:1] [*:1] [H]c1c([H])c([H])c(C([H])([H])[*:1])c([H])c1[H] c1ccc(C[*:1])cc1 [H][*:1] [*:1]
The text was updated successfully, but these errors were encountered:
What's going on here: AddHs() tags the Hs that it adds as implicit. This ends up taking priority over the check for Hs that are attached to non-heavy atoms: https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/AddHs.cpp#L451
AddHs()
implicit
Sorry, something went wrong.
Fixes rdkit#1439
003c606
960c539
No branches or pull requests
I discovered some strange behavior of removeHs function applied for '[H][*:1]' molecule.
If I create that mol from smiles, RemoveHs does not remove a single H from the mol:
output:
If I apply RemoveHs to fragments obtained after MMPA cuts it removes H and keeps only '[*:1]'
output:
The text was updated successfully, but these errors were encountered: