Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated various reaction classes to remove all usage of Molecule*
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
rajarshi authored and egonw committed Dec 10, 2011
1 parent 738eece commit 0a98a7f
Show file tree
Hide file tree
Showing 56 changed files with 518 additions and 596 deletions.
Expand Up @@ -32,8 +32,6 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -60,8 +58,8 @@
* <p>Below you have an example how to initiate the mechanism.</p>
* <p>It is processed by the AdductionLPMechanism class</p>
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new AdductionProtonLPReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -120,7 +118,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction
* @param agents agents of the reaction (Must be in this case null)
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: AdductionProtonLPReaction");
Expand Down Expand Up @@ -155,9 +153,9 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
atomH.setFormalCharge(1);
atomList.add(atomH);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IMolecule adduct = reactant.getBuilder().newInstance(IMolecule.class);
IAtomContainer adduct = reactant.getBuilder().newInstance(IAtomContainer.class);
adduct.addAtom(atomH);
moleculeSet.addAtomContainer(adduct);

Expand Down
Expand Up @@ -33,8 +33,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -60,8 +58,8 @@
* <p>Below you have an example how to initiate the mechanism.</p>
* <p>It is processed by the AdductionPBMechanism class</p>
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new AdductionProtonLPReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -121,7 +119,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction
* @param agents agents of the reaction (Must be in this case null)
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: AdductionProtonPBReaction");
Expand Down Expand Up @@ -176,9 +174,9 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
ArrayList<IBond> bondList = new ArrayList<IBond>();
bondList.add(bondi);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IMolecule adduct = reactant.getBuilder().newInstance(IMolecule.class);
IAtomContainer adduct = reactant.getBuilder().newInstance(IAtomContainer.class);
adduct.addAtom(atomH);
moleculeSet.addAtomContainer(adduct);

Expand Down
Expand Up @@ -32,8 +32,6 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -60,8 +58,8 @@
* <p>Below you have an example how to initiate the mechanism.</p>
* <p>It is processed by the AdductionLPMechanism class</p>
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new AdductionSodiumLPReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -121,7 +119,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction
* @param agents agents of the reaction (Must be in this case null)
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: AdductionSodiumLPReaction");
Expand Down Expand Up @@ -157,9 +155,9 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
atomH.setFormalCharge(1);
atomList.add(atomH);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IMolecule adduct = reactant.getBuilder().newInstance(IMolecule.class);
IAtomContainer adduct = reactant.getBuilder().newInstance(IAtomContainer.class);
adduct.addAtom(atomH);
moleculeSet.addAtomContainer(adduct);

Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -55,8 +54,8 @@
* <p>It is processed by the HeterolyticCleavageMechanism class</p>
*
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new CarbonylEliminationReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -114,7 +113,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction
* @param agents agents of the reaction (Must be in this case null)
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{
logger.debug("initiate reaction: CarbonylEliminationReaction");

Expand Down Expand Up @@ -164,7 +163,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
ArrayList<IBond> bondList = new ArrayList<IBond>();
bondList.add(bondj);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IReaction reaction = mechanism.initiate(moleculeSet, atomList, bondList);
if(reaction == null)
Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -53,8 +52,8 @@
* <p>It is processed by the RemovingSEofNBMechanism class</p>
*
*<pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new ElectronImpactNBEReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -117,7 +116,7 @@ public ReactionSpecification getSpecification() {
*
* @exception CDKException Description of the Exception
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: ElectronImpactNBEReaction");
Expand Down Expand Up @@ -146,7 +145,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen

ArrayList<IAtom> atomList = new ArrayList<IAtom>();
atomList.add(atom);
IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IReaction reaction = mechanism.initiate(moleculeSet, atomList, null);
if(reaction == null)
Expand Down
Expand Up @@ -33,7 +33,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -54,8 +53,8 @@
* <p>It is processed by the RemovingSEofPBMechanism class</p>
*
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new ElectronImpactPDBReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -116,7 +115,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction.
* @param agents agents of the reaction (Must be in this case null).
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: ElectronImpactPDBReaction");
Expand Down Expand Up @@ -161,7 +160,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
ArrayList<IBond> bondList = new ArrayList<IBond>();
bondList.add(bondi);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IReaction reaction = mechanism.initiate(moleculeSet, atomList, bondList);
if(reaction == null)
Expand Down
Expand Up @@ -34,7 +34,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand All @@ -54,8 +53,8 @@
* This reaction type is a representation of the processes which occurs in the mass spectrometer.</p>
*
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new ElectronImpactSDBReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -115,7 +114,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction.
* @param agents agents of the reaction (Must be in this case null).
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: ElectronImpactSDBReaction");
Expand Down Expand Up @@ -160,7 +159,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
ArrayList<IBond> bondList = new ArrayList<IBond>();
bondList.add(bondi);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IReaction reaction = mechanism.initiate(moleculeSet, atomList, bondList);
if(reaction == null)
Expand Down
Expand Up @@ -33,7 +33,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand Down Expand Up @@ -62,8 +61,8 @@
* <p>Below you have an example how to initiate the mechanism.</p>
* <p>It is processed by the HeterolyticCleavageMechanism class</p>
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new HeterolyticCleavagePBReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -123,7 +122,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction
* @param agents agents of the reaction (Must be in this case null)
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: HeterolyticCleavagePBReaction");
Expand Down Expand Up @@ -168,7 +167,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
ArrayList<IBond> bondList = new ArrayList<IBond>();
bondList.add(bondi);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IReaction reaction = mechanism.initiate(moleculeSet, atomList, bondList);
if(reaction == null)
Expand Down
Expand Up @@ -34,7 +34,6 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IReactionSet;
import org.openscience.cdk.reaction.IReactionProcess;
Expand Down Expand Up @@ -63,8 +62,8 @@
* <p>Below you have an example how to initiate the mechanism.</p>
* <p>It is processed by the HeterolyticCleavageMechanism class</p>
* <pre>
* IMoleculeSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newMoleculeSet();
* setOfReactants.addAtomContainer(new Molecule());
* IAtomContainerSet setOfReactants = NewDefaultChemObjectBuilder.getInstance().newAtomContainerSet();
* setOfReactants.addAtomContainer(new AtomContainer());
* IReactionProcess type = new HeterolyticCleavageSBReaction();
* Object[] params = {Boolean.FALSE};
type.setParameters(params);
Expand Down Expand Up @@ -125,7 +124,7 @@ public ReactionSpecification getSpecification() {
* @param reactants reactants of the reaction
* @param agents agents of the reaction (Must be in this case null)
*/
@TestMethod("testInitiate_IMoleculeSet_IMoleculeSet")
@TestMethod("testInitiate_IAtomContainerSet_IAtomContainerSet")
public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException{

logger.debug("initiate reaction: HeterolyticCleavageSBReaction");
Expand Down Expand Up @@ -170,7 +169,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
ArrayList<IBond> bondList = new ArrayList<IBond>();
bondList.add(bondi);

IMoleculeSet moleculeSet = reactant.getBuilder().newInstance(IMoleculeSet.class);
IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
moleculeSet.addAtomContainer(reactant);
IReaction reaction = mechanism.initiate(moleculeSet, atomList, bondList);
if(reaction == null)
Expand Down

0 comments on commit 0a98a7f

Please sign in to comment.