public override void StartDocument() { ChemFile = builder.NewChemFile(); chemSequence = builder.NewChemSequence(); chemModel = builder.NewChemModel(); setOfMolecules = builder.NewChemObjectSet <IAtomContainer>(); }
public void SetUp() { molecule1 = builder.NewAtomContainer(); atomInMol1 = builder.NewAtom("Cl"); molecule1.Atoms.Add(atomInMol1); molecule1.Atoms.Add(builder.NewAtom("Cl")); bondInMol1 = builder.NewBond(atomInMol1, molecule1.Atoms[1]); molecule1.Bonds.Add(bondInMol1); molecule2 = builder.NewAtomContainer(); atomInMol2 = builder.NewAtom("O"); atomInMol2.ImplicitHydrogenCount = 2; molecule2.Atoms.Add(atomInMol2); moleculeSet = builder.NewChemObjectSet <IAtomContainer>(); moleculeSet.Add(molecule1); moleculeSet.Add(molecule2); reaction = builder.NewReaction(); reaction.Reactants.Add(molecule1); reaction.Products.Add(molecule2); reactionSet = builder.NewReactionSet(); reactionSet.Add(reaction); chemModel = builder.NewChemModel(); chemModel.MoleculeSet = moleculeSet; chemModel.ReactionSet = reactionSet; chemSequence1 = builder.NewChemSequence(); chemSequence1.Add(chemModel); chemSequence2 = builder.NewChemSequence(); chemFile = builder.NewChemFile(); chemFile.Add(chemSequence1); chemFile.Add(chemSequence2); }
public void TestRemoveElectronContainer_IAtomContainerSet_IElectronContainer() { var ms = builder.NewChemObjectSet <IAtomContainer>(); var mol = builder.NewAtomContainer(); mol.Atoms.Add(builder.NewAtom("O")); mol.Atoms.Add(builder.NewAtom("O")); mol.AddBond(mol.Atoms[0], mol.Atoms[1], BondOrder.Double); var bond = mol.Bonds[0]; ms.Add(mol); var otherBond = builder.NewBond(builder.NewAtom(), builder.NewAtom()); AtomContainerSetManipulator.RemoveElectronContainer(ms, otherBond); Assert.AreEqual(1, AtomContainerSetManipulator.GetBondCount(ms)); AtomContainerSetManipulator.RemoveElectronContainer(ms, bond); Assert.AreEqual(0, AtomContainerSetManipulator.GetBondCount(ms)); }
public void TestMoleculeSetID() { var writer = new StringWriter(); var moleculeSet = builder.NewChemObjectSet <IAtomContainer>(); moleculeSet.Id = "ms0"; var cmlWriter = new CMLWriter(writer); cmlWriter.Write(moleculeSet); cmlWriter.Close(); string cmlContent = writer.ToString(); Debug.WriteLine("****************************** TestReactionCustomization()"); Debug.WriteLine(cmlContent); Debug.WriteLine("******************************"); Assert.IsTrue(cmlContent.IndexOf("<moleculeList convention=\"cdk:moleculeSet\" id=\"ms0") != -1); }