On Saturday 23 June 2007, lunchbox99 wrote:
> When I try to calculate the H-bond donor count for a series of molecules, I
> get “zero” count for every molecule (where they are not zero).
>
> The code looks like this:
>
> HBondDonorCountDescriptor HBD = new HBondDonorCountDescriptor();
> DescriptorValue value = HBD.calculate(molecule);
> IDescriptorResult result = value.getValue();
> System.out.println(((IntegerResult)result).intValue());

The code from the JUnit test looks like:

IMolecularDescriptor descriptor = new HBondDonorCountDescriptor();
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer mol = sp.parseSmiles("Oc1ccccc1"); //
assertEquals(1, ((IntegerResult) 
descriptor.calculate(mol).getValue()).intValue());

I would say your code looks fine.

> If I calculate H-bond acceptors or rotatable bond count using the same
> basic idea, it works perfectly. I also tried the HBD calculator using the
> cdk knime workflow and got all zeros for that as well (so I’m inclined to
> think it’s not my code).  The “molecule” atom containers, which are read
> from sdf, can be converted to smiles and fingerprints generated so I think
> the molecules are OK.

I had a look at the source code, and it looks both at implicit hydrogens (as 
in the JUnit code), as well as explicit hydrogens (those that show up in the 
connection table).

> Has anyone tried the HBD count in cdk1.0? Am I doing the HBD count wrong in
> my code?

What might be the reason is that your input file does not have explicit 
hydrogens (always prefer explicit hydrogens), and neither has the implicit 
hydrogen field (set/getHydrogenCount) for the atoms set.

Please email the output of mol.toString()...

Egon


-- 
[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