public void RequireAtLeastTwoProjectedSubstituents() { var m = new AtomContainer(); m.Atoms.Add(Atom("O", 0, -0.71d, 1.24d)); m.Atoms.Add(Atom("C", 0, 0.00d, 0.83d)); m.Atoms.Add(Atom("O", 0, 0.71d, 1.24d)); m.Atoms.Add(Atom("C", 1, 0.00d, 0.00d)); m.Atoms.Add(Atom("C", 2, -0.67d, -0.48d)); m.Atoms.Add(Atom("C", 2, -0.41d, -1.27d)); m.Atoms.Add(Atom("C", 2, 0.41d, -1.27d)); m.Atoms.Add(Atom("N", 1, 0.67d, -0.48d)); m.AddBond(m.Atoms[6], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[0], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[2], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[5], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[6], m.Atoms[7], BondOrder.Single); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); var elements = recon.Recognise(new[] { Projection.Haworth }).ToReadOnlyList(); Assert.IsTrue(elements.Count == 0); }
public void ChairClockwise() { Assert.IsTrue(Compares.AreDeepEqual( new Turn[] { Left, Left, Right, Left, Left, Right }, CyclicCarbohydrateRecognition.GetTurns(new Vector2[] { new Vector2(1.7, 2.4), new Vector2(1.3, 3.1), new Vector2(0.5, 2.9), new Vector2(0.2, 3.1), new Vector2(0.1, 2.4), new Vector2(0.9, 2.6) }))); }
public void HaworthClockwise() { Assert.IsTrue(Compares.AreDeepEqual( new Turn[] { Right, Right, Right, Right, Right, Right }, CyclicCarbohydrateRecognition.GetTurns(new Vector2[] { new Vector2(4.1, 3.0), new Vector2(4.8, 2.6), new Vector2(4.8, 1.8), new Vector2(4.1, 1.4), new Vector2(3.3, 1.8), new Vector2(3.3, 2.6) }))); }
public void BoatClockwise() { Assert.IsTrue(Compares.AreDeepEqual( new Turn[] { Left, Right, Right, Left, Left, Left }, CyclicCarbohydrateRecognition.GetTurns(new Vector2[] { new Vector2(3.8, 4.8), new Vector2(3.1, 4.2), new Vector2(2.3, 4.2), new Vector2(1.6, 4.9), new Vector2(2.1, 3.8), new Vector2(3.3, 3.8) }))); }
public void Hexopyranose() { var m = new AtomContainer(); m.Atoms.Add(Atom("O", 1, 0.00d, 2.48d)); m.Atoms.Add(Atom("C", 2, 0.71d, 2.06d)); m.Atoms.Add(Atom("C", 1, 0.71d, 1.24d)); m.Atoms.Add(Atom("O", 0, 1.43d, 0.82d)); m.Atoms.Add(Atom("C", 1, 1.43d, -0.00d)); m.Atoms.Add(Atom("O", 1, 2.14d, -0.41d)); m.Atoms.Add(Atom("C", 1, 0.71d, -0.41d)); m.Atoms.Add(Atom("O", 1, 0.71d, -1.24d)); m.Atoms.Add(Atom("C", 1, -0.00d, 0.00d)); m.Atoms.Add(Atom("O", 1, -0.71d, -0.41d)); m.Atoms.Add(Atom("C", 1, 0.00d, 0.83d)); m.Atoms.Add(Atom("O", 1, -0.71d, 1.24d)); m.AddBond(m.Atoms[0], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[6], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[6], m.Atoms[8], BondOrder.Single); m.AddBond(m.Atoms[8], m.Atoms[9], BondOrder.Single); m.AddBond(m.Atoms[8], m.Atoms[10], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[10], BondOrder.Single); m.AddBond(m.Atoms[10], m.Atoms[11], BondOrder.Single); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); Assert.IsTrue(recon.Recognise(new[] { Projection.Haworth }).Count() == 0); }
public void HaworthFalsePositive() { var m = new AtomContainer(); m.Atoms.Add(Atom("C", 2, -0.71d, 0.41d)); m.Atoms.Add(Atom("C", 2, 0.71d, -0.41d)); m.Atoms.Add(Atom("C", 2, 0.71d, 0.41d)); m.Atoms.Add(Atom("C", 2, -0.71d, -0.41d)); m.Atoms.Add(Atom("C", 1, 0.00d, 0.82d)); m.Atoms.Add(Atom("C", 3, 0.00d, 1.65d)); m.Atoms.Add(Atom("C", 3, -0.71d, -2.06d)); m.Atoms.Add(Atom("C", 1, -0.00d, -1.65d)); m.Atoms.Add(Atom("C", 3, 0.71d, -2.06d)); m.Atoms.Add(Atom("C", 1, -0.00d, -0.83d)); m.AddBond(m.Atoms[9], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[9], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[0], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[9], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[7], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[7], m.Atoms[8], BondOrder.Single); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); var elements = recon.Recognise(new[] { Projection.Haworth }).ToReadOnlyList(); Assert.IsTrue(elements.Count == 0); }
public void BetaDGlucose_Chair_Rotated() { var m = new AtomContainer(); m.Atoms.Add(Atom("C", 1, -0.77d, 10.34d)); m.Atoms.Add(Atom("C", 1, 0.03d, 10.13d)); m.Atoms.Add(Atom("O", 0, 0.83d, 10.34d)); m.Atoms.Add(Atom("C", 1, 1.24d, 9.63d)); m.Atoms.Add(Atom("C", 1, 0.44d, 9.84d)); m.Atoms.Add(Atom("C", 1, -0.35d, 9.63d)); m.Atoms.Add(Atom("O", 1, 0.86d, 9.13d)); m.Atoms.Add(Atom("O", 1, 2.04d, 9.84d)); m.Atoms.Add(Atom("C", 2, -0.68d, 10.54d)); m.Atoms.Add(Atom("O", 1, -0.68d, 11.37d)); m.Atoms.Add(Atom("O", 1, -1.48d, 9.93d)); m.Atoms.Add(Atom("O", 1, -1.15d, 9.84d)); m.AddBond(m.Atoms[0], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[2], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[5], m.Atoms[0], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[8], BondOrder.Single); m.AddBond(m.Atoms[8], m.Atoms[9], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[10], BondOrder.Single); m.AddBond(m.Atoms[5], m.Atoms[11], BondOrder.Single); Vector2 center = GeometryUtil.Get2DCenter(m); GeometryUtil.Rotate(m, center, Vectors.DegreeToRadian(-80)); for (int i = 0; i < 30; i++) { GeometryUtil.Rotate(m, center, Vectors.DegreeToRadian(5)); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); var elements = recon.Recognise(new[] { Projection.Chair }).ToReadOnlyList(); m.SetStereoElements(elements); AssertTetrahedralCenter(elements[0], m.Atoms[1], TetrahedralStereo.Clockwise, m.Atoms[8], m.Atoms[0], m.Atoms[1], m.Atoms[2]); AssertTetrahedralCenter(elements[1], m.Atoms[3], TetrahedralStereo.Clockwise, m.Atoms[7], m.Atoms[2], m.Atoms[3], m.Atoms[4]); AssertTetrahedralCenter(elements[2], m.Atoms[4], TetrahedralStereo.Clockwise, m.Atoms[4], m.Atoms[3], m.Atoms[6], m.Atoms[5]); AssertTetrahedralCenter(elements[3], m.Atoms[5], TetrahedralStereo.Clockwise, m.Atoms[11], m.Atoms[4], m.Atoms[5], m.Atoms[0]); AssertTetrahedralCenter(elements[4], m.Atoms[0], TetrahedralStereo.Clockwise, m.Atoms[0], m.Atoms[5], m.Atoms[10], m.Atoms[1]); } }
public void Atp_Haworth() { var m = new AtomContainer(); m.Atoms.Add(Atom("O", 0, 2.56d, -6.46d)); m.Atoms.Add(Atom("C", 1, 1.90d, -6.83d)); m.Atoms.Add(Atom("C", 1, 2.15d, -7.46d)); m.Atoms.Add(Atom("C", 1, 2.98d, -7.46d)); m.Atoms.Add(Atom("C", 1, 3.23d, -6.83d)); m.Atoms.Add(Atom("C", 2, 1.90d, -6.00d)); m.Atoms.Add(Atom("O", 0, 1.18d, -5.59d)); m.Atoms.Add(Atom("O", 1, 2.15d, -8.29d)); m.Atoms.Add(Atom("O", 1, 2.98d, -8.29d)); m.Atoms.Add(Atom("P", 0, 0.36d, -5.59d)); m.Atoms.Add(Atom("O", 0, -0.47d, -5.59d)); m.Atoms.Add(Atom("O", 0, 0.36d, -4.76d)); m.Atoms.Add(Atom("O", 1, 0.36d, -6.41d)); m.Atoms.Add(Atom("P", 0, -1.29d, -5.59d)); m.Atoms.Add(Atom("O", 0, -2.12d, -5.59d)); m.Atoms.Add(Atom("O", 0, -1.29d, -4.76d)); m.Atoms.Add(Atom("O", 1, -1.29d, -6.41d)); m.Atoms.Add(Atom("P", 0, -2.94d, -5.59d)); m.Atoms.Add(Atom("O", 1, -3.77d, -5.59d)); m.Atoms.Add(Atom("O", 0, -2.94d, -4.76d)); m.Atoms.Add(Atom("O", 1, -2.94d, -6.41d)); m.Atoms.Add(Atom("C", 0, 4.73d, -4.51d)); m.Atoms.Add(Atom("C", 0, 4.02d, -4.92d)); m.Atoms.Add(Atom("C", 0, 4.02d, -5.75d)); m.Atoms.Add(Atom("N", 0, 4.73d, -6.16d)); m.Atoms.Add(Atom("N", 0, 5.44d, -5.75d)); m.Atoms.Add(Atom("C", 1, 5.44d, -4.92d)); m.Atoms.Add(Atom("C", 1, 2.75d, -5.33d)); m.Atoms.Add(Atom("N", 0, 3.23d, -4.67d)); m.Atoms.Add(Atom("N", 2, 4.73d, -3.68d)); m.Atoms.Add(Atom("N", 0, 3.23d, -6.00d)); m.AddBond(m.Atoms[0], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[2], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[5], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[8], BondOrder.Single); m.AddBond(m.Atoms[6], m.Atoms[9], BondOrder.Single); m.AddBond(m.Atoms[9], m.Atoms[10], BondOrder.Single); m.AddBond(m.Atoms[9], m.Atoms[11], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[9], m.Atoms[12], BondOrder.Single); m.AddBond(m.Atoms[13], m.Atoms[14], BondOrder.Single); m.AddBond(m.Atoms[13], m.Atoms[15], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[13], m.Atoms[16], BondOrder.Single); m.AddBond(m.Atoms[10], m.Atoms[13], BondOrder.Single); m.AddBond(m.Atoms[17], m.Atoms[18], BondOrder.Single); m.AddBond(m.Atoms[17], m.Atoms[19], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[17], m.Atoms[20], BondOrder.Single); m.AddBond(m.Atoms[14], m.Atoms[17], BondOrder.Single); m.AddBond(m.Atoms[21], m.Atoms[22], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[22], m.Atoms[23], BondOrder.Single); m.AddBond(m.Atoms[23], m.Atoms[24], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[24], m.Atoms[25], BondOrder.Single); m.AddBond(m.Atoms[25], m.Atoms[26], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[21], m.Atoms[26], BondOrder.Single); m.AddBond(m.Atoms[27], m.Atoms[28], BondOrder.Double, BondStereo.EZByCoordinates); m.AddBond(m.Atoms[22], m.Atoms[28], BondOrder.Single); m.AddBond(m.Atoms[21], m.Atoms[29], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[30], BondOrder.Single); m.AddBond(m.Atoms[30], m.Atoms[27], BondOrder.Single); m.AddBond(m.Atoms[23], m.Atoms[30], BondOrder.Single); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); var elements = recon.Recognise(new[] { Projection.Haworth }).ToReadOnlyList(); AssertTetrahedralCenter(elements[0], m.Atoms[1], TetrahedralStereo.AntiClockwise, m.Atoms[5], m.Atoms[0], m.Atoms[1], m.Atoms[2]); AssertTetrahedralCenter(elements[1], m.Atoms[2], TetrahedralStereo.AntiClockwise, m.Atoms[2], m.Atoms[1], m.Atoms[7], m.Atoms[3]); AssertTetrahedralCenter(elements[2], m.Atoms[3], TetrahedralStereo.AntiClockwise, m.Atoms[3], m.Atoms[2], m.Atoms[8], m.Atoms[4]); AssertTetrahedralCenter(elements[3], m.Atoms[4], TetrahedralStereo.AntiClockwise, m.Atoms[30], m.Atoms[3], m.Atoms[4], m.Atoms[0]); }
public void Oxpene() { var m = new AtomContainer(); m.Atoms.Add(Atom("C", 1, 1.39d, 3.65d)); m.Atoms.Add(Atom("C", 2, 2.22d, 3.65d)); m.Atoms.Add(Atom("C", 1, 2.93d, 4.07d)); m.Atoms.Add(Atom("C", 1, 0.68d, 4.07d)); m.Atoms.Add(Atom("C", 1, 1.01d, 4.63d)); m.Atoms.Add(Atom("C", 1, 2.52d, 4.64d)); m.Atoms.Add(Atom("O", 0, 1.76d, 4.89d)); m.Atoms.Add(Atom("O", 1, 0.68d, 3.24d)); m.Atoms.Add(Atom("C", 2, 1.01d, 5.45d)); m.Atoms.Add(Atom("O", 1, 0.18d, 5.45d)); m.Atoms.Add(Atom("C", 3, 2.52d, 5.46d)); m.Atoms.Add(Atom("O", 0, 2.93d, 3.24d)); m.Atoms.Add(Atom("C", 2, 1.39d, 4.48d)); m.Atoms.Add(Atom("C", 3, 2.22d, 4.48d)); m.Atoms.Add(Atom("C", 2, 3.76d, 3.24d)); m.Atoms.Add(Atom("C", 2, 4.34d, 2.66d)); m.Atoms.Add(Atom("O", 0, 5.16d, 2.66d)); m.Atoms.Add(Atom("C", 3, 5.58d, 3.37d)); m.AddBond(m.Atoms[0], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[2], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[5], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[8], BondOrder.Single); m.AddBond(m.Atoms[8], m.Atoms[9], BondOrder.Single); m.AddBond(m.Atoms[5], m.Atoms[10], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[11], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[12], BondOrder.Single); m.AddBond(m.Atoms[12], m.Atoms[13], BondOrder.Single); m.AddBond(m.Atoms[11], m.Atoms[14], BondOrder.Single); m.AddBond(m.Atoms[14], m.Atoms[15], BondOrder.Single); m.AddBond(m.Atoms[15], m.Atoms[16], BondOrder.Single); m.AddBond(m.Atoms[16], m.Atoms[17], BondOrder.Single); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); var elements = recon.Recognise(new[] { Projection.Haworth }).ToReadOnlyList(); AssertTetrahedralCenter(elements[0], m.Atoms[2], TetrahedralStereo.AntiClockwise, m.Atoms[2], m.Atoms[1], m.Atoms[11], m.Atoms[5]); AssertTetrahedralCenter(elements[1], m.Atoms[5], TetrahedralStereo.AntiClockwise, m.Atoms[10], m.Atoms[2], m.Atoms[5], m.Atoms[6]); AssertTetrahedralCenter(elements[2], m.Atoms[4], TetrahedralStereo.AntiClockwise, m.Atoms[8], m.Atoms[6], m.Atoms[4], m.Atoms[3]); AssertTetrahedralCenter(elements[3], m.Atoms[3], TetrahedralStereo.AntiClockwise, m.Atoms[3], m.Atoms[4], m.Atoms[7], m.Atoms[0]); AssertTetrahedralCenter(elements[4], m.Atoms[0], TetrahedralStereo.AntiClockwise, m.Atoms[12], m.Atoms[3], m.Atoms[0], m.Atoms[1]); }
public void BetaDGlucoseWithExplicitHydrogens_Haworth() { var m = new AtomContainer(); m.Atoms.Add(Atom("C", 0, 4.16d, 1.66d)); m.Atoms.Add(Atom("C", 0, 3.75d, 0.94d)); m.Atoms.Add(Atom("C", 0, 4.16d, 0.23d)); m.Atoms.Add(Atom("C", 0, 5.05d, 0.23d)); m.Atoms.Add(Atom("C", 0, 5.46d, 0.94d)); m.Atoms.Add(Atom("O", 0, 5.05d, 1.66d)); m.Atoms.Add(Atom("O", 1, 5.46d, 1.48d)); m.Atoms.Add(Atom("C", 2, 4.16d, 2.20d)); m.Atoms.Add(Atom("O", 1, 3.45d, 2.61d)); m.Atoms.Add(Atom("O", 1, 3.74d, 0.50d)); m.Atoms.Add(Atom("O", 1, 4.16d, 0.77d)); m.Atoms.Add(Atom("O", 1, 5.04d, -0.21d)); m.Atoms.Add(Atom("H", 0, 4.15d, -0.21d)); m.Atoms.Add(Atom("H", 0, 5.05d, 0.77d)); m.Atoms.Add(Atom("H", 0, 5.45d, 0.50d)); m.Atoms.Add(Atom("H", 0, 3.75d, 1.48d)); m.Atoms.Add(Atom("H", 0, 4.17d, 1.15d)); m.AddBond(m.Atoms[0], m.Atoms[1], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[2], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[3], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[4], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[5], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[6], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[7], BondOrder.Single); m.AddBond(m.Atoms[7], m.Atoms[8], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[9], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[10], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[11], BondOrder.Single); m.AddBond(m.Atoms[2], m.Atoms[12], BondOrder.Single); m.AddBond(m.Atoms[3], m.Atoms[13], BondOrder.Single); m.AddBond(m.Atoms[4], m.Atoms[14], BondOrder.Single); m.AddBond(m.Atoms[1], m.Atoms[15], BondOrder.Single); m.AddBond(m.Atoms[0], m.Atoms[16], BondOrder.Single); EdgeToBondMap bondMap = EdgeToBondMap.WithSpaceFor(m); int[][] graph = GraphUtil.ToAdjList(m, bondMap); Stereocenters stereocenters = new Stereocenters(m, graph, bondMap); stereocenters.CheckSymmetry(); CyclicCarbohydrateRecognition recon = new CyclicCarbohydrateRecognition(m, graph, bondMap, stereocenters); var elements = recon.Recognise(new[] { Projection.Haworth }).ToReadOnlyList(); AssertTetrahedralCenter(elements[0], m.Atoms[1], TetrahedralStereo.AntiClockwise, m.Atoms[15], m.Atoms[0], m.Atoms[9], m.Atoms[2]); AssertTetrahedralCenter(elements[1], m.Atoms[2], TetrahedralStereo.AntiClockwise, m.Atoms[10], m.Atoms[1], m.Atoms[12], m.Atoms[3]); AssertTetrahedralCenter(elements[2], m.Atoms[3], TetrahedralStereo.AntiClockwise, m.Atoms[13], m.Atoms[2], m.Atoms[11], m.Atoms[4]); AssertTetrahedralCenter(elements[3], m.Atoms[4], TetrahedralStereo.AntiClockwise, m.Atoms[6], m.Atoms[3], m.Atoms[14], m.Atoms[5]); AssertTetrahedralCenter(elements[4], m.Atoms[0], TetrahedralStereo.AntiClockwise, m.Atoms[7], m.Atoms[5], m.Atoms[16], m.Atoms[1]); }