You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @rongfengzou. There are a couple of issues here. The key one is that test_mol2 is generated using MolFromSmarts() rather than MolFromSmiles(). This means that the molecule is not Kekulized so the bonds remain as single and double. test_mol1 is created via MolFromSmiles() so the bonds are changed to aromatic. RASCAL finds matching bonds between molecules, and there are none in this case.
If you change the creation of test_mol2 to also use MolFromSmiles() you still get no matches. The reason for this is that RASCAL uses a similarity threshold, default 0.7, and won't do the search if it calculates that the similarity will be lower than that. The similarity is essentially the number of atoms and bonds in the MCES as a proportion of the number of atoms and bonds in the input structures. With small molecules, it only takes 1 or 2 bonds not to be in common for the similarity to be very much reduced.
Number of MCESs found : 1
0.5333333333333333 0.4083333333333333
[(0, 0), (1, 1), (3, 4), (4, 5)] c(:c):c:c 0.4083333333333333
MCS SMARTS : [#6](:[#6]):[#6]:[#6]
which is probably more what you want. The RASCAL option returnEmptyMCES is useful in cases where no results are returned as it will allow you to see the tier1 and tier2 similarities which will probably tell you that the threshold has not been met for the full search to be performed.
I ran a test code here
`from rdkit import Chem
from rdkit.Chem import rdRascalMCES
from rdkit.Chem import rdFMCS
test_mol1 = Chem.MolFromSmiles('C1=COC=C1')
test_mol2 = Chem.MolFromSmarts('C1=CC=CC=C1')
rascal_opts = rdRascalMCES.RascalOptions()
rascal_opts.completeAromaticRings = False
rascal_opts.ringMatchesRingOnly = False
results = rdRascalMCES.FindMCES(test_mol1, test_mol2, rascal_opts)
print(f'Number of MCESs found : {len(results)}')
mcs = rdFMCS.FindMCS([test_mol1, test_mol2],
atomCompare=rdFMCS.AtomCompare.CompareElements,
bondCompare=rdFMCS.BondCompare.CompareOrder,
completeRingsOnly=False,
ringMatchesRingOnly=False,
timeout=120)
mcs_mol = Chem.MolFromSmarts(mcs.smartsString)
print(f'MCS SMARTS : {mcs.smartsString}')`
I thought both rdRascalMCES and rdFMCS will return mcs, but the result is that:
Number of MCESs found : 0
MCS SMARTS : [#6]:,-[#6]
Is that correct for rdRascalMCES?
The text was updated successfully, but these errors were encountered: