filter problem

User 870ab5b546

04-05-2009 17:31:02

Reaction definition:


<?xml version="1.0" ?>
<MDocument>
<MChemicalStruct>
<reaction>
<propertyList>
<property dictRef="NAME" title="NAME">
<scalar><![CDATA[C(-) to ketohyde]]></scalar>
</property>
<property dictRef="REACTIVITY" title="REACTIVITY">
<scalar><![CDATA[
dynamicpKb(reactant(0), "1") < 30
|| min(dynamicpKa(reactant(1), filter(ratom(4), "match('[C:1][H]', 1)"))) > 15
]]></scalar>
</property>
<property dictRef="EXCLUDE" title="EXCLUDE">
<scalar><![CDATA[
totalCharge(reactant(1)) < 0
]]></scalar>
</property>
<property dictRef="STANDARDIZATION" title="STANDARDIZATION">
<scalar><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!-- Standardizer configuration file -->
<!-- This configuration file is created with ChemAxon Config Builder -->

<StandardizerConfiguration Version ="0.1">
<Actions>
<Transformation ID="O-enolate to C-enolate" Structure="[#8-]C=C>>[#6-]C=O" Type="string" Groups="reactant1"/>
<Transformation ID="nitrile enolate to C-enolate" Structure="[#7-]=C=C>>[#6-]C#N" Type="string" Groups="reactant1"/>
<Transformation ID="imine enolate to C-enolate" Structure="[#7-]C=C>>[#6-]C=N" Type="string" Groups="reactant1"/>
</Actions>
</StandardizerConfiguration>
]]></scalar>
</property>
</propertyList>
<reactantList>
<molecule molID="m1">
<atomArray
atomID="a1"
elementType="C"
formalCharge="-1"
mrvMap="3"
x2="-11.348111152648926"
y2="0.5153747200965881"
/>
<bondArray>
</bondArray>
</molecule>
<molecule molID="m2">
<atomArray
atomID="a1 a2 a3 a4"
elementType="O C H H"
mrvMap="2 1 4 0"
mrvQueryProps="0 0 L,H,C: L,H,C:"
x2="-7.075778961181641 -7.075778961181641 -8.409458083009676 -5.742099839353605"
y2="2.1469244956970215 0.6069244956970214 -0.1630755043029789 -0.16307550430297846"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="2" />
<bond atomRefs2="a2 a4" order="1" />
<bond atomRefs2="a2 a3" order="1" />
</bondArray>
</molecule>
</reactantList>
<productList>
<molecule molID="m3">
<atomArray
atomID="a1 a2 a3 a4 a5"
elementType="O C H C H"
mrvMap="2 1 4 3 0"
mrvQueryProps="0 0 L,H,C: 0 L,H,C:"
x2="4.414802551269531 4.414802551269531 3.0811234294414955 5.748481673097567 4.414802551269531"
y2="2.1145290517807007 0.5745290517807007 -0.19547094821929978 -0.1954709482192989 -0.9654709482192994"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a2 a5" order="1" />
<bond atomRefs2="a2 a3" order="1" />
<bond atomRefs2="a2 a4" order="1" />
</bondArray>
</molecule>
</productList>
</reaction>
</MChemicalStruct>
</MDocument>

Reactants are [CH3-].CC(=O)CC(C)=O.  


I tried to write a reactivity rule that states that a carbonyl group should react with a carbanion whose pKb is greater than 30 only if all atoms adjacent to the carbonyl that are H-bearing C atoms have a dynamic pKa of 15 or greater.  However, [CH3-].CC(=O)CC(C)=O reacts.  So either there's an error in my reactivity rule (quite possible, because the filter() grammar is incredibly confusing), or there's a bug.  Can you help?


Also, if dynamicpKa returns "NaN" for an atom, the value is ignored by the min() and max() functions, right?

ChemAxon e08c317633

06-05-2009 13:09:35










bobgr wrote:

Reactants are [CH3-].CC(=O)CC(C)=O.


I tried to write a reactivity rule that states that a carbonyl group should react with a carbanion whose pKb is greater than 30 only if all atoms adjacent to the carbonyl that are H-bearing C atoms have a dynamic pKa of 15 or greater.  However, [CH3-].CC(=O)CC(C)=O reacts.  So either there's an error in my reactivity rule (quite possible, because the filter() grammar is incredibly confusing), or there's a bug.  Can you help?



Your reactivity rule is:


dynamicpKb(reactant(0), "1") < 30 || min(dynamicpKa(reactant(1), filter(ratom(4), "match('[C:1][H]', 1)"))) > 15


1.  min(dynamicpKa(reactant(1), filter(ratom(4), "match('[C:1][H]', 1)"))) > 15

All reactant atoms that can match the query should be listed in filter:

min(dynamicpKa(reactant(1), filter(ratom(4), ratom(5), "match('[C:1][H]', 1)"))) > 15

I mapped ratom(5) in the reaction scheme.


2. "a carbonyl group should react with a carbanion whose pKb is greater than 30 only if ..."


For expressing this you should use expression: dynamicpKb(reactant(0), "1") > 30 && ...


If you use "||" (or), then the subexpression after "||" will not be evaluated if the subexpression before "||" returns "true". In your original rule dynamicpKb(reactant(0), "1") < 30 returned "false" for "[CH3-]", so this part of the or-expression had no effects on the result in this case.


I attached the modified reaction with rules. The rule with "&&" insted of "||" will exclude a lot of reactants that used to react before the modification, but will work on reactants [CH3-].CC(=O)CC(C)=O. I hope you see how filter() function works, and you can extend the rule as you wish.


I attached the modified reaction.


$ react -r c-toketohyde_mod.mrv "[CH3-]" "CC(=O)CC(C)=O"


(no results)












bobgr wrote:

Also, if dynamicpKa returns "NaN" for an atom, the value is ignored by the min() and max() functions, right?




Yes, this is right.


Zsolt

User 870ab5b546

07-05-2009 17:13:37

Thanks, that helps a lot.  Although I think I do want,


dynamicpKb(reactant(0), "1") < 30 || ....

For a reaction to take place, either reactant(0) should not be too basic, or the carbonyl compound should not be too acidic.  Also,


[bob@epoch public]$ evaluate -e "dynamicpKb()" "[CH3-]"
50.69

With this definition, [CH3-].CC(=O)CCCC(=O)CC(C)=O gives only CC(=O)CC(=O)CCCC(C)(C)O.  


-- Bob