> Can anyone give me a simple snippet of code to calculate molecular 
> desciptors e.g. 4SP3

IMolecularDescriptor d = ...
IAtomContainer ac = ...
DescriptorValue dv = d.calculate(ac);
IDescriptorResult result = dv.getValue();

> and how you generate a list of all the 
> descriptors avaialble ?

get all (molecular) descriptors:

DescriptorEngine engine = new
    DescriptorEngine(DescriptorEngine.MOLECULAR, null);
List<IMolecularDescriptor> descriptors =
    engine.getDescriptorInstances();

there are different IDescriptorResult types and they have different 
methods for accessing the final numerical values. So if you get all 
descriptors in a list and process them in a loop, you have to 
distinguish between the result types like this:

if (result instanceof IntegerResult) {
    // ((IntegerResult) result).intValue();
} else if (result instanceof DoubleResult) {
    // ((DoubleResult) result).doubleValue();
} else if (...
    ... and so on


Regards,
Thomas


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

Reply via email to