Skip to content

Commit

Permalink
Added four and six coordinate neutral platinum atom types.
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Mar 28, 2010
1 parent 6fcc3d0 commit 407d793
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
Expand Up @@ -1245,6 +1245,16 @@ private IAtomType perceiveCommonSalts(IAtomContainer atomContainer, IAtom atom)
atom.getFormalCharge() == +2)) {
IAtomType type = getAtomType("Pt.2plus");
if (isAcceptable(atom, atomContainer, type)) return type;
} else if ((atom.getFormalCharge() == CDKConstants.UNSET ||
atom.getFormalCharge() == 0)) {
int neighbors = atomContainer.getConnectedAtomsCount(atom);
if (neighbors == 4) {
IAtomType type = getAtomType("Pt.4");
if (isAcceptable(atom, atomContainer, type)) return type;
} else if (neighbors == 6) {
IAtomType type = getAtomType("Pt.6");
if (isAcceptable(atom, atomContainer, type)) return type;
}
}
} else if ("Ni".equals(atom.getSymbol())) {
if (hasOneSingleElectron(atomContainer, atom)) {
Expand Down
16 changes: 15 additions & 1 deletion src/main/org/openscience/cdk/dict/data/cdk-atom-types.owl
Expand Up @@ -1177,7 +1177,21 @@
<at:hasElement rdf:resource="&elem;Pt"/>
<at:formalNeighbourCount>0</at:formalNeighbourCount>
<at:piBondCount>0</at:piBondCount>
</at:AtomType>
</at:AtomType>

<at:AtomType rdf:ID="Pt.4">
<at:formalCharge>0</at:formalCharge>
<at:hasElement rdf:resource="&elem;Pt"/>
<at:formalNeighbourCount>4</at:formalNeighbourCount>
<at:piBondCount>0</at:piBondCount>
</at:AtomType>

<at:AtomType rdf:ID="Pt.6">
<at:formalCharge>0</at:formalCharge>
<at:hasElement rdf:resource="&elem;Pt"/>
<at:formalNeighbourCount>6</at:formalNeighbourCount>
<at:piBondCount>0</at:piBondCount>
</at:AtomType>

<at:AtomType rdf:ID="Co.2plus">
<at:formalCharge>2</at:formalCharge>
Expand Down
Expand Up @@ -94,4 +94,21 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
Assert.assertNotNull(type.getAtomTypeName());
}
}

@Test public void testPlatinum4() throws Exception {
String smiles1 = "Cl[Pt]1(Cl)(Cl)(Cl)NC2CCCCC2N1";

IMolecule mol1 = smilesParser.parseSmiles(smiles1);
Assert.assertEquals(13, mol1.getAtomCount());
Assert.assertEquals("Pt.6", mol1.getAtom(1).getAtomTypeName());
}

@Test public void testPlatinum6() throws Exception {
String smiles1 = "[Pt](Cl)(Cl)(N)N";

IMolecule mol1 = smilesParser.parseSmiles(smiles1);
Assert.assertEquals(5, mol1.getAtomCount());
Assert.assertEquals("Pt.4", mol1.getAtom(0).getAtomTypeName());
}

}
26 changes: 26 additions & 0 deletions src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
Expand Up @@ -3151,6 +3151,32 @@ public void testNOxide() throws Exception {
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test public void testPlatinumFourCoordinate() throws Exception {
IMolecule mol = new Molecule();
mol.addAtom(new Atom("Pt"));
mol.addAtom(new Atom("Cl")); mol.addBond(0,1,IBond.Order.SINGLE);
mol.addAtom(new Atom("Cl")); mol.addBond(0,2,IBond.Order.SINGLE);
mol.addAtom(new Atom("Cl")); mol.addBond(0,3,IBond.Order.SINGLE);
mol.addAtom(new Atom("Cl")); mol.addBond(0,4,IBond.Order.SINGLE);

String[] expectedTypes = {"Pt.4", "Cl", "Cl", "Cl", "Cl"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test public void testPlatinumSixCoordinate() throws Exception {
IMolecule mol = new Molecule();
mol.addAtom(new Atom("Pt"));
mol.addAtom(new Atom("Cl")); mol.addBond(0,1,IBond.Order.SINGLE);
mol.addAtom(new Atom("Cl")); mol.addBond(0,2,IBond.Order.SINGLE);
mol.addAtom(new Atom("Cl")); mol.addBond(0,3,IBond.Order.SINGLE);
mol.addAtom(new Atom("Cl")); mol.addBond(0,4,IBond.Order.SINGLE);
mol.addAtom(new Atom("O")); mol.addBond(0,5,IBond.Order.SINGLE);
mol.addAtom(new Atom("O")); mol.addBond(0,6,IBond.Order.SINGLE);

String[] expectedTypes = {"Pt.6", "Cl", "Cl", "Cl", "Cl", "O.sp3", "O.sp3"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

/**
* @cdk.bug 2424511
*/
Expand Down

0 comments on commit 407d793

Please sign in to comment.