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
Describe the bug
When decomposing structures and cores with coordinates the RGD algorithm will copy those coordinates to the output groups.
In some cases the attachment dummy atom is poorly positioned
To Reproduce
# %% from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.rdRGroupDecomposition import RGroupDecomposition, RGroupDecompositionParameters, \ RGroupMatching, RGroupScore, RGroupLabels, RGroupCoreAlignment, RGroupLabelling from rdkit.Chem.Draw import IPythonConsole IPythonConsole.ipython_useSVG = True from rdkit.Chem import PandasTools from rdkit.Chem import Draw from IPython.display import HTML import pandas as pd # %% core_block = """ ChemDraw09152209202D 6 6 0 0 0 0 0 0 0 0999 V2000 0.0001 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.7144 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.7144 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.0001 -0.8250 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 0.7144 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.7144 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 2 3 1 0 3 4 1 0 4 5 1 0 5 6 1 0 6 1 1 0 M END """ core = Chem.MolFromMolBlock(core_block) core # %% test_block = """MolHeader RDKit 2D 20 21 0 0 0 0 0 0 0 0999 V2000 -2.6437 1.7625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -3.3582 1.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -3.3582 0.5250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -2.6438 0.1125 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 -1.9293 0.5250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.9293 1.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.2148 1.7625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.5003 1.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.2141 1.7625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 0.9286 1.3500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -0.3692 2.3459 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 0.7975 2.3459 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 -2.6438 -0.7125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -3.3582 -1.1250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -3.3582 -1.9500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -2.6438 -2.3625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.9293 -1.9500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.9293 -1.1250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -3.2271 -2.9459 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 -2.0604 -2.9459 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 2 3 1 0 3 4 1 0 4 5 1 0 5 6 1 0 6 1 1 0 6 7 1 0 7 8 1 0 8 9 1 0 9 10 1 0 9 11 1 0 9 12 1 0 4 13 1 0 13 14 1 0 14 15 1 0 15 16 1 0 16 17 1 0 17 18 1 0 18 13 1 0 16 19 1 0 16 20 1 0 M END """ test = Chem.MolFromMolBlock(test_block) test # %% options = RGroupDecompositionParameters() options.matchingStrategy = RGroupMatching.GreedyChunks options.matchingStrategy = RGroupMatching.Exhaustive options.onlyMatchAtRGroups = False options.scoreMethod = RGroupScore.FingerprintVariance decomp = RGroupDecomposition([core], options) result1 = decomp.Add(test) result1 # %% decomp.Process() groups = decomp.GetRGroupsAsColumns() groups # %% df = PandasTools.RGroupDecompositionToFrame(groups, [test], include_core=True) PandasTools.ChangeMoleculeRendering(df) HTML(df.to_html())
Expected behavior I expect to see the dummy attachment point for R2 in a reasonable position.
Screenshots but this is what happens:
Configuration (please complete the following information):
Additional context I will see if I can fix and submit a PR.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
When decomposing structures and cores with coordinates the RGD algorithm will copy those coordinates to the output groups.
In some cases the attachment dummy atom is poorly positioned
To Reproduce
Expected behavior
I expect to see the dummy attachment point for R2 in a reasonable position.
Screenshots
but this is what happens:
Configuration (please complete the following information):
Additional context
I will see if I can fix and submit a PR.
The text was updated successfully, but these errors were encountered: