Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the Co(3+) atom type (fixes #3093644)

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
commit 67d56253cafb9f10c4b1d29cf561253e5bde905a 1 parent 740e4a5
@egonw egonw authored
View
4 src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
@@ -1234,6 +1234,10 @@ private IAtomType perceiveCommonSalts(IAtomContainer atomContainer, IAtom atom)
atom.getFormalCharge() == +2)) {
IAtomType type = getAtomType("Co.2plus");
if (isAcceptable(atom, atomContainer, type)) return type;
+ } else if ((atom.getFormalCharge() != CDKConstants.UNSET &&
+ atom.getFormalCharge() == +3)) {
+ IAtomType type = getAtomType("Co.3plus");
+ if (isAcceptable(atom, atomContainer, type)) return type;
} else if ((atom.getFormalCharge() == CDKConstants.UNSET ||
atom.getFormalCharge() == 0)) {
IAtomType type = getAtomType("Co.metallic");
View
7 src/main/org/openscience/cdk/dict/data/cdk-atom-types.owl
@@ -1227,6 +1227,13 @@
<at:piBondCount>0</at:piBondCount>
</at:AtomType>
+ <at:AtomType rdf:ID="Co.3plus">
+ <at:formalCharge>3</at:formalCharge>
+ <at:hasElement rdf:resource="&elem;Co"/>
+ <at:formalNeighbourCount>0</at:formalNeighbourCount>
+ <at:piBondCount>0</at:piBondCount>
+ </at:AtomType>
+
<at:AtomType rdf:ID="Co.metallic">
<at:formalCharge>0</at:formalCharge>
<at:hasElement rdf:resource="&elem;Co"/>
View
19 src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherSMILESTest.java
@@ -108,7 +108,24 @@
Assert.assertNotNull(type.getAtomTypeName());
}
}
-
+
+ /**
+ * @cdk.bug 3093644
+ */
+ @Test public void testBug3093644() throws Exception {
+ String smiles1 =
+ "[H]C5(CCC(N)=O)(C=1N=C(C=C4N=C(C(C)=C3[N-]C(C)(C2N=C(C=1(C))C(C)" +
+ "(CCC(=O)NCC(C)O)C2([H])(CC(N)=O))C(C)(CC(N)=O)C3([H])(CCC(N)=O))" +
+ "C(C)(CC(N)=O)C4([H])(CCC(N)=O))C5(C)(C)).[H][C-]([H])C3([H])(OC([H])" +
+ "(N2C=NC=1C(N)=NC=NC=12)C([H])(O)C3([H])(O)).[Co+3]";
+
+ IMolecule mol1 = smilesParser.parseSmiles(smiles1);
+ IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
+ for (IAtomType type : types1) {
+ Assert.assertNotNull(type.getAtomTypeName());
+ }
+ }
+
@Test public void testPlatinum4() throws Exception {
String smiles1 = "Cl[Pt]1(Cl)(Cl)(Cl)NC2CCCCC2N1";
View
13 src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
@@ -1,7 +1,5 @@
-/* $Revision$ $Author$ $Date$
- *
- * Copyright (C) 2007 Egon Willighagen <egonw@users.sf.net>
- * 2007 Rajarshi Guha
+/* Copyright (C) 2007-2011 Egon Willighagen <egonw@users.sf.net>
+ * 2007 Rajarshi Guha
*
* Contact: cdk-devel@lists.sourceforge.net
*
@@ -1623,6 +1621,13 @@ public void testTetrahydropyran() throws Exception {
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
mol = new Molecule();
+ atom = new Atom("Co");
+ atom.setFormalCharge(+3);
+ mol.addAtom(atom);
+ expectedTypes = new String[]{"Co.3plus"};
+ assertAtomTypes(testedAtomTypes, expectedTypes, mol);
+
+ mol = new Molecule();
atom = new Atom("Cu");
atom.setFormalCharge(+2);
mol.addAtom(atom);
Please sign in to comment.
Something went wrong with that request. Please try again.