Hi all,
please find below the 9000th commit to the CDK subversion repository.
A very nice milestone I think. Thanx to all those 50+ developers who
have made this milestone possible!
Egon
---------- Forwarded message ----------
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Oct 1, 2007 10:29 AM
Subject: [Cdk-commits] SF.net SVN: cdk: [9000] trunk/cdk/src/org/openscience/cdk
To: [EMAIL PROTECTED]
Revision: 9000
http://cdk.svn.sourceforge.net/cdk/?rev=9000&view=rev
Author: egonw
Date: 2007-10-01 01:29:13 -0700 (Mon, 01 Oct 2007)
Log Message:
-----------
Added oxide atom '[O--]' type.
Modified Paths:
--------------
trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
trunk/cdk/src/org/openscience/cdk/config/data/cdk_atomtypes.xml
trunk/cdk/src/org/openscience/cdk/test/atomtype/CDKAtomTypeMatcherTest.java
Modified: trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
===================================================================
--- trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
2007-10-01 07:59:54 UTC (rev 8999)
+++ trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
2007-10-01 08:29:13 UTC (rev 9000)
@@ -151,8 +151,12 @@
}
} else if (atom.getFormalCharge() != CDKConstants.UNSET &&
atom.getFormalCharge() != 0) {
- if (atom.getFormalCharge() == -1) {
+ if (atom.getFormalCharge() == -1 &&
+
atomContainer.getConnectedAtomsCount(atom) <= 1) {
return factory.getAtomType("O.minus");
+ } else if (atom.getFormalCharge() == -2 &&
+
atomContainer.getConnectedAtomsCount(atom) == 0) {
+ return factory.getAtomType("O.minus2");
} else if (atom.getFormalCharge() == +1) {
if
(atomContainer.getConnectedBondsCount(atom) == 0) {
return factory.getAtomType("O.plus");
Modified: trunk/cdk/src/org/openscience/cdk/config/data/cdk_atomtypes.xml
===================================================================
--- trunk/cdk/src/org/openscience/cdk/config/data/cdk_atomtypes.xml
2007-10-01 07:59:54 UTC (rev 8999)
+++ trunk/cdk/src/org/openscience/cdk/config/data/cdk_atomtypes.xml
2007-10-01 08:29:13 UTC (rev 9000)
@@ -116,6 +116,15 @@
<scalar dataType="xsd:string" dictRef="cdk:hybridization">sp3</scalar>
</atomType>
+ <atomType id="O.minus2">
+ <atom elementType="O" formalCharge="-2">
+ <scalar dataType="xsd:integer"
dictRef="cdk:formalNeighbourCount">0</scalar>
+ <scalar dataType="xsd:integer" dictRef="cdk:lonePairCount">4</scalar>
+ <scalar dataType="xsd:integer" dictRef="cdk:piBondCount">0</scalar>
+ </atom>
+ <scalar dataType="xsd:string" dictRef="cdk:hybridization">sp3</scalar>
+ </atomType>
+
<atomType id="N.sp3">
<atom elementType="N" formalCharge="0">
<scalar dataType="xsd:integer"
dictRef="cdk:formalNeighbourCount">3</scalar>
Modified:
trunk/cdk/src/org/openscience/cdk/test/atomtype/CDKAtomTypeMatcherTest.java
===================================================================
--- trunk/cdk/src/org/openscience/cdk/test/atomtype/CDKAtomTypeMatcherTest.java
2007-10-01 07:59:54 UTC (rev 8999)
+++ trunk/cdk/src/org/openscience/cdk/test/atomtype/CDKAtomTypeMatcherTest.java
2007-10-01 08:29:13 UTC (rev 9000)
@@ -738,6 +738,15 @@
assertAtomType(testedAtomTypes, "O.sp2",
atm.findMatchingAtomType(mol, atom4));
}
+ @Test public void testOxide() throws Exception {
+ IMolecule mol = new Molecule();
+ IAtom atom = new Atom("O"); atom.setFormalCharge(-2);
+ mol.addAtom(atom);
+
+ CDKAtomTypeMatcher atm =
CDKAtomTypeMatcher.getInstance(mol.getBuilder());
+ assertAtomType(testedAtomTypes, "O.minus2",
atm.findMatchingAtomType(mol, atom));
+ }
+
@Test public void testStructGenMatcher() throws Exception {
CDKAtomTypeMatcher matcher =
CDKAtomTypeMatcher.getInstance(DefaultChemObjectBuilder.getInstance());
Assert.assertNotNull(matcher);
--
----
http://chem-bla-ics.blogspot.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user