From: <eg...@us...> - 2007-10-23 08:04:30
|
Revision: 9176 http://cdk.svn.sourceforge.net/cdk/?rev=9176&view=rev Author: egonw Date: 2007-10-23 01:04:29 -0700 (Tue, 23 Oct 2007) Log Message: ----------- Fixed detection of [cH+] atom types (sp2 but charged) Modified Paths: -------------- trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java Modified: trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java 2007-10-23 08:03:49 UTC (rev 9175) +++ trunk/cdk/src/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java 2007-10-23 08:04:29 UTC (rev 9176) @@ -90,7 +90,8 @@ throws CDKException { if ("C".equals(atom.getSymbol())) { // if hybridization is given, use that - if (atom.getHybridization() != CDKConstants.UNSET) { + if (atom.getHybridization() != CDKConstants.UNSET && + (atom.getFormalCharge() == CDKConstants.UNSET || atom.getFormalCharge() == 0)) { if (atom.getHybridization() == CDKConstants.HYBRIDIZATION_SP2) { return factory.getAtomType("C.sp2"); } else if (atom.getHybridization() == CDKConstants.HYBRIDIZATION_SP3) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |