Browse files

Makes the reaction module independent from the data module

Signed-off-by: ngn <jeliazkova.nina@gmail.com>
  • Loading branch information...
1 parent eb90ed7 commit a21ccc29202de48cf6e9bfdc7d55c3b325d1688f @egonw egonw committed Nov 7, 2011
Showing with 90 additions and 124 deletions.
  1. +0 −1 src/META-INF/reaction.cdkdepends
  2. +1 −1 src/main/org/openscience/cdk/reaction/ReactionChain.java
  3. +3 −4 src/main/org/openscience/cdk/reaction/mechanism/AdductionLPMechanism.java
  4. +3 −4 src/main/org/openscience/cdk/reaction/mechanism/AdductionPBMechanism.java
  5. +4 −5 src/main/org/openscience/cdk/reaction/mechanism/HeterolyticCleavageMechanism.java
  6. +5 −6 src/main/org/openscience/cdk/reaction/mechanism/HomolyticCleavageMechanism.java
  7. +3 −5 src/main/org/openscience/cdk/reaction/mechanism/RadicalSiteIonizationMechanism.java
  8. +3 −5 src/main/org/openscience/cdk/reaction/mechanism/RadicalSiteRearrangementMechanism.java
  9. +4 −7 src/main/org/openscience/cdk/reaction/mechanism/RearrangementChargeMechanism.java
  10. +4 −5 src/main/org/openscience/cdk/reaction/mechanism/RemovingSEofBMechanism.java
  11. +4 −5 src/main/org/openscience/cdk/reaction/mechanism/RemovingSEofNBMechanism.java
  12. +2 −3 src/main/org/openscience/cdk/reaction/mechanism/SharingElectronMechanism.java
  13. +2 −3 src/main/org/openscience/cdk/reaction/mechanism/TautomerizationMechanism.java
  14. +1 −2 src/main/org/openscience/cdk/reaction/type/AdductionProtonLPReaction.java
  15. +1 −2 src/main/org/openscience/cdk/reaction/type/AdductionProtonPBReaction.java
  16. +1 −2 src/main/org/openscience/cdk/reaction/type/AdductionSodiumLPReaction.java
  17. +1 −2 src/main/org/openscience/cdk/reaction/type/ElectronImpactNBEReaction.java
  18. +1 −2 src/main/org/openscience/cdk/reaction/type/ElectronImpactPDBReaction.java
  19. +1 −2 src/main/org/openscience/cdk/reaction/type/ElectronImpactSDBReaction.java
  20. +1 −2 src/main/org/openscience/cdk/reaction/type/HeterolyticCleavageSBReaction.java
  21. +1 −2 src/main/org/openscience/cdk/reaction/type/HomolyticCleavageReaction.java
  22. +1 −1 src/main/org/openscience/cdk/reaction/type/PiBondingMovementReaction.java
  23. +3 −3 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrAlphaReaction.java
  24. +3 −3 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrBetaReaction.java
  25. +3 −3 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrDeltaReaction.java
  26. +3 −3 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrGammaReaction.java
  27. +1 −2 src/main/org/openscience/cdk/reaction/type/RadicalSiteInitiationReaction.java
  28. +5 −5 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrAlphaReaction.java
  29. +5 −5 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrBetaReaction.java
  30. +4 −4 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrDeltaReaction.java
  31. +4 −4 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrGammaReaction.java
  32. +1 −2 src/main/org/openscience/cdk/reaction/type/RearrangementAnionReaction.java
  33. +1 −2 src/main/org/openscience/cdk/reaction/type/RearrangementCationReaction.java
  34. +1 −2 src/main/org/openscience/cdk/reaction/type/RearrangementLonePairReaction.java
  35. +1 −2 src/main/org/openscience/cdk/reaction/type/RearrangementRadicalReaction.java
  36. +1 −2 src/main/org/openscience/cdk/reaction/type/SharingAnionReaction.java
  37. +1 −2 src/main/org/openscience/cdk/reaction/type/SharingChargeDBReaction.java
  38. +1 −2 src/main/org/openscience/cdk/reaction/type/SharingChargeSBReaction.java
  39. +1 −2 src/main/org/openscience/cdk/reaction/type/SharingLonePairReaction.java
  40. +1 −2 src/main/org/openscience/cdk/reaction/type/TautomerizationReaction.java
  41. +2 −0 src/test/org/openscience/cdk/modulesuites/MextraTests.java
  42. +0 −2 src/test/org/openscience/cdk/modulesuites/MreactionTests.java
  43. +1 −1 src/test/org/openscience/cdk/reaction/ReactionChainTest.java
View
1 src/META-INF/reaction.cdkdepends
@@ -1,6 +1,5 @@
cdk-annotation.jar
cdk-interfaces.jar
-cdk-data.jar
cdk-core.jar
cdk-standard.jar
cdk-libiocml.jar
View
2 src/main/org/openscience/cdk/reaction/ReactionChain.java
@@ -43,7 +43,7 @@
* in a step of the chain.
*
* @author miguelrojasch <miguelrojasch@yahoo.es>
- * @cdk.module reaction
+ * @cdk.module extra
*/
@TestClass(value="org.openscience.cdk.reaction.ReactionChainTest")
public class ReactionChain extends ReactionSet{
View
7 src/main/org/openscience/cdk/reaction/mechanism/AdductionLPMechanism.java
@@ -20,7 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -111,18 +110,18 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom1C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule1);
/* mapping */
for(IAtom atom:molecule1.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(
+ IMapping mapping = atom1C.getBuilder().newInstance(
IMapping.class,
atom, reactantCloned.getAtom(molecule1.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
for(IAtom atom:molecule2.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(
+ IMapping mapping = atom1C.getBuilder().newInstance(
IMapping.class,
atom, reactantCloned.getAtom(molecule2.getAtomNumber(atom)));
reaction.addMapping(mapping);
View
7 src/main/org/openscience/cdk/reaction/mechanism/AdductionPBMechanism.java
@@ -20,7 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -119,16 +118,16 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom3C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom1C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule1);
/* mapping */
for(IAtom atom:molecule1.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule1.getAtomNumber(atom)));
+ IMapping mapping = atom1C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule1.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
for(IAtom atom:molecule2.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule2.getAtomNumber(atom)));
+ IMapping mapping = atom1C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule2.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
View
9 src/main/org/openscience/cdk/reaction/mechanism/HeterolyticCleavageMechanism.java
@@ -20,8 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.LonePair;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -32,6 +30,7 @@
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
+import org.openscience.cdk.interfaces.ILonePair;
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.reaction.IReactionMechanism;
@@ -107,19 +106,19 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
charge = atom2C.getFormalCharge();
atom2C.setFormalCharge(charge-1);
- reactantCloned.addLonePair(new LonePair(atom2C));
+ reactantCloned.addLonePair(atom1C.getBuilder().newInstance(ILonePair.class, atom2C));
// check if resulting atom type is reasonable: an acceptor atom cannot be charged positive*/
atom2C.setHybridization(null);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactantCloned);
type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom1C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom1C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
if(bond1.getOrder() != IBond.Order.SINGLE) {
View
11 src/main/org/openscience/cdk/reaction/mechanism/HomolyticCleavageMechanism.java
@@ -20,8 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.SingleElectron;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -34,6 +32,7 @@
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IReaction;
+import org.openscience.cdk.interfaces.ISingleElectron;
import org.openscience.cdk.reaction.IReactionMechanism;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
import org.openscience.cdk.tools.manipulator.BondManipulator;
@@ -96,8 +95,8 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
else
BondManipulator.decreaseBondOrder(reactantCloned.getBond(posBond1));
- reactantCloned.addSingleElectron(new SingleElectron(atom1C));
- reactantCloned.addSingleElectron(new SingleElectron(atom2C));
+ reactantCloned.addSingleElectron(bond1.getBuilder().newInstance(ISingleElectron.class, atom1C));
+ reactantCloned.addSingleElectron(bond1.getBuilder().newInstance(ISingleElectron.class, atom2C));
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactantCloned);
// check if resulting atom type is reasonable
@@ -110,12 +109,12 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom2C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom2C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
if(bond1.getOrder() != IBond.Order.SINGLE) {
View
8 src/main/org/openscience/cdk/reaction/mechanism/RadicalSiteIonizationMechanism.java
@@ -20,8 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.SingleElectron;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -115,18 +113,18 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null) return null;
- reactantCloned.addSingleElectron(new SingleElectron(atom3C));
+ reactantCloned.addSingleElectron(atom2C.getBuilder().newInstance(ISingleElectron.class, atom3C));
atom3C.setHybridization(null);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactantCloned);
type = atMatcher.findMatchingAtomType(reactantCloned, atom3C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom2C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom2C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
View
8 src/main/org/openscience/cdk/reaction/mechanism/RadicalSiteRearrangementMechanism.java
@@ -20,8 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.SingleElectron;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -109,18 +107,18 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
IAtomType type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null) return null;
- reactantCloned.addSingleElectron(new SingleElectron(atom3C));
+ reactantCloned.addSingleElectron(atom2C.getBuilder().newInstance(ISingleElectron.class, atom3C));
atom3C.setHybridization(null);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactantCloned);
type = atMatcher.findMatchingAtomType(reactantCloned, atom3C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom2C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom2C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
View
11 src/main/org/openscience/cdk/reaction/mechanism/RearrangementChargeMechanism.java
@@ -24,9 +24,6 @@
import java.util.List;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.LonePair;
-import org.openscience.cdk.SingleElectron;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -116,7 +113,7 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
List<ISingleElectron> selectron = reactantCloned.getConnectedSingleElectronsList(atom1C);
reactantCloned.removeSingleElectron(selectron.get(selectron.size() -1));
- reactantCloned.addSingleElectron(new SingleElectron(atom3C));
+ reactantCloned.addSingleElectron(bond2.getBuilder().newInstance(ISingleElectron.class, atom3C));
}else if(atom1C.getFormalCharge() > 0){
int charge = atom1C.getFormalCharge();
@@ -134,7 +131,7 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
charge = atom3C.getFormalCharge();
atom3C.setFormalCharge(charge-1);
- reactantCloned.addLonePair(new LonePair(atom3C));
+ reactantCloned.addLonePair(bond2.getBuilder().newInstance(ILonePair.class, atom3C));
atom3C.setFlag(CDKConstants.ISAROMATIC,false);
}else
return null;
@@ -149,12 +146,12 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom3C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = bond2.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = bond2.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
if(bond2.getOrder() != IBond.Order.SINGLE) {
View
9 src/main/org/openscience/cdk/reaction/mechanism/RemovingSEofBMechanism.java
@@ -20,8 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.SingleElectron;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -34,6 +32,7 @@
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IReaction;
+import org.openscience.cdk.interfaces.ISingleElectron;
import org.openscience.cdk.reaction.IReactionMechanism;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
import org.openscience.cdk.tools.manipulator.BondManipulator;
@@ -100,7 +99,7 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
int charge = atom1C.getFormalCharge();
atom1C.setFormalCharge(charge+1);
- reactantCloned.addSingleElectron(new SingleElectron(atom2C));
+ reactantCloned.addSingleElectron(atom1C.getBuilder().newInstance(ISingleElectron.class, atom2C));
// check if resulting atom type is reasonable
atom1C.setHybridization(null);
@@ -112,12 +111,12 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null)return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom1C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom1C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
if(bond1.getOrder() != IBond.Order.SINGLE) {
View
9 src/main/org/openscience/cdk/reaction/mechanism/RemovingSEofNBMechanism.java
@@ -20,8 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
-import org.openscience.cdk.SingleElectron;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -34,6 +32,7 @@
import org.openscience.cdk.interfaces.ILonePair;
import org.openscience.cdk.interfaces.IMapping;
import org.openscience.cdk.interfaces.IReaction;
+import org.openscience.cdk.interfaces.ISingleElectron;
import org.openscience.cdk.reaction.IReactionMechanism;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
@@ -89,7 +88,7 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
List<ILonePair> lps = reactantCloned.getConnectedLonePairsList(reactantCloned.getAtom(posAtom));
reactantCloned.removeLonePair(lps.get(lps.size() - 1));
- reactantCloned.addSingleElectron(new SingleElectron(reactantCloned.getAtom(posAtom)));
+ reactantCloned.addSingleElectron(molecule.getBuilder().newInstance(ISingleElectron.class, reactantCloned.getAtom(posAtom)));
int charge = reactantCloned.getAtom(posAtom).getFormalCharge();
reactantCloned.getAtom(posAtom).setFormalCharge(charge+1);
@@ -100,12 +99,12 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
if (type == null)
return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = molecule.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = molecule.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
reaction.addProduct(reactantCloned);
View
5 src/main/org/openscience/cdk/reaction/mechanism/SharingElectronMechanism.java
@@ -20,7 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -112,12 +111,12 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom2C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom2C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom2C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
reaction.addProduct(reactantCloned);
View
5 src/main/org/openscience/cdk/reaction/mechanism/TautomerizationMechanism.java
@@ -20,7 +20,6 @@
*/
package org.openscience.cdk.reaction.mechanism;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.atomtype.CDKAtomTypeMatcher;
@@ -115,12 +114,12 @@ public IReaction initiate(IAtomContainerSet atomContainerSet, ArrayList<IAtom> a
type = atMatcher.findMatchingAtomType(reactantCloned, atom3C);
if (type == null) return null;
- IReaction reaction = DefaultChemObjectBuilder.getInstance().newInstance(IReaction.class);
+ IReaction reaction = atom2C.getBuilder().newInstance(IReaction.class);
reaction.addReactant(molecule);
/* mapping */
for(IAtom atom:molecule.atoms()){
- IMapping mapping = DefaultChemObjectBuilder.getInstance().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
+ IMapping mapping = atom2C.getBuilder().newInstance(IMapping.class,atom, reactantCloned.getAtom(molecule.getAtomNumber(atom)));
reaction.addMapping(mapping);
}
View
3 src/main/org/openscience/cdk/reaction/type/AdductionProtonLPReaction.java
@@ -25,7 +25,6 @@
package org.openscience.cdk.reaction.type;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -130,7 +129,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("AdductionProtonLPReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
IParameterReact ipr = super.getParameterClass(SetReactionCenter.class);
View
3 src/main/org/openscience/cdk/reaction/type/AdductionProtonPBReaction.java
@@ -25,7 +25,6 @@
package org.openscience.cdk.reaction.type;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -131,7 +130,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("AdductionProtonPBReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/AdductionSodiumLPReaction.java
@@ -25,7 +25,6 @@
package org.openscience.cdk.reaction.type;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -131,7 +130,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("AdductionSodiumLPReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/ElectronImpactNBEReaction.java
@@ -25,7 +25,6 @@
package org.openscience.cdk.reaction.type;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -128,7 +127,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("ElectronImpactNBEReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/ElectronImpactPDBReaction.java
@@ -25,7 +25,6 @@
package org.openscience.cdk.reaction.type;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -127,7 +126,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("ElectronImpactPDBReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/ElectronImpactSDBReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -126,7 +125,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("ElectronImpactSDBReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/HeterolyticCleavageSBReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -136,7 +135,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("HeterolyticCleavageSBReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/HomolyticCleavageReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -127,7 +126,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("HomolyticCleavageReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
2 src/main/org/openscience/cdk/reaction/type/PiBondingMovementReaction.java
@@ -215,7 +215,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
*/
private void setActiveCenters(IAtomContainer reactant) throws CDKException {
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing) ringSet.getAtomContainer(ir);
//only rings with even number of atoms
View
6 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrAlphaReaction.java
@@ -138,7 +138,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactant);
CDKHueckelAromaticityDetector.detectAromaticity(reactant);
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing)ringSet.getAtomContainer(ir);
for (int jr = 0; jr < ring.getAtomCount(); jr++) {
@@ -158,7 +158,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 2, true);
+ hcg.getSpheres(reactant, atomi, 2, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(2).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -215,7 +215,7 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 2, true);
+ hcg.getSpheres(reactant, atomi, 2, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(2).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
6 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrBetaReaction.java
@@ -139,7 +139,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactant);
CDKHueckelAromaticityDetector.detectAromaticity(reactant);
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing)ringSet.getAtomContainer(ir);
for (int jr = 0; jr < ring.getAtomCount(); jr++) {
@@ -159,7 +159,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 3, true);
+ hcg.getSpheres(reactant, atomi, 3, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(3).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -216,7 +216,7 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 3, true);
+ hcg.getSpheres(reactant, atomi, 3, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(3).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
6 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrDeltaReaction.java
@@ -140,7 +140,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactant);
CDKHueckelAromaticityDetector.detectAromaticity(reactant);
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing)ringSet.getAtomContainer(ir);
for (int jr = 0; jr < ring.getAtomCount(); jr++) {
@@ -160,7 +160,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 5, true);
+ hcg.getSpheres(reactant, atomi, 5, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(5).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -217,7 +217,7 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 5, true);
+ hcg.getSpheres(reactant, atomi, 5, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(5).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
6 src/main/org/openscience/cdk/reaction/type/RadicalSiteHrGammaReaction.java
@@ -139,7 +139,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactant);
CDKHueckelAromaticityDetector.detectAromaticity(reactant);
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing)ringSet.getAtomContainer(ir);
for (int jr = 0; jr < ring.getAtomCount(); jr++) {
@@ -159,7 +159,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER) && atomi.getSymbol().equals("C")
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 4, true);
+ hcg.getSpheres(reactant, atomi, 4, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(4).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -217,7 +217,7 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
if(atomi.getSymbol().equals("C")
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 4, true);
+ hcg.getSpheres(reactant, atomi, 4, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(4).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
3 src/main/org/openscience/cdk/reaction/type/RadicalSiteInitiationReaction.java
@@ -25,7 +25,6 @@
package org.openscience.cdk.reaction.type;
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -125,7 +124,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("RadicalSiteInitiationReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
10 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrAlphaReaction.java
@@ -140,7 +140,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactant);
CDKHueckelAromaticityDetector.detectAromaticity(reactant);
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing)ringSet.getAtomContainer(ir);
for (int jr = 0; jr < ring.getAtomCount(); jr++) {
@@ -160,10 +160,10 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 1, true);
+ hcg.getSpheres(reactant, atomi, 1, true);
List<IAtom> atom1s = hcg.getNodesInSphere(1);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 2, true);
+ hcg.getSpheres(reactant, atomi, 2, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(2).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -223,10 +223,10 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 1, true);
+ hcg.getSpheres(reactant, atomi, 1, true);
List<IAtom> atom1s = hcg.getNodesInSphere(1);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 2, true);
+ hcg.getSpheres(reactant, atomi, 2, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(2).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
10 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrBetaReaction.java
@@ -139,7 +139,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(reactant);
CDKHueckelAromaticityDetector.detectAromaticity(reactant);
AllRingsFinder arf = new AllRingsFinder();
- IRingSet ringSet = arf.findAllRings((IAtomContainer) reactant);
+ IRingSet ringSet = arf.findAllRings(reactant);
for (int ir = 0; ir < ringSet.getAtomContainerCount(); ir++) {
IRing ring = (IRing)ringSet.getAtomContainer(ir);
for (int jr = 0; jr < ring.getAtomCount(); jr++) {
@@ -159,10 +159,10 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 2, true);
+ hcg.getSpheres(reactant, atomi, 2, true);
List<IAtom> atom1s = hcg.getNodesInSphere(2);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 3, true);
+ hcg.getSpheres(reactant, atomi, 3, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(3).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -222,10 +222,10 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 2, true);
+ hcg.getSpheres(reactant, atomi, 2, true);
List<IAtom> atom1s = hcg.getNodesInSphere(2);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 3, true);
+ hcg.getSpheres(reactant, atomi, 3, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(3).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
8 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrDeltaReaction.java
@@ -159,10 +159,10 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 3, true);
+ hcg.getSpheres(reactant, atomi, 3, true);
List<IAtom> atom1s = hcg.getNodesInSphere(3);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 4, true);
+ hcg.getSpheres(reactant, atomi, 4, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(4).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -222,10 +222,10 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 3, true);
+ hcg.getSpheres(reactant, atomi, 3, true);
List<IAtom> atom1s = hcg.getNodesInSphere(3);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 4, true);
+ hcg.getSpheres(reactant, atomi, 4, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(4).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
8 src/main/org/openscience/cdk/reaction/type/RadicalSiteRrGammaReaction.java
@@ -160,10 +160,10 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
if(atomi.getFlag(CDKConstants.REACTIVE_CENTER)
&& reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 4, true);
+ hcg.getSpheres(reactant, atomi, 4, true);
List<IAtom> atom1s = hcg.getNodesInSphere(4);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 5, true);
+ hcg.getSpheres(reactant, atomi, 5, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(5).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
@@ -223,10 +223,10 @@ private void setActiveCenters(IAtomContainer reactant) throws CDKException {
IAtom atomi = atomis.next();
if(reactant.getConnectedSingleElectronsCount(atomi) == 1) {
- hcg.getSpheres((IAtomContainer) reactant, atomi, 4, true);
+ hcg.getSpheres(reactant, atomi, 4, true);
List<IAtom> atom1s = hcg.getNodesInSphere(4);
- hcg.getSpheres((IAtomContainer) reactant, atomi, 5, true);
+ hcg.getSpheres(reactant, atomi, 5, true);
Iterator<IAtom> atomls = hcg.getNodesInSphere(5).iterator();
while(atomls.hasNext()){
IAtom atoml = atomls.next();
View
3 src/main/org/openscience/cdk/reaction/type/RearrangementAnionReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -127,7 +126,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("RearrangementAnionReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/RearrangementCationReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -131,7 +130,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("RearrangementCationReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/RearrangementLonePairReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -130,7 +129,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("RearrangementLonePairReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/RearrangementRadicalReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -132,7 +131,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("RearrangementRadicalReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/SharingAnionReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -128,7 +127,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("SharingAnionReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
IParameterReact ipr = super.getParameterClass(SetReactionCenter.class);
View
3 src/main/org/openscience/cdk/reaction/type/SharingChargeDBReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -129,7 +128,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("SharingChargeDBReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/SharingChargeSBReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -130,7 +129,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("SharingChargeSBReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
3 src/main/org/openscience/cdk/reaction/type/SharingLonePairReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -128,7 +127,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("SharingLonePairReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
IParameterReact ipr = super.getParameterClass(SetReactionCenter.class);
View
3 src/main/org/openscience/cdk/reaction/type/TautomerizationReaction.java
@@ -26,7 +26,6 @@
import org.openscience.cdk.CDKConstants;
-import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.annotations.TestClass;
import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.exception.CDKException;
@@ -129,7 +128,7 @@ public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agen
throw new CDKException("TautomerizationReaction don't expects agents");
}
- IReactionSet setOfReactions = DefaultChemObjectBuilder.getInstance().newInstance(IReactionSet.class);
+ IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
IAtomContainer reactant = reactants.getAtomContainer(0);
/* if the parameter hasActiveCenter is not fixed yet, set the active centers*/
View
2 src/test/org/openscience/cdk/modulesuites/MextraTests.java
@@ -32,6 +32,7 @@
import org.openscience.cdk.index.CASNumberTest;
import org.openscience.cdk.io.ShelXWriterTest;
import org.openscience.cdk.iupac.ParserTest;
+import org.openscience.cdk.reaction.ReactionChainTest;
import org.openscience.cdk.tools.BremserPredictorTest;
import org.openscience.cdk.tools.DeAromatizationToolTest;
import org.openscience.cdk.tools.HOSECodeAnalyserTest;
@@ -56,6 +57,7 @@
BremserPredictorTest.class,
ParserTest.class,
ExhaustiveFragmenterTest.class,
+ ReactionChainTest.class,
MurckoFragmenterTest.class
})
public class MextraTests {}
View
2 src/test/org/openscience/cdk/modulesuites/MreactionTests.java
@@ -30,7 +30,6 @@
import org.openscience.cdk.atomtype.ResonanceStructuresTest;
import org.openscience.cdk.coverage.ReactionCoverageTest;
import org.openscience.cdk.graph.invariant.ConjugatedPiSystemsDetectorTest;
-import org.openscience.cdk.reaction.ReactionChainTest;
import org.openscience.cdk.reaction.ReactionEngineTest;
import org.openscience.cdk.reaction.ReactionSpecificationTest;
import org.openscience.cdk.reaction.mechanism.AdductionLPMechanismTest;
@@ -92,7 +91,6 @@
ReactionCoverageTest.class,
// Individual Tests
- ReactionChainTest.class,
ReactionEngineTest.class,
ReactionSpecificationTest.class,
View
2 src/test/org/openscience/cdk/reaction/ReactionChainTest.java
@@ -31,7 +31,7 @@
/**
* Tests for IReactionChain implementations.
*
- * @cdk.module test-reaction
+ * @cdk.module test-extra
*/
public class ReactionChainTest extends CDKTestCase {

0 comments on commit a21ccc2

Please sign in to comment.