Skip to content

Commit

Permalink
Renamed the ligancy classes to use the term tetrahedral since they im…
Browse files Browse the repository at this point in the history
…plicitly encode for tetrahedral chirality

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
rajarshi authored and egonw committed May 24, 2010
1 parent b8110ae commit 3043c17
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 185 deletions.
65 changes: 0 additions & 65 deletions src/main/org/openscience/cdk/interfaces/ILigancyFourChirality.java

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/org/openscience/cdk/smiles/SmilesParser.java
Expand Up @@ -44,15 +44,15 @@
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.ILigancyFourChirality;
import org.openscience.cdk.interfaces.ITetrahedralChirality;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IPseudoAtom;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IAtomType.Hybridization;
import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.interfaces.ILigancyFourChirality.Stereo;
import org.openscience.cdk.stereo.LigancyFourChirality;
import org.openscience.cdk.interfaces.ITetrahedralChirality.Stereo;
import org.openscience.cdk.stereo.TetrahedralChirality;
import org.openscience.cdk.tools.CDKHydrogenAdder;
import org.openscience.cdk.tools.ILoggingTool;
import org.openscience.cdk.tools.LoggingToolFactory;
Expand Down Expand Up @@ -233,7 +233,7 @@ public IMolecule parseSmiles(String smiles) throws InvalidSmilesException {
TemporaryChiralityStorage chirality = chiralityInfo.get(atom);
logger.debug("Chiral atom found: ", atom);
IAtom[] atoms = chirality.atoms;
ILigancyFourChirality l4Chiral = new LigancyFourChirality(
ITetrahedralChirality l4Chiral = new TetrahedralChirality(
atom,
new IAtom[]{
atoms[0], atoms[1], atoms[2], atoms[3]
Expand Down
83 changes: 0 additions & 83 deletions src/main/org/openscience/cdk/stereo/LigancyFourChirality.java

This file was deleted.

52 changes: 26 additions & 26 deletions src/test/org/openscience/cdk/smiles/SmilesParserTest.java
Expand Up @@ -39,13 +39,13 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.ILigancyFourChirality;
import org.openscience.cdk.interfaces.ITetrahedralChirality;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IMoleculeSet;
import org.openscience.cdk.interfaces.IPseudoAtom;
import org.openscience.cdk.interfaces.IReaction;
import org.openscience.cdk.interfaces.IStereoElement;
import org.openscience.cdk.interfaces.ILigancyFourChirality.Stereo;
import org.openscience.cdk.interfaces.ITetrahedralChirality.Stereo;
import org.openscience.cdk.isomorphism.IsomorphismTester;
import org.openscience.cdk.isomorphism.UniversalIsomorphismTester;
import org.openscience.cdk.layout.StructureDiagramGenerator;
Expand Down Expand Up @@ -1872,8 +1872,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -1896,8 +1896,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -1915,8 +1915,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -1934,8 +1934,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand Down Expand Up @@ -1965,8 +1965,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -1985,8 +1985,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -1999,8 +1999,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -2019,8 +2019,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -2038,8 +2038,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -2057,8 +2057,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -2076,8 +2076,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
IAtom[] ligands = l4Chiral.getLigands();
for (IAtom atom : ligands) Assert.assertNotNull(atom);
Expand All @@ -2096,8 +2096,8 @@ public void testAromaticity() throws InvalidSmilesException{
Assert.assertTrue(stereoElements.hasNext());
IStereoElement stereoElement = stereoElements.next();
Assert.assertNotNull(stereoElement);
Assert.assertTrue(stereoElement instanceof ILigancyFourChirality);
ILigancyFourChirality l4Chiral = (ILigancyFourChirality)stereoElement;
Assert.assertTrue(stereoElement instanceof ITetrahedralChirality);
ITetrahedralChirality l4Chiral = (ITetrahedralChirality)stereoElement;
Assert.assertEquals("C", l4Chiral.getChiralAtom().getSymbol());
if (l4Chiral.getStereo() == Stereo.CLOCKWISE) {
IAtom[] ligands = l4Chiral.getLigands();
Expand Down
Expand Up @@ -32,7 +32,7 @@
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.interfaces.ILigancyFourChirality.Stereo;
import org.openscience.cdk.interfaces.ITetrahedralChirality.Stereo;

/**
* @cdk.module test-data
Expand Down Expand Up @@ -64,15 +64,15 @@ public static void setup() throws Exception {

@Test
public void testLigancyFourChirality_IAtom_arrayIAtom_ILigancyFourChirality_STEREO() {
LigancyFourChirality chirality = new LigancyFourChirality(
TetrahedralChirality chirality = new TetrahedralChirality(
molecule.getAtom(1), ligands, Stereo.CLOCKWISE
);
Assert.assertNotNull(chirality);
}

@Test
public void testGetBuilder() {
LigancyFourChirality chirality = new LigancyFourChirality(
TetrahedralChirality chirality = new TetrahedralChirality(
molecule.getAtom(1), ligands, Stereo.CLOCKWISE
);
Assert.assertEquals(
Expand All @@ -83,7 +83,7 @@ public void testGetBuilder() {

@Test
public void testGetChiralAtom() {
LigancyFourChirality chirality = new LigancyFourChirality(
TetrahedralChirality chirality = new TetrahedralChirality(
molecule.getAtom(1), ligands, Stereo.CLOCKWISE
);
Assert.assertNotNull(chirality);
Expand All @@ -92,20 +92,20 @@ public void testGetChiralAtom() {

@Test
public void testGetStereo() {
LigancyFourChirality chirality = new LigancyFourChirality(
TetrahedralChirality chirality = new TetrahedralChirality(
molecule.getAtom(1), ligands, Stereo.CLOCKWISE
);
Assert.assertNotNull(chirality);
Assert.assertEquals(molecule.getAtom(1), chirality.getChiralAtom());
for (int i=0; i<ligands.length; i++) {
Assert.assertEquals(ligands[i], chirality.getLigands()[i]);
}
Assert.assertEquals(LigancyFourChirality.Stereo.CLOCKWISE, chirality.getStereo());
Assert.assertEquals(TetrahedralChirality.Stereo.CLOCKWISE, chirality.getStereo());
}

@Test
public void testGetLigandAtoms() {
LigancyFourChirality chirality = new LigancyFourChirality(
TetrahedralChirality chirality = new TetrahedralChirality(
molecule.getAtom(1), ligands, Stereo.CLOCKWISE
);
Assert.assertNotNull(chirality);
Expand Down

0 comments on commit 3043c17

Please sign in to comment.