HI Colin,

On Mon, May 28, 2018 at 2:48 PM Colin Bournez <[email protected]>
wrote:

> Hi everybody,
>
> Here is my piece of code to run a MCS :
>
> from rdkit import Chem
> from rdkit.Chem import rdFMCS
> mol1 = Chem.MolFromSmiles('CN1CCN(Cc2ccc(C=O)cc2)CC1')
> mol2 = Chem.MolFromSmiles('Cc1ccc(C(=O)Nc2ccc(C)c(Nc3ncccn3)c2)cc1')
> mols = [mol1,mol2]
> res = rdFMCS.FindMCS(mols, completeRingsOnly=True, matchValences=True,
> ringMatchesRingOnly=True, )
>
> Chem.MolFromSmarts(res.smartsString)
>
> My question is why the results is in SMILES :
>
> 'CC1:C:C:C(:C:C:1)CN'
> Instead of :
> 'Cc1ccc(C=O)cc1'
>
>
So here's what I get:

In [1]: from rdkit import Chem
   ...: from rdkit.Chem import rdFMCS
   ...: mol1 = Chem.MolFromSmiles('CN1CCN(Cc2ccc(C=O)cc2)CC1')
   ...: mol2 = Chem.MolFromSmiles('Cc1ccc(C(=O)Nc2ccc(C)c(Nc3ncccn3)c2)cc1')
   ...: mols = [mol1,mol2]
   ...: res = rdFMCS.FindMCS(mols, completeRingsOnly=True,
matchValences=True, ringMatchesRingOnly=True, )
   ...:

In [2]: res.smartsString
Out[2]: '[#7]-[#6]-[#6]1:[#6]:[#6]:[#6](:[#6]:[#6]:1)-[#6]'

In [3]: Chem.MolToSmiles(Chem.MolFromSmarts(res.smartsString))
Out[3]: 'CC1:C:C:C(CN):C:C:1'

 You see "C" in the SMILES because the SMARTS doesn't contain any
information about aromaticity of the atoms ([#6] is aromatic or aliphatic).
One can argue about whether that's correct or not, but that is certainly
what the code currently does. The aromatic bonds do make it so that the
substructures have to be aromatic.

The N is supposed to be in a ring in the mol1 so it should not be 'cut'
> with the option completeRingsOnly=True.
> If anyone has any suggestions?
>

Though this is confusing, it is what the code is currently expected to do.
The completeRingsOnly argument is applied to ring bonds, not ring atoms.
It's worth considering changing this behavior, but it's unlikely to happen
quickly.

-greg



> Thanks,
>
> --
> *Colin Bournez*
> PhD Student, Structural Bioinformatics & Chemoinformatics
> Institut de Chimie Organique et Analytique (ICOA), UMR CNRS-Université
> d'Orléans 7311
> Rue de Chartres, 45067 Orléans, France
> T. +33 238 494 577
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to