use of org.openscience.cdk.silent.Bond in project cdk by cdk.
the class FischerRecognitionTest method doNotCreateCenterWhenWestIsOffCenter.
@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);
}
use of org.openscience.cdk.silent.Bond in project cdk by cdk.
the class FischerRecognitionTest method doNotCreateCenterWhenNorthIsMissing.
@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);
}
use of org.openscience.cdk.silent.Bond in project cdk by cdk.
the class ShortestPathsTest method simple.
/**
* 2,2-dimethylpropane
*/
private static IAtomContainer simple() {
IAtomContainer container = new AtomContainer();
IAtom a = new Atom("C");
IAtom b = new Atom("C");
IAtom c = new Atom("C");
IAtom d = new Atom("C");
IAtom e = new Atom("C");
IBond ab = new Bond(a, b);
IBond bc = new Bond(b, c);
IBond cd = new Bond(c, d);
IBond be = new Bond(b, e);
container.addAtom(a);
container.addAtom(b);
container.addAtom(c);
container.addAtom(d);
container.addAtom(e);
container.addBond(ab);
container.addBond(bc);
container.addBond(cd);
container.addBond(be);
return container;
}
use of org.openscience.cdk.silent.Bond in project cdk by cdk.
the class CDKToBeamTest method unsetBondOrder.
@SuppressWarnings("unchecked")
@Test(expected = CDKException.class)
public void unsetBondOrder() throws Exception {
IAtom u = mock(IAtom.class);
IAtom v = mock(IAtom.class);
IBond b = new Bond(u, v, IBond.Order.UNSET);
Map<IAtom, Integer> mock = mock(Map.class);
when(mock.get(u)).thenReturn(0);
when(mock.get(v)).thenReturn(1);
new CDKToBeam().toBeamEdge(b, mock);
}
use of org.openscience.cdk.silent.Bond in project cdk by cdk.
the class CDKToBeamTest method tripleBond.
@SuppressWarnings("unchecked")
@Test
public void tripleBond() throws Exception {
IAtom u = mock(IAtom.class);
IAtom v = mock(IAtom.class);
IBond b = new Bond(u, v, IBond.Order.TRIPLE);
Map<IAtom, Integer> mock = mock(Map.class);
when(mock.get(u)).thenReturn(0);
when(mock.get(v)).thenReturn(1);
CDKToBeam c2g = new CDKToBeam();
assertThat(c2g.toBeamEdge(b, mock), is(uk.ac.ebi.beam.Bond.TRIPLE.edge(0, 1)));
}
Aggregations