continue; ITetrahedralChirality element = newTetrahedralCenter(focus, neighbors(v, graph, bonds));
@Test public void doNotCreateCenterWhenEastAndWestAreMissing() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom south = atom("C", 2, 0.80d, -0.41d); IBond[] bonds = new IBond[]{ new Bond(focus, north), new Bond(focus, south) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void createCenterWithThreeNeighbors_right() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.42d); IAtom south = atom("C", 2, 0.80d, -0.41d); IBond[] bonds = new IBond[]{ new Bond(focus, south), new Bond(focus, north), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertThat(element.getChiralAtom(), is(sameInstance(focus))); Assert.assertThat(element.getStereo(), is(ANTI_CLOCKWISE)); Assert.assertThat(element.getLigands()[0], is(sameInstance(north))); Assert.assertThat(element.getLigands()[1], is(sameInstance(east))); Assert.assertThat(element.getLigands()[2], is(sameInstance(south))); Assert.assertThat(element.getLigands()[3], is(sameInstance(focus))); }
@Test public void createCenterWithThreeNeighbors_left() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom south = atom("C", 2, 0.80d, -0.41d); IAtom west = atom("O", 1, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, south), new Bond(focus, north), new Bond(focus, west) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertThat(element.getChiralAtom(), is(sameInstance(focus))); Assert.assertThat(element.getStereo(), is(ANTI_CLOCKWISE)); Assert.assertThat(element.getLigands()[0], is(sameInstance(north))); Assert.assertThat(element.getLigands()[1], is(sameInstance(focus))); Assert.assertThat(element.getLigands()[2], is(sameInstance(south))); Assert.assertThat(element.getLigands()[3], is(sameInstance(west))); }
@Test public void doNotCreateCenterWhenSouthIsMissing() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.42d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, north), new Bond(focus, west), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void createCenterWithFourNeighbors() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.42d); IAtom south = atom("C", 2, 0.80d, -0.41d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, south), new Bond(focus, west), new Bond(focus, north), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertThat(element.getChiralAtom(), is(sameInstance(focus))); Assert.assertThat(element.getStereo(), is(ANTI_CLOCKWISE)); Assert.assertThat(element.getLigands()[0], is(sameInstance(north))); Assert.assertThat(element.getLigands()[1], is(sameInstance(east))); Assert.assertThat(element.getLigands()[2], is(sameInstance(south))); Assert.assertThat(element.getLigands()[3], is(sameInstance(west))); }
@Test public void doNotCreateCenterWhenNorthIsMissing() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom east = atom("O", 1, 1.63d, 0.42d); IAtom south = atom("C", 2, 0.80d, -0.41d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, south), new Bond(focus, west), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void doNotCreateCenterWhenWestIsOffCenter() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.8d); IAtom south = atom("C", 2, 0.80d, -0.41d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, north), new Bond(focus, south), new Bond(focus, west), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void doNotCreateCenterWhenNorthIsOffCenter() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 1d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.42d); IAtom south = atom("C", 2, 0.80d, -0.41d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, north), new Bond(focus, south), new Bond(focus, west), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void doNotCreateCenterWhenEastIsOffCenter() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.8d); IAtom south = atom("C", 2, 0.80d, -0.41d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, north), new Bond(focus, south), new Bond(focus, west), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void doNotCreateCenterWhenSouthIsOffCenter() { IAtom focus = atom("C", 0, 0.80d, 0.42d); IAtom north = atom("C", 0, 0.80d, 1.24d); IAtom east = atom("O", 1, 1.63d, 0.42d); IAtom south = atom("C", 2, 1d, -0.41d); IAtom west = atom("H", 0, -0.02d, 0.42d); IBond[] bonds = new IBond[]{ new Bond(focus, north), new Bond(focus, south), new Bond(focus, west), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }
@Test public void doNotCreateCenterWhenRotated() { IAtom focus = atom("C", 0, 0.44d, 3.30d); IAtom north = atom("C", 3, -0.16d, 3.86d); IAtom east = atom("O", 1, 1.00d, 3.90d); IAtom south = atom("C", 3, 1.05d, 2.74d); IAtom west = atom("H", 0, -0.12d, 2.70d); IBond[] bonds = new IBond[]{ new Bond(focus, west), new Bond(focus, north), new Bond(focus, south), new Bond(focus, east) }; ITetrahedralChirality element = FischerRecognition.newTetrahedralCenter(focus, bonds); Assert.assertNull(element); }