setReactant() or setReactants()?

User 870ab5b546

14-07-2007 21:16:38

When is it appropriate to use a single Molecule with multiple fragments as a parameter for setReactant():





Molecule substrate = molHandler.getMolecule();


reaction.setReactant(substrate);





and when is it appropriate first to convertToFrags(), then use the Molecule[] as a parameter for setReactants():





Molecule substrate = molHandler.getMolecule();


Molecule[] substrates = substrate.convertToFrags();


reaction.setReactants(substrates);





??

ChemAxon d76e6e95eb

16-07-2007 09:21:58

My collegue, who is expert in the Reactor API will check the problem tomorrow.

ChemAxon e08c317633

17-07-2007 08:59:08

bobgr wrote:
When is it appropriate to use a single Molecule with multiple fragments as a parameter for setReactant():





Molecule substrate = molHandler.getMolecule();


reaction.setReactant(substrate);





and when is it appropriate first to convertToFrags(), then use the Molecule[] as a parameter for setReactants():





Molecule substrate = molHandler.getMolecule();


Molecule[] substrates = substrate.convertToFrags();


reaction.setReactants(substrates);





??
The method you should use does not depend on the fragment number of the molecule, but it depends on the reactant number of the reaction schema.





You can use setReactant(Molecule) method if your reaction schema contains only one reactant (unimolecular reaction).





If your reaction schema has more than one reactants, then you have to use setReactants(Molecule[]). The Molecule[] array parameter should contain the reactants in same order as in the reaction schema.





Example:





Code:
Molecule mol = molHandler.getMolecule();


reactor.setReactant(mol);






Code:
Molecule mol = molHandler.getMolecule();


reactor.setReactants(new Molecule[] {mol});






These two code examples do exactly the same.





Best regards,


Zsolt