Hi Hari, The LogP and PSA are both descriptors, so OBDescriptor.FindType("PluginName") will give you a pointer to the plugin, and then you use the Predict(myOBMol) method to calculate the value for a molecule.
The number of rings is not a well defined property. If you mean the SSSR, we can do that - just call OBMol.GetSSSR() and get the length of the returned vector. It looks like the Stereo classes have not yet been wrapped. So either you should copy the relevant lines from the Python swig interface, and regenerate the bindings, or else you'll have to do some C++ coding...:-/ - Noel On 3 February 2011 17:35, hari jayaram <hari...@gmail.com> wrote: > Hi , > I am trying to write a java class that calculates some of the > properties listed by the obprop utility. > > I can easily get the molecular weight , number of heavy atoms and > number of rotatable bonds. > However I was wondering how to get the number of stereocenters from a > 0D smiles molecule , the number of rings , the logP and PSA. > > I am quite new to SWIG ( and java too) , but the eclipse IDE does not > seem to pick up the Stereo classes. Any pointers on how to code the > NumStereoCenters, NumRings, the logP and PSA. > > Thanks for your help > Hari > > > My very rudimentary java code is pasted here. > > import org.openbabel.*; > > public class CalcDescriptor { > public static String testString = new > String("CC(=O)OC1=CC=CC=C1C(=O)O"); > public static void main(String[] args){ > System.loadLibrary("openbabel_java"); > OBMol mymol = new org.openbabel.OBMol(); > OBConversion conv = new OBConversion(); > conv.SetInFormat("smiles"); > conv.ReadString(mymol, testString); > System.out.println("Molecular Weight:" + mymol.GetMolWt()); > System.out.println("Number of heavy Atoms:" + > mymol.NumHvyAtoms()); > System.out.println("Number of rotatable bonds:" + > mymol.NumRotors()); > > } > > } > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > ------------------------------------------------------------------------------ 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 _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss