Hi,
 
I am trying to calculate molecular descriptor using CDK.
I have compiled CDK from svn using JDK5.0. I have added to JDK/jre/lib/ext/jgrapht-jdk1.5.jar, Jama-1.0.2.jar.
 
I am able to compile the code. But while executing the code am getting following error.
 
Any help will be greatly appreciated.
 

Om Prakash
Research Student,
Bioinformatics Center
University of Pune
Pune-411007
India
-------------------------------------------------------------------------
C:\>javac Desc.java
C:\>java Desc
Exception in thread "main" java.lang.NoClassDefFoundError: org/_3pq/jgrapht/UndirectedGraph
at org.openscience.cdk.ringsearch.AllRingsFinder.findAllRings(AllRingsFinder.java:134)
at org.openscience.cdk.ringsearch.AllRingsFinder.findAllRings(AllRingsFinder.java:100)
at org.openscience.cdk.qsar.descriptors.molecular.RotatableBondsCountDescriptor.calculate(RotatableBondsCountDescriptor.java:138)
at Desc.main(Desc.java:49)
-------------------------------------------------------------
 
Code
-------------------------------------------------------------
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.*;
import org.openscience.cdk.qsar.*;
import org.openscience.cdk.qsar.descriptors.molecular.*;
import org.openscience.cdk.interfaces.IChemObjectBuilder ;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.iterator.*;
import org.openscience.cdk.qsar.result.*;
//import org.openscience.cdk.ringsearch.* ;
//import org._3pq.jgrapht.*;

import java.io.*;
import java.util.*;

class Desc

{
 
  public static void main(String[] args) throws CDKException
  {
   
   BufferedReader sdfile=null;
 
   try
   {
    sdfile= new BufferedReader (new FileReader(new File("C:/1.sdf")));
   }
   
   catch (FileNotFoundException e) {
   System.err.println("File not found");
   System.exit(1);
   }
 
   IteratingMDLReader myiter = new IteratingMDLReader sdfile,DefaultChemObjectBuilder.getInstance ());

    Molecule mol = null;
    IMolecularDescriptor HBA =new HBondAcceptorCountDescriptor();
    IMolecularDescriptor HBD =new HBondDonorCountDescriptor();
    IMolecularDescriptor RB =new RotatableBondsCountDescriptor();
    IMolecularDescriptor BT=new BCUTDescriptor();

   RB.setParameters(new Object[] {true});
   BT.setParameters(new Object[] {1,1,true});
 
   while (myiter.hasNext()) {
   mol = (Molecule) myiter.next();
   IntegerResult HAvalue= (IntegerResult) HBA.calculate (mol).getValue();
   IntegerResult HDvalue= (IntegerResult) HBD.calculate(mol).getValue();
   IntegerResult RBvalue= (IntegerResult) RB.calculate(mol).getValue();
   DoubleArrayResult BCUTvalue=(DoubleArrayResult) BT.calculate(mol).getValue();
  

   System.out.println("\t"+HAvalue.intValue());
   System.out.println("\t"+HDvalue.intValue());
   System.out.println("\t"+RBvalue.intValue());
   System.out.println(BCUTvalue.get (0));

   for (int i=1; i<6; i++)
   {
    System.out.print("\t"+BCUTvalue.get(i));
   }
   }//while
  }// function
}//class

----------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to