Hi James,
On Sat, Oct 6, 2012 at 12:26 PM, James Davidson <[email protected]> wrote:
>
>> I have to think about it a bit more, but I believe that getting the
> correct
>> behavior in the SMARTS matcher is going to be difficult (this is why
> it's not
>> already supported).
>
>> However, modifying the Reaction SMARTS parser so that
>> it allows you to do intra-molecular reactions is certainly doable for
> the next
>> release. It won't be perfect (if you have two components in the single
>> reactant, the matches in that reactant won't be limited to a single
>> component), but it should handle most cases.
>
> That would be a good start!
An initial version of this is checked in now:
In [8]: rxn1 =
AllChem.ReactionFromSmarts("([C:1]=[C;H2].[C:2]=[C;H2])>>[*:1]=[*:2]")
In [9]: m1 = Chem.MolFromSmiles('C=C(O)CC(F)=C')
In [10]: ps = rxn1.RunReactants((m1,))
In [11]: Chem.MolToSmiles(ps[0][0])
Out[11]: 'OC1=C(F)C1'
It only works for reactions at the moment. It's not going to make the
2012.09 release, but is testable in svn if you're willing/able.
> But I guess this means that enumeration would be fairly well sorted, but
> full control in searching mixtures / reactions would rely on the
> 'difficult' support in the SMARTS matcher(?)
Yes. The current substructure matching code considers itself finished
when it has successfully matched all atoms in the query to atoms in
the molecule. The component-level grouping operations require an
additional step at the end to make sure the component constraints are
fulfilled. Adding support for this would be useful, but it's a bit
more work.
-greg
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss