public void TestMapping() { var type = new TautomerizationReaction(); var setOfReactants = GetExampleReactants(); var molecule = setOfReactants[0]; /* automatic looking for active center */ var paramList = new List <IParameterReaction>(); var param = new SetReactionCenter(); param.IsSetParameter = false; paramList.Add(param); type.ParameterList = paramList; /* initiate */ var setOfReactions = type.Initiate(setOfReactants, null); var product = setOfReactions[0].Products[0]; Assert.AreEqual(7, setOfReactions[0].Mappings.Count); var mappedProductA1 = (IAtom)ReactionManipulator.GetMappedChemObject(setOfReactions[0], molecule.Atoms[0]); Assert.AreEqual(mappedProductA1, product.Atoms[0]); mappedProductA1 = (IAtom)ReactionManipulator.GetMappedChemObject(setOfReactions[0], molecule.Atoms[1]); Assert.AreEqual(mappedProductA1, product.Atoms[1]); mappedProductA1 = (IAtom)ReactionManipulator.GetMappedChemObject(setOfReactions[0], molecule.Atoms[2]); Assert.AreEqual(mappedProductA1, product.Atoms[2]); mappedProductA1 = (IAtom)ReactionManipulator.GetMappedChemObject(setOfReactions[0], molecule.Atoms[4]); Assert.AreEqual(mappedProductA1, product.Atoms[4]); }
public void TestManuallyCentreActive() { IReactionProcess type = new TautomerizationReaction(); var setOfReactants = GetExampleReactants(); IAtomContainer molecule = setOfReactants[0]; /* manually putting the active center */ molecule.Atoms[0].IsReactiveCenter = true; molecule.Atoms[1].IsReactiveCenter = true; molecule.Atoms[2].IsReactiveCenter = true; molecule.Atoms[4].IsReactiveCenter = true; molecule.Bonds[0].IsReactiveCenter = true; molecule.Bonds[1].IsReactiveCenter = true; molecule.Bonds[3].IsReactiveCenter = true; /* initiate */ var paramList = new List <IParameterReaction>(); var param = new SetReactionCenter(); param.IsSetParameter = true; paramList.Add(param); type.ParameterList = paramList; var setOfReactions = type.Initiate(setOfReactants, null); Assert.AreEqual(1, setOfReactions.Count); Assert.AreEqual(1, setOfReactions[0].Products.Count); IAtomContainer product = setOfReactions[0].Products[0]; IAtomContainer molecule2 = GetExpectedProducts()[0]; IQueryAtomContainer queryAtom = QueryAtomContainerCreator.CreateSymbolAndChargeQueryContainer(product); Assert.IsTrue(new UniversalIsomorphismTester().IsIsomorph(molecule2, queryAtom)); // reverse process /* manually putting the active center */ molecule2.Atoms[0].IsReactiveCenter = true; molecule2.Atoms[1].IsReactiveCenter = true; molecule2.Atoms[2].IsReactiveCenter = true; molecule2.Atoms[6].IsReactiveCenter = true; molecule2.Bonds[0].IsReactiveCenter = true; molecule2.Bonds[1].IsReactiveCenter = true; molecule2.Bonds[5].IsReactiveCenter = true; var setOfReactants2 = ChemObjectBuilder.Instance.NewAtomContainerSet(); setOfReactants2.Add(molecule2); var setOfReactions2 = type.Initiate(setOfReactants2, null); Assert.AreEqual(1, setOfReactions2.Count); Assert.AreEqual(1, setOfReactions2[0].Products.Count); IAtomContainer product2 = setOfReactions2[0].Products[0]; queryAtom = QueryAtomContainerCreator.CreateSymbolAndChargeQueryContainer(product2); Assert.IsTrue(new UniversalIsomorphismTester().IsIsomorph(molecule, queryAtom)); }
public void TestCDKConstants_REACTIVE_CENTER() { IReactionProcess type = new TautomerizationReaction(); var setOfReactants = GetExampleReactants(); IAtomContainer molecule = setOfReactants[0]; /* manually putting the active center */ molecule.Atoms[0].IsReactiveCenter = true; molecule.Atoms[1].IsReactiveCenter = true; molecule.Atoms[2].IsReactiveCenter = true; molecule.Atoms[4].IsReactiveCenter = true; molecule.Bonds[0].IsReactiveCenter = true; molecule.Bonds[1].IsReactiveCenter = true; molecule.Bonds[3].IsReactiveCenter = true; var paramList = new List <IParameterReaction>(); var param = new SetReactionCenter(); param.IsSetParameter = true; paramList.Add(param); type.ParameterList = paramList; /* initiate */ var setOfReactions = type.Initiate(setOfReactants, null); IAtomContainer reactant = setOfReactions[0].Reactants[0]; Assert.IsTrue(molecule.Atoms[0].IsReactiveCenter); Assert.IsTrue(reactant.Atoms[0].IsReactiveCenter); Assert.IsTrue(molecule.Atoms[1].IsReactiveCenter); Assert.IsTrue(reactant.Atoms[1].IsReactiveCenter); Assert.IsTrue(molecule.Atoms[2].IsReactiveCenter); Assert.IsTrue(reactant.Atoms[2].IsReactiveCenter); Assert.IsTrue(molecule.Atoms[4].IsReactiveCenter); Assert.IsTrue(reactant.Atoms[4].IsReactiveCenter); Assert.IsTrue(molecule.Bonds[0].IsReactiveCenter); Assert.IsTrue(reactant.Bonds[0].IsReactiveCenter); Assert.IsTrue(molecule.Bonds[1].IsReactiveCenter); Assert.IsTrue(reactant.Bonds[1].IsReactiveCenter); Assert.IsTrue(molecule.Bonds[3].IsReactiveCenter); Assert.IsTrue(reactant.Bonds[3].IsReactiveCenter); }
public override void TestInitiate_IAtomContainerSet_IAtomContainerSet() { IReactionProcess type = new TautomerizationReaction(); var setOfReactants = GetExampleReactants(); IAtomContainer molecule = setOfReactants[0]; /* initiate */ var paramList = new List <IParameterReaction>(); var param = new SetReactionCenter(); param.IsSetParameter = false; paramList.Add(param); type.ParameterList = paramList; var setOfReactions = type.Initiate(setOfReactants, null); Assert.AreEqual(1, setOfReactions.Count); Assert.AreEqual(1, setOfReactions[0].Products.Count); IAtomContainer product = setOfReactions[0].Products[0]; IAtomContainer molecule2 = GetExpectedProducts()[0]; IQueryAtomContainer queryAtom = QueryAtomContainerCreator.CreateSymbolAndChargeQueryContainer(product); Assert.IsTrue(new UniversalIsomorphismTester().IsIsomorph(molecule2, queryAtom)); // reverse process var setOfReactants2 = ChemObjectBuilder.Instance.NewAtomContainerSet(); setOfReactants2.Add(molecule2); IReactionSet setOfReactions2 = type.Initiate(setOfReactants2, null); Assert.AreEqual(1, setOfReactions2.Count); Assert.AreEqual(1, setOfReactions2[0].Products.Count); IAtomContainer product2 = setOfReactions2[0].Products[0]; queryAtom = QueryAtomContainerCreator.CreateSymbolAndChargeQueryContainer(product2); Assert.IsTrue(new UniversalIsomorphismTester().IsIsomorph(molecule, queryAtom)); }
public void TestTautomerizationReaction() { IReactionProcess type = new TautomerizationReaction(); Assert.IsNotNull(type); }
public void TestTautomerizationReaction() { var type = new TautomerizationReaction(); Assert.IsNotNull(type); }