net.sf.ciccgrid.pws
Class Struct3D

java.lang.Object
  extended by net.sf.ciccgrid.pws.Struct3D

public class Struct3D
extends java.lang.Object

Obtain 3D structures for Pubchem compounds.

The structures have been optimized using MMFF94.

Author:
rguha

Constructor Summary
Struct3D()
           
 
Method Summary
 java.lang.String getStructureByCID(java.lang.String cid)
          Get a 3D structure in SDF format by CID.
 java.lang.String getStructureByInChI(java.lang.String inchi)
          Get a 3D structure in SDF format by InChI.
 java.lang.String getStructureByInChIKey(java.lang.String inchikey)
          Get a 3D structure in SDF format by InChI key
 java.lang.String[] getStructureBySmarts(java.lang.String smarts, int howMany)
          Get 3D structures based on SMARTS patterns.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Struct3D

public Struct3D()
         throws java.sql.SQLException,
                java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
Method Detail

getStructureByCID

public java.lang.String getStructureByCID(java.lang.String cid)
                                   throws java.lang.Exception
Get a 3D structure in SDF format by CID.

Parameters:
cid - The CID of interest
Returns:
A string containing the structure in SDF format
Throws:
java.lang.Exception

getStructureByInChI

public java.lang.String getStructureByInChI(java.lang.String inchi)
                                     throws java.lang.Exception
Get a 3D structure in SDF format by InChI.

Parameters:
inchi - The InChI of interest
Returns:
A string containing the structure in SDF format. If no matching structure was found returns and empty string
Throws:
java.lang.Exception

getStructureByInChIKey

public java.lang.String getStructureByInChIKey(java.lang.String inchikey)
                                        throws java.lang.Exception
Get a 3D structure in SDF format by InChI key

Parameters:
inchikey - The InChI key of interest
Returns:
A string containing the structure in SDF format. If no matching structure was found returns and empty string
Throws:
java.lang.Exception

getStructureBySmarts

public java.lang.String[] getStructureBySmarts(java.lang.String smarts,
                                               int howMany)
                                        throws java.lang.Exception
Get 3D structures based on SMARTS patterns.

Parameters:
smarts - The SMARTS pattern to look for
howMany - How many structures should be returned? If set to 0 then all the hits will be returned. For simple SMARTS (which match everything) this can result in a very large number of results and will probably crash the application container
Returns:
An array of strings, each string is the SDF formatted structure
Throws:
java.lang.Exception