On Tuesday 29 May 2007, Stefan Kuhn wrote:
> On Tuesday 29 May 2007 12:39, Andreas Schüller wrote:
> > I've filed the HydrogenAdder problem with carbocations as a bug report.
>
> And I made a test case for it.

Even better! :)

Now, the test is interesting... it uses the default HydrogenAdder, which uses 
the SaturationChecker in the background, which uses the structgen atom type 
list, which does NOT contain charged atom types :)

So, make sure to move the test to HydrogenAdder2Test.

Yes, I know this is rather unintuitive! It's historical, nothing logic about 
this. Here's the deal:

CDK has three custom atom type lists:

- structgen: only for uncharged species, with hybridization information
- valency: with charged atoms, but without hybridization info
- hybridization: with charged, with hybrid info

The first is used/useful in combination with structure generation. The second 
was later added to support charged molecules. The last was even added later 
than that, for help of the SMILES parser, which sometimes hydrogen counts can 
only be derived using hybridization information from the SMILES string.
Basically, the first should be a subset of the second, which is a subset of 
the third. Historically, at least.

I will add information to the JavaDoc of the HydrogenAdder about how to get 
a 'proper' HydrogenAdder right now.

If you wonder why the default in the HAdder never was made the third atom type 
list, you might consider that that might very well break things. In other 
words, binary compatibility.

Egon

PS. only after seeing the test, I got an idea what might be going wrong in the 
problem reported... it might not be the define solution to the problem, but 
writing a JUnit test at least got the ball rolling...

-- 
[EMAIL PROTECTED]
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to