public Ligand(IAtomContainer container, VisitedAtoms visitedAtoms, IAtom centralAtom, IAtom ligandAtom) { this.container = container; this.centralAtom = centralAtom; this.ligandAtom = ligandAtom; this.visitedAtoms = new VisitedAtoms(); this.visitedAtoms.Visited(visitedAtoms); this.visitedAtoms.Visited(centralAtom); }
public void TestOrder() { var molecule = smiles.ParseSmiles("CC(Br)([13C])[H]"); var ligands = new List <ILigand>(); var visitedAtoms = new VisitedAtoms(); ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 4)); ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 3)); ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 2)); ligands.Add(CIPTool.DefineLigand(molecule, visitedAtoms, 1, 0)); ligands.Sort(new CIPLigandRule()); Assert.AreEqual("H", ligands[0].LigandAtom.Symbol); Assert.AreEqual("C", ligands[1].LigandAtom.Symbol); Assert.AreEqual("C", ligands[2].LigandAtom.Symbol); Assert.AreEqual(13, ligands[2].LigandAtom.MassNumber.Value); Assert.AreEqual("Br", ligands[3].LigandAtom.Symbol); }
public void TestOrder() { VisitedAtoms visitedAtoms = new VisitedAtoms(); ILigand ligand1 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[4]); ILigand ligand2 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[3]); ILigand ligand3 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[2]); ILigand ligand4 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[0]); List <ILigand> ligands = new List <ILigand> { ligand1, ligand2, ligand3, ligand4 }; ligands.Sort(new AtomicNumberRule()); Assert.AreEqual("H", ligands[0].LigandAtom.Symbol); Assert.AreEqual("Cl", ligands[1].LigandAtom.Symbol); Assert.AreEqual("Br", ligands[2].LigandAtom.Symbol); Assert.AreEqual("I", ligands[3].LigandAtom.Symbol); }
public void TestOrder() { var visitedAtoms = new VisitedAtoms(); var ligand1 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[4]); var ligand2 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[3]); var ligand3 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[2]); var ligand4 = new Ligand(molecule, visitedAtoms, molecule.Atoms[1], molecule.Atoms[0]); var ligands = new List <ILigand> { ligand1, ligand2, ligand3, ligand4 }; ligands.Sort(new MassNumberRule()); Assert.IsNotNull(ligands[0]); Assert.AreEqual("H", ligands[0].LigandAtom.Symbol); Assert.AreEqual("H", ligands[1].LigandAtom.Symbol); Assert.AreEqual(2, ligands[1].LigandAtom.MassNumber.Value); Assert.AreEqual("C", ligands[2].LigandAtom.Symbol); Assert.AreEqual("C", ligands[3].LigandAtom.Symbol); Assert.AreEqual(13, ligands[3].LigandAtom.MassNumber.Value); }
public TerminalLigand(IAtomContainer container, VisitedAtoms visitedAtoms, IAtom centralAtom, IAtom ligandAtom) : base(container, visitedAtoms, centralAtom, ligandAtom) { }
public ImplicitHydrogenLigand(IAtomContainer container, VisitedAtoms visitedAtoms, IAtom centralAtom) : base(container, visitedAtoms, centralAtom, IMMUTABLE_HYDROGEN) { }