Hi,

Just noticed this bug in the reaction functionality. I want to apply the 
following transform:

[*:1]c1ccc([*:2])o1>>[*:1]c1ccc([*:2])cc1

To the following reactant:

Cc1ccc(CC)o1

Code:

In [1]: from rdkit import Chem
In [2]: from rdkit.Chem import AllChem
In [3]: rxn = 
AllChem.ReactionFromSmarts('[*:1]c1ccc([*:2])o1>>[*:1]c1ccc([*:2])cc1')
In [4]: ps = rxn.RunReactants( (Chem.MolFromSmiles('Cc1ccc(CC)o1')) )
---------------------------------------------------------------------------
ArgumentError                             Traceback (most recent call last)
<ipython-input-4-6b04a2899e4e> in <module>()
----> 1 ps = rxn.RunReactants( (Chem.MolFromSmiles('Cc1ccc(CC)o1')) )

ArgumentError: Python argument types in
    ChemicalReaction.RunReactants(ChemicalReaction, Mol)
did not match C++ signature:
    RunReactants(RDKit::ChemicalReaction*, boost::python::list)
    RunReactants(RDKit::ChemicalReaction*, boost::python::tuple)

It appears that the RunReactants function expects two reactants and does not 
work with just one reactant - this is only the case when you specify a tuple as 
the input. If you use a list/array instead, it works fine:

In [5]: ps = rxn.RunReactants( [Chem.MolFromSmiles('Cc1ccc(CC)o1')] )

In [6]: print Chem.MolToSmiles(ps[0][0])
CCc1ccc(C)cc1

It's a minor bug but I thought it is worth reporting. Hopefully it is a easy 
fix.

Thanks
Jameed



________________________________

This e-mail was sent by GlaxoSmithKline Services Unlimited
(registered in England and Wales No. 1047315), which is a
member of the GlaxoSmithKline group of companies. The
registered address of GlaxoSmithKline Services Unlimited
is 980 Great West Road, Brentford, Middlesex TW8 9GS.
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to