Apologies,
Prematurely hit send.
I tried the calculation using the SmilesParser generated IMolecule and the
IMolecule generated from an sdf file .
Both of them never completed or threw an Exception when I ran the
engine.process().
I then tried the molecule glevec input as an sdf file in Rajarshis
descriptor calculation GUI (http://rguha.net/code/java/cdkdesc.html) . That
too kept suggesting its doing something but never created an output file
with the data. The GUI was able to calculate some simple descriptors like
Hbond donors and Hbond acceptors , but kept spinning and never returned or
threw an exception on the others.
The Descriptors that I particularly interested in are the Lpinskis rule of
five , h-bond donors and acceptors, Polar surface area TPSA
I will keep trying.
Thanks for your help this far
Hari
P.S My test molecule is Glevec
:
CC1=C(C=C(C=C1)NC(=O)C2=CC=C(C=C2)CN3CCN(CC3)C)NC4=NC=CC(=N4)C5=CN=CC=C5.CS(=O)(=O)O
On Mon, Feb 7, 2011 at 5:02 PM, hari jayaram <hari...@gmail.com> wrote:
> Hi Thomas,
> Thanks for your email . I did have the errors being caught in the next
> iteration . Any error caught would have been printed out using
> e.printstacktrace() , but the complex molecules like gleevec never threw an
> error at either the SMilesParser stage or the engine.process stage .
>
> For eg the code below never prints an error but still never completes
>
>
> On Mon, Feb 7, 2011 at 7:23 AM, Thomas Strunz <beginn...@hotmail.de>wrote:
>
>> Hi Hari,
>>
>> you are swallowing an expection:
>>
>>
>> > try {
>> > molecule = smilesParser.parseSmiles(smiles);
>> > System.out.println(molecule.toString());
>> > }
>> > catch (InvalidSmilesException e) {
>> > // TODO Auto-generated catch block
>> > }
>>
>> Where the TODO is, there is no code. So in case
>>
>> molecule = smilesParser.parseSmiles(smiles);
>>
>> fails due to smiles not being right (or CDK not being able to parse it),
>> you will never notice because you are catching the exception but not doing
>> anything about it (=swallowing an exception, use google).
>>
>> So a first simple "fix" would be to replace
>>
>>
>> // TODO Auto-generated catch block
>>
>> with
>>
>> e.printStackTrace();
>>
>>
>> Then if an error happens and I strongly assume that's the case, at least
>> you will be informed about it.
>> I also assume you actually never reach the line
>>
>> System.out.println(molecule.toString());
>>
>> in case of "not working molecules" like gleevec.
>> I can't however tell you how to make it work. maybe try using different
>> format like molfile?
>>
>> Regards,
>>
>> Thomas
>>
>>
>> > ----------------------------------------------------------------------
>> >
>> > Message: 1
>> > Date: Fri, 4 Feb 2011 17:28:44 -0500
>> > From: hari jayaram <hari...@gmail.com>
>> > Subject: [Cdk-user] Descriptor calculation help
>> > To: cdk-user@lists.sourceforge.net
>> > Message-ID:
>> > <aanlktimhy6a18penlnusw9_qcdb-yzrdxbxca3bvk...@mail.gmail.com>
>> > Content-Type: text/plain; charset="iso-8859-1"
>>
>> >
>> > Hi,
>> > I am very new to cdk and also new to java. I want to use cdk to
>> calculate
>> > molecular descriptors like LopgP, TPSA , Ring Count , Rotatable bonds
>> etc
>> > and am evaluating its pluggability into some existing java code .
>> >
>> > To learn the API I wrote a quick script to print the Descriptor names
>> and
>> > the calcuated values. It is very kludgy since I still think in "Python"
>> and
>> > "Scripting" ways. The script pasted below can get the calculation of the
>> > descriptors to work for a molecule like aspirin just fine, but when I
>> give
>> > it something more complex like gleevec, the code run from inside
>> netbeans
>> > keeps running without any output or error.
>> >
>> > Any suggestions on what I am doing thats causing this behavior.
>> >
>> > Thanks in advance
>> >
>> > Hari
>> >
>> > (Code adapted from Rajarshi Guhas snippets and a post on cdk mailing
>> list by
>> > Tobias)
>> >
>> > My quick example is pasted here ( also at http://dpaste.com/386138/)
>> >
>> > import java.util.Iterator;
>> > import java.util.Map;
>> >
>> > import org.openscience.cdk.exception.CDKException;
>> > import org.openscience.cdk.exception.InvalidSmilesException;
>> > import org.openscience.cdk.*;
>> > import org.openscience.cdk.smiles.*;
>> > import org.openscience.cdk.qsar.*;
>> > import org.openscience.cdk.qsar.DescriptorSpecification;
>> >
>> > public class MyDescriptorCalcExample {
>> > public static void main(String[] args){
>> > SmilesParser smilesParser = new
>> > SmilesParser(DefaultChemObjectBuilder.getInstance());
>> > String smiles =
>> >
>> "CC1=C(C=C(C=C1)NC(=O)C2=CC=C(C=C2)CN3CCN(CC3)C)NC4=NC=CC(=N4)C5=CN=CC=C5.CS(=O)(=O)O";
>> > String aspirin = "CC(=O)OC1=CC=CC=C1C(=O)O"
>> > DescriptorEngine engine = new
>> > DescriptorEngine(DescriptorEngine.MOLECULAR);
>> > org.openscience.cdk.interfaces.IMolecule molecule = null ;
>> > try {
>> > molecule = smilesParser.parseSmiles(smiles);
>> > System.out.println(molecule.toString());
>> > }
>> > catch (InvalidSmilesException e) {
>> > // TODO Auto-generated catch block
>> > }
>> > try {
>> > engine.process(molecule);
>> > }
>> > catch (CDKException e) {
>> > e.printStackTrace();
>> > // TODO Auto-generated catch block
>> > }
>> > Map<Object, Object> props = molecule.getProperties();
>> > Iterator<Object> iter = props.keySet().iterator();
>> > // for all calculated descriptors
>> > while (iter.hasNext()){
>> > DescriptorSpecification obj_key = (DescriptorSpecification)
>> > iter.next();
>> > // for debugging
>> > org.openscience.cdk.qsar.DescriptorValue val =
>> > (DescriptorValue) props.get(obj_key);
>> >
>> > System.out.print(obj_key.getImplementationTitle());
>> > System.out.println(" Value:" + val.getValue());
>> > }
>> > }
>> > }
>> > -------------- next part --------------
>> > An HTML attachment was scrubbed...
>> >
>> > ------------------------------
>> >
>> >
>> ------------------------------------------------------------------------------
>> > The modern datacenter depends on network connectivity to access
>> resources
>> > and provide services. The best practices for maximizing a physical
>> server's
>> > connectivity to a physical network are well understood - see how these
>> > rules translate into the virtual world?
>> > http://p.sf.net/sfu/oracle-sfdevnlfb
>> >
>> > ------------------------------
>> >
>> > _______________________________________________
>> > Cdk-user mailing list
>> > Cdk-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/cdk-user
>> >
>> >
>> > End of Cdk-user Digest, Vol 57, Issue 1
>> > ***************************************
>>
>>
>> ------------------------------------------------------------------------------
>> The modern datacenter depends on network connectivity to access resources
>> and provide services. The best practices for maximizing a physical
>> server's
>> connectivity to a physical network are well understood - see how these
>> rules translate into the virtual world?
>> http://p.sf.net/sfu/oracle-sfdevnlfb
>> _______________________________________________
>> Cdk-user mailing list
>> Cdk-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/cdk-user
>>
>>
>
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user