Hello all, > > Say I want to calculate a number of molecular descriptors through the > implementations provided by CDK. > > However, I want to have the freedom to specify externally (outside the code) > which descriptors I want to calculate, i.e. inĀ a file provided by the user. > Is there a flexible and extensible way to point to a descriptor > implementation, without the obvious option to map pre-defined keywords to > the descriptor? >
I was struggling with a similar problem not much time ago. I wanted to solve it in an open way (so that the solution would apply to CDK as well as to other descriptor calculation software), so I went to the BlueObelisk-discuss mailing list: http://sourceforge.net/mailarchive/message.php?msg_id=28614414 > Is the DescriptorSpecification of any help to this, or is this rather a type > that provides output rather than an identifier of the descriptor? > You need to be able to identify the CDK class behind the IDescriptor/IMolecularDescriptor interface. To make things worse, some CDK descriptor classes are array-valued (ie. invoking IMolecularDescriptor#calculate(IMolecule) gives you multiple values, not just single value), so you need an additional array-indexing mechanism on top of that. My solution was to go with a YAML-based microformat. Every descriptor instance is defined in its own file. So, if you need to calculate more descriptors you move those descriptor definition files to the "active descriptor definitions"-directory, if you need to calculate less descriptors, you move those files away from that directory. The source code of my solution is publicly available at the QsarDB project site: http://qsardb.googlecode.com/svn/trunk/qsardb-tools/cargo/bodo/ Most of the heavy-lifting takes place in BODOUtil (BODO stands for "Blue Obelisk Descriptor Ontology"): http://qsardb.googlecode.com/svn/trunk/qsardb-tools/cargo/bodo/src/main/java/org/openscience/cdk/qsar/BODOUtil.java VR ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

