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