[Adding the mailing list back to the recipient list]
On Tue, Apr 12, 2016 at 6:00 AM, 吴玲 <monicacul...@126.com> wrote:
> Thanks for your help,and the are another two problems.
> 1. according to your advice,I rewrite the patterns as
> *"[NH:2]1[C:3][C:4][C:5][CH,CH2:6]1.[OH2:15].[O:17]=[O:18]>>[NH2:2][C:3][C:4][C:5][*:6]=[O:17].[O:18][O:15]"*,but
> when I test some reactants ,it still does't work, and give the same
> warning ,I can't find what the problem is ,could you help me check it ?
>
> patterns = [
>
> "[NH:2]1[C:3][C:4][C:5][CH,CH2:6]1.[OH2:15].[O:17]=[O:18]>>[NH2:2][C:3][C:4][C:5][*:6]=[O:17].[O:18][O:15]",
> ]
> rs1 = ['N1CCCC1','N1CCCC1C','N1CCCC1c1ccccc1','C[NH+]1CCCC1C',]
> rs2 = ['O']
> rs3 = ['O=O']
>
> for idx, pattern in enumerate(patterns, 1):
> rxn = ReactionFromSmarts(pattern)
> index = 0
> for a in rs1:
> a_ = MolFromSmiles(a)
> for b in rs2:
> b_ = MolFromSmiles(b)
> for c in rs3:
> c_ = MolFromSmiles(c)
>
> ps = [
> MolToSmiles(c) for ps in rxn.RunReactants((a_,
> b_,c_))
> for p in ps]
> *warning:*
> File
> "/home/qnhu/Project/Database/Rhea_Dedup/AllEcToAllRxn/Chemaxon/predict.py",
> line 46, in main3
> for p in ps]
> Boost.Python.ArgumentError: Python argument types in
> rdkit.Chem.rdmolfiles.MolToSmiles(str)
> did not match C++ signature:
> MolToSmiles(RDKit::ROMol mol, bool isomericSmiles=False, bool
> kekuleSmiles=False, int rootedAtAtom=-1, bool canonical=True, bool
> allBondsExplicit=False)
>
It's a bit cryptic, but the error message does tell you exactly what the
problem is: you are calling MolToSmiles with a string instead of a
molecule. Take a look at the place where you are calling MolToSmiles. It's
useful to be spend a bit of time looking at these error messages and trying
to figure out what they say.
> 2. When I run RunReactants with patterns
> *"[OH:1][CH:2].[c:11]1[c:12][c:13][c:14][n+:15]([C:17])[c:16]1>>[O:1]=[C:2].[C:11]1=[C:16][N:15]([C:17])[C:14]=[C:13][C:12]1*"
> and input reactants1 rs1 = ['CC(C)O','C1CCCC1O','C1CCCCC1O',] , reactants2
> rs2= ['c1ccc[n+](C)c1'],
> the output :
> CC(C)O.c1ccc[n+](C)c1>>CC(C)=O.C*[N+]*1C=CCC=C1
> C1CCCC1O.c1ccc[n+](C)c1>>O=C1CCCC1.C*[N+]*1C=CCC=C1
> C1CCCCC1O.c1ccc[n+](C)c1>>O=C1CCCCC1.C*[N+]*1C=CCC=C1
> do you find that the "N" in the product C*[N+]*1C=CCC=C1 is "N+", the
> "N" in this compound contact three atom , why there be a plus charge in the
> "N"?
>
If you want to specify that the charge goes from +1 to zero, you need to
explicitly provide the +0 charge in the product. Here's a simple example:
In [16]: rxn = AllChem.ReactionFromSmarts('[C:1][N+1:2]>>[C:1].[N+0:2]')
In [17]: [Chem.MolToSmiles(x,True) for x in
rxn.RunReactants((Chem.MolFromSmiles('C[NH3+]'),))[0]]
Out[17]: ['C', 'N']
In [18]: [Chem.MolToSmiles(x,True) for x in
rxn.RunReactants((Chem.MolFromSmiles('C[NH2+]C'),))[0]]
Out[18]: ['C', 'CN']
I hope this helps,
-greg
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss