epam / epam/Indigo

SMARTS query: Recursive SMARTS fail to find match in the reaction substructure

Open
#1,088 2 comments 0 reactions 1 assignee Assigned to @AliaksandrDziarkach View on GitHub
Priority: High Severity: High User`s Feedback
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

Indigo sometimes fails to find a substructure match, when using recursive SMARTS

**Steps to Reproduce**
1. I was able to reproduce the error using python indigo wrapper on Win 10 x64 and Ubuntu 22.04 x64,

2. Script to reproduce:
```
reactions = []
reactions.append(indigo.loadReaction("CF.CC>>"))
reactions.append(indigo.loadReaction("FC.CC>>"))
reactions.append(indigo.loadReaction("CC.FC>>"))
reactions.append(indigo.loadReaction("CC.CF>>"))
reactions.append(indigo.loadReaction("C.CF>>"))
reactions.append(indigo.loadReaction("C.FC>>"))
reactions.append(indigo.loadReaction("FC>>"))
reactions.append(indigo.loadReaction("CF>>"))

query = indigo.loadReactionSmarts("[$(CF)]>>")

for rxn in reactions:
match = indigo.substructureMatcher(rxn).match(query)
if match:
print(rxn.smiles(), "matched", query.smarts())
else:
print(rxn.smiles(), "not matched", query.smarts())
```

**Expected behavior**
All those reactions should match the query, as they all contain that substructure.

**Actual behavior**
The output is weird as it partially matches it, but starting to fail at some moment:
output:
```
CF.CC>> matched [$(CF)]>>
FC.CC>> matched [$(CF)]>>
CC.FC>> not matched [$(CF)]>>
CC.CF>> not matched [$(CF)]>>
C.CF>> not matched [$(CF)]>>
C.FC>> matched [$(CF)]>>
FC>> matched [$(CF)]>>
CF>> matched [$(CF)]>>
```

**Indigo version**

Tested on Win10 and Ubuntu 22.04

`1.10.0.0-ga65114f36-x86_64-win-msvc-1934`
`1.10.0.0-ga65114f36-x86_64-linux-gnu-11.2.1`

Python versions:
`Python 3.10.9 | packaged by conda-forge | (main, Jan 11 2023, 15:15:40) [MSC v.1916 64 bit (AMD64)] on win32`
`Python 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.