calling Reactor from Java -- results seemed inconsistent

User 99339bfc89

11-04-2011 17:28:52

I must be missing something very obvious.

For _some_ of the reactions that are distributed in the most recent reaction library I can:
  1) read in the reaction definition in .mrv form
  2) take some of the reactant molecules I see in the example for that reaction, capture them, and then supply them as smiles strings in the code
  3) call the Reactor from within Java, and the products are created, and life is good.

However in other cases I call a reaction, providing molecules out of the example, and nothing happens. What am I missing?

Here is an example of one that works:


    public static void main(String[] args)  {
        Reactor reactor = new Reactor ();
        try {
                     // get reaction definition
                     MolImporter mi = new MolImporter("C:\\chemaxon\\Baylis_Hillman_vinyl_alkylation.mrv");
                     reactor.setReaction( RxnMolecule.getReaction(mi.read()) );
                     
                     // get reactants
                     Molecule[] reactantArray  = new Molecule [2];
                     reactantArray[0] = MolImporter.importMol("COC(=O)C=C");
                     reactantArray[1] = MolImporter.importMol("CCC=O");
                     for (int i = 0 ; i<reactantArray.length;i++){
                           reactantArray.aromatize();
                      }


                    reactor.setReactants(reactantArray);

                     //perform reaction
                     while ((products = reactor.react()) != null) {
                     for (Molecule product : products) {
                         System.out.println("product " +product.toString() + " generated");
                      }
              } catch (Exception e) {
                   e.printStackTrace();
               }
         }


 


That's good.  But the following reaction doesn't generate any products


 


 


    public static void main(String[] args)  {
                Reactor reactor = new Reactor ();
        try {
                     // get reaction definition
                     MolImporter mi = new MolImporter("C:\\chemaxon\\Friedel_Crafts_acylation.mrv");
                     reactor.setReaction( RxnMolecule.getReaction(mi.read()) );
                    
                     // get reactants
                     Molecule[] reactantArray  = new Molecule [2];
                     reactantArray[0] = MolImporter.importMol("CC(Cl)=O");
                     reactantArray[1] = MolImporter.importMol("C1=CC=CC=C1");
                     for (int i = 0 ; i<reactantArray.length;i++){

                           reactantArray.aromatize();

                      }



                     //perform reaction

                     while ((products = reactor.react()) != null) {

                     for (Molecule product : products) {

                         System.out.println("product " +product.toString() + " generated");

                      }
              } catch (Exception e) {
                     e.printStackTrace();
              } 
         }



These are not the only examples -- some reactions work, others don't. In all cases I'm pulling the reactants right out of the examples, so I shouldn't be violating any reaction/selectivity rules.  What's going on?


For the record, I'm using versions 5.4.1 of reactor, and the newest reaction library, Java 1.6.0_23, under Windows 7 64-bit.


Thanks for any assistance,


Ben

ChemAxon d76e6e95eb

11-04-2011 18:31:13

The reactant order is important. If your generic reaction scheme describes that an aromatic compound reacts with an acid halide, your reactants must be specified in the same order. Aromatic compounds first and acidhalides after, so just swap your lines and it will probably work.


reactantArray[0] = MolImporter.importMol("CCC=O");
reactantArray[1] = MolImporter.importMol("COC(=O)C=C");
 

User 99339bfc89

11-04-2011 19:55:23

Gyuri;


That's great, the ordering of the reactants was definitely a major part of my problem. Thanks for the answer.


In fact, however, I had to make two changes before I was really able to get the Friedel-Crafts reaction to go.  Number 1, I switched the order of the reactants, exactly as you suggested. Number 2, I also had to specify the benzene ring as aromatic to begin with. That is, if I specify that first reactant as "c1ccccc1", then the reaction works, and I get the product I expected. If instead I specify that reactant as "C1=CC=CC=C1" then the reaction fails. The part I don't understand though is this – I  explicitly aromatize that molecule in the code. Furthermore if I step through the code in the debugger it definitely seems as if the aromatize call does what I would expect it to do.  So, I have only this last question and then I will be completely happy with the results I'm getting:  why is it that specifying a molecule as "C1=CC=CC=C1", and then calling aromatize(), is giving me different results than simply specifying "c1ccccc1" in the first place?  (at least insofar as reactor is concerned)


(Note regarding my sample code: I omitted one line, namely "reactor.setReactants(reactantArray);" from the second example. In my test code that line appears in the second example in exactly the same place as it does in the first example).



Thanks again for the help, and pointing out that ordering of the reactants is important to Reactor. If you can just clear up this other misunderstanding on my part than everything will be good.

ChemAxon e08c317633

13-04-2011 10:25:05

Ben,


It should work with "C1=CC=CC=C1" input and "c1ccccc1" input too, and aromatizing the input (call Molecule.aromatize()) is not required. It works for me.


Code:


public static void main(String[] args) throws Exception {
Reactor reactor = new Reactor ();
// get reaction definition
MolImporter mi = new MolImporter("Friedel-Crafts_acylation.mrv");
reactor.setReaction( RxnMolecule.getReaction(mi.read()) );

// get reactants
Molecule[] reactantArray = new Molecule [2];
reactantArray[0] = MolImporter.importMol("C1=CC=CC=C1");
reactantArray[1] = MolImporter.importMol("CC(Cl)=O");

// set reactants
reactor.setReactants(reactantArray);

//perform reaction
Molecule[] products;
while ((products = reactor.react()) != null) {
for (Molecule product : products) {
System.out.println(product.toFormat("smiles"));
}
}
}

Output:


CC(=O)C1=CC=CC=C1
Cl

Please run the code above, and let us know what is the result you get.


Zsolt