use of org.openscience.cdk.geometry.cip.CIPTool.CIP_CHIRALITY in project cdk by cdk.
the class CIPToolTest method testOla28.
@Test
public void testOla28() throws Exception {
String filename = "mol28.cml";
InputStream ins = this.getClass().getResourceAsStream(filename);
CMLReader reader = new CMLReader(ins);
IChemFile file = reader.read(new ChemFile());
reader.close();
IAtomContainer mol = ChemFileManipulator.getAllAtomContainers(file).get(0);
for (IAtom atom : mol.atoms()) {
List<IAtom> neighbors = mol.getConnectedAtomsList(atom);
if (neighbors.size() == 4) {
Stereo stereo = StereoTool.getStereo(neighbors.get(0), neighbors.get(1), neighbors.get(2), neighbors.get(3));
ITetrahedralChirality stereoCenter = new TetrahedralChirality(mol.getAtom(0), neighbors.toArray(new IAtom[] {}), stereo);
CIP_CHIRALITY chirality = CIPTool.getCIPChirality(mol, stereoCenter);
}
}
}
use of org.openscience.cdk.geometry.cip.CIPTool.CIP_CHIRALITY in project cdk by cdk.
the class CIPToolTest method testGetCIPChirality_Anti_ILigancyFourChirality.
@Test
public void testGetCIPChirality_Anti_ILigancyFourChirality() {
ILigand[] antiLigands = new ILigand[] { ligands[0], ligands[1], ligands[3], ligands[2] };
List<IAtom> ligandAtoms = new ArrayList<>();
for (ILigand ligand : antiLigands) ligandAtoms.add(ligand.getLigandAtom());
ITetrahedralChirality chirality = new TetrahedralChirality(molecule.getAtom(1), ligandAtoms.toArray(new IAtom[] {}), Stereo.ANTI_CLOCKWISE);
CIP_CHIRALITY rsChirality = CIPTool.getCIPChirality(molecule, chirality);
Assert.assertEquals(CIP_CHIRALITY.S, rsChirality);
}
use of org.openscience.cdk.geometry.cip.CIPTool.CIP_CHIRALITY in project cdk by cdk.
the class CIPToolTest method testGetCIPChirality.
@Test
public void testGetCIPChirality() {
LigancyFourChirality chirality = new LigancyFourChirality(molecule.getAtom(1), ligands, Stereo.CLOCKWISE);
CIP_CHIRALITY rsChirality = CIPTool.getCIPChirality(chirality);
Assert.assertEquals(CIP_CHIRALITY.S, rsChirality);
}
use of org.openscience.cdk.geometry.cip.CIPTool.CIP_CHIRALITY in project cdk by cdk.
the class CIPToolTest method testGetCIPChirality_DoubleBond_Opposite.
@Test
public void testGetCIPChirality_DoubleBond_Opposite() throws Exception {
IAtomContainer container = new SmilesParser(SilentChemObjectBuilder.getInstance()).parseSmiles("CCC(C)=C(C)CC");
CIP_CHIRALITY label = CIPTool.getCIPChirality(container, new DoubleBondStereochemistry(container.getBond(container.getAtom(2), container.getAtom(4)), new IBond[] { container.getBond(container.getAtom(2), container.getAtom(3)), container.getBond(container.getAtom(4), container.getAtom(6)) }, IDoubleBondStereochemistry.Conformation.OPPOSITE));
assertThat(label, is(CIPTool.CIP_CHIRALITY.Z));
}
use of org.openscience.cdk.geometry.cip.CIPTool.CIP_CHIRALITY in project cdk by cdk.
the class CIPToolTest method testGetCIPChirality_Anti.
@Test
public void testGetCIPChirality_Anti() {
ILigand[] antiLigands = new ILigand[] { ligands[0], ligands[1], ligands[3], ligands[2] };
LigancyFourChirality chirality = new LigancyFourChirality(molecule.getAtom(1), antiLigands, Stereo.ANTI_CLOCKWISE);
CIP_CHIRALITY rsChirality = CIPTool.getCIPChirality(chirality);
Assert.assertEquals(CIP_CHIRALITY.S, rsChirality);
}
Aggregations