Remove duplicate templates; fail tests on duplicates or blank lines - #27
Remove duplicate templates; fail tests on duplicates or blank lines#27ricrogz wants to merge 2 commits into
Conversation
|
No new templates were found, so no images were generated. |
|
No new templates were found, so no images were generated. |
|
@ZontaNicola - would you mind taking a look at this? |
@ZontaNicola This is likely a dumb question, but after looking at the code, I don't understand how this works. The SMARTS are identical.
I don't see how the second template, which has an identical SMARTS, could ever be used. What am I missing? |
|
Hi @greglandrum, thanks for asking. These are the two SMARTS you pasted, it looks like the two structures can be linked by a rotation. In this case it's ok and actually very useful to remove one of the two. |
|
atoms inside the ring are marked D2, so no substitutions fall there. I don't think we have that particular case in the template files, but one could imagine a template for this exact structure as a cyclopropane with the remaining two Cs as a chain inside the square. In that case the SMILES would have been the same, but the smarts would have the two Cs marked as !#200&D2 and the remaining four as !#200 |
|
pff I am overcomplicating it, it's easy to figure out computationally: if two SMILES give the same SMARTS it's ok to remove one of them |
|
Of course I picked the one example in the file where the "duplicate" SMILES produces the same SMARTS. I don't think there's much of an efficiency reason to add anything to detect inputs that produce duplicate output SMARTS. But it would be confusing to add a "new" scaffold and have it never match anything. Since it's not trivial to manually check, it might be a good idea to add an automated test for this case. @ZontaNicola I'm happy to do a PR for this if you want. |
Of course, since SMARTS isn't canonical, whatever we do based on that would also be approximate. |
|
sure, that sounds great! |


Removes the duplicate templates.
Also, it causes tests to fail if there are duplicates or empty lines in the templates.smi file (image generation failures after merging PRs #25 and #26 were caused by blank spaces).