@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); }
m.addAtom(atom("C", 0, 0.80d, 1.24d)); m.addAtom(atom("C", 1, 0.80d, 0.42d)); m.addAtom(atom("O", 1, 0.09d, 1.66d)); m.addAtom(atom("O", 0, 1.52d, 1.66d)); m.addAtom(atom("O", 1, 1.63d, 0.42d)); m.addAtom(atom("C", 2, 0.80d, -0.41d)); m.addAtom(atom("O", 1, 1.52d, -0.82d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(0, 2, IBond.Order.SINGLE); List<IStereoElement> elements = recogniser.recognise(Collections.singleton(Projection.Fischer)); Assert.assertThat(elements.size(), is(1)); assertTetrahedralCenter(elements.get(0), m.getAtom(1), ANTI_CLOCKWISE,
m.addAtom(atom("C", 0, 0.80d, 1.24d)); m.addAtom(atom("C", 0, 0.80d, 0.42d)); m.addAtom(atom("O", 1, 0.09d, 1.66d)); m.addAtom(atom("O", 0, 1.52d, 1.66d)); m.addAtom(atom("O", 0, -0.02d, 0.42d)); m.addAtom(atom("C", 2, 0.80d, -0.41d)); m.addAtom(atom("H", 1, 1.63d, 0.42d)); m.addAtom(atom("O", 1, 1.52d, -0.82d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(0, 2, IBond.Order.SINGLE); List<IStereoElement> elements = recogniser.recognise(Collections.singleton(Projection.Fischer)); Assert.assertThat(elements.size(), is(1)); assertTetrahedralCenter(elements.get(0), m.getAtom(1), ANTI_CLOCKWISE,
m.addAtom(atom("C", 0, 0.80d, 1.24d)); m.addAtom(atom("C", 0, 0.80d, 0.42d)); m.addAtom(atom("O", 1, 0.09d, 1.66d)); m.addAtom(atom("O", 0, 1.52d, 1.66d)); m.addAtom(atom("O", 1, 1.63d, 0.42d)); m.addAtom(atom("C", 2, 0.80d, -0.41d)); m.addAtom(atom("H", 0, -0.02d, 0.42d)); m.addAtom(atom("O", 1, 1.52d, -0.82d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(0, 2, IBond.Order.SINGLE); List<IStereoElement> elements = recogniser.recognise(Collections.singleton(Projection.Fischer)); Assert.assertThat(elements.size(), is(1)); assertTetrahedralCenter(elements.get(0), m.getAtom(1), ANTI_CLOCKWISE,
@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); }
m.addAtom(atom("C", 2, -0.53d, 6.25d)); m.addAtom(atom("C", 1, -0.53d, 5.42d)); m.addAtom(atom("O", 1, 0.18d, 6.66d)); m.addAtom(atom("O", 1, -1.36d, 5.42d)); m.addAtom(atom("C", 1, -0.53d, 4.60d)); m.addAtom(atom("O", 1, -1.36d, 4.60d)); m.addAtom(atom("C", 1, -0.53d, 3.77d)); m.addAtom(atom("O", 1, 0.29d, 3.77d)); m.addAtom(atom("C", 1, -0.53d, 2.95d)); m.addAtom(atom("O", 1, 0.29d, 2.95d)); m.addAtom(atom("C", 2, -0.53d, 2.12d)); m.addAtom(atom("O", 1, 0.05d, 1.54d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(0, 2, IBond.Order.SINGLE); assertTetrahedralCenter(elements.get(0), m.getAtom(1), ANTI_CLOCKWISE, m.getAtom(0), m.getAtom(1), m.getAtom(4), m.getAtom(3)); assertTetrahedralCenter(elements.get(1), m.getAtom(4), ANTI_CLOCKWISE, m.getAtom(1), m.getAtom(4), m.getAtom(6), m.getAtom(5)); assertTetrahedralCenter(elements.get(2), m.getAtom(6), ANTI_CLOCKWISE, m.getAtom(4), m.getAtom(7), m.getAtom(8), m.getAtom(6)); assertTetrahedralCenter(elements.get(3), m.getAtom(8),
@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 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 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); }
@Test public void obtainCardinalBonds() { 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[] expected = new IBond[]{ new Bond(focus, north), new Bond(focus, east), new Bond(focus, south), new Bond(focus, west) }; IBond[] actual = FischerRecognition.cardinalBonds(focus, new IBond[]{expected[1], expected[2], expected[3], expected[0]} ); Assert.assertThat(expected, is(actual)); }
/** * In reality, bonds may not be perfectly orthogonal. Here the N, E, S, and * W atoms are all slightly offset from the focus. */ @Test public void obtainNonPerfectCardinalBonds() { IAtom focus = atom("C", 0, -0.40d, 3.37d); IAtom north = atom("C", 0, -0.43d, 4.18d); IAtom east = atom("O", 1, 0.44d, 3.33d); IAtom south = atom("C", 2, -0.42d, 2.65d); IAtom west = atom("H", 0, -1.21d, 3.36d); IBond[] expected = new IBond[]{ new Bond(focus, north), new Bond(focus, east), new Bond(focus, south), new Bond(focus, west) }; IBond[] actual = FischerRecognition.cardinalBonds(focus, new IBond[]{expected[1], expected[2], expected[3], expected[0]} ); Assert.assertThat(expected, is(actual)); }
@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))); }
m.addAtom(atom("C", 0, 12.71d, -16.51d)); m.addAtom(atom("C", 1, 12.30d, -17.22d)); m.addAtom(atom("C", 1, 11.47d, -17.22d)); m.addAtom(atom("C", 1, 11.06d, -16.51d)); m.addAtom(atom("C", 1, 11.47d, -15.79d)); m.addAtom(atom("C", 1, 12.30d, -15.79d)); m.addAtom(atom("O", 1, 13.54d, -17.33d)); m.addAtom(atom("C", 0, 13.54d, -16.51d)); m.addAtom(atom("C", 0, 14.36d, -16.51d)); m.addAtom(atom("O", 1, 14.77d, -17.22d)); m.addAtom(atom("O", 0, 14.77d, -15.79d)); m.addAtom(atom("C", 3, 13.54d, -15.68d)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(0, 5, IBond.Order.DOUBLE, IBond.Stereo.E_Z_BY_COORDINATES);
@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))); }
m.addAtom(atom("C", 0, 6.87d, -5.59d)); m.addAtom(atom("C", 0, 6.87d, -6.61d)); m.addAtom(atom("C", 0, 7.82d, -5.62d)); m.addAtom(atom("C", 0, 6.87d, -4.59d)); m.addAtom(atom("O", 0, 8.18d, -6.34d)); m.addAtom(atom("C", 0, 7.62d, -6.91d)); m.addAtom(atom("C", 0, 5.90d, -5.59d)); m.addAtom(atom("C", 0, 8.39d, -5.06d)); m.addAtom(atom("C", 0, 5.60d, -4.80d)); m.addAtom(atom("C", 2, 6.16d, -4.24d)); m.addAtom(atom("O", 0, 8.22d, -4.29d)); m.addAtom(atom("C", 2, 6.10d, -6.90d)); m.addAtom(atom("C", 2, 5.54d, -6.29d)); m.addAtom(atom("C", 2, 7.46d, -4.07d)); m.addAtom(atom("O", 0, 7.79d, -7.72d)); m.addAtom(atom("O", 0, 9.18d, -5.29d)); m.addAtom(atom("O", 1, 6.87d, -7.44d)); m.addAtom(atom("C", 3, 6.76d, -3.77d)); m.addAtom(atom("C", 3, 4.82d, -5.07d)); m.addAtom(atom("C", 3, 5.19d, -4.08d)); m.addAtom(atom("H", 0, 8.64d, -5.76d)); m.addAtom(atom("H", 0, 5.08d, -5.69d)); m.addBond(1, 0, IBond.Order.SINGLE); m.addBond(0, 2, IBond.Order.SINGLE);