net.sf.ciccgrid.pws
Class Structure

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

public class Structure
extends java.lang.Object

Methods to get various aspects of PubChem structures.

Author:
rguha

Constructor Summary
Structure()
           
 
Method Summary
 java.lang.String getCIDByInChI(java.lang.String inchi)
          Get CID by InChI.
 java.lang.String getCIDByInChIKey(java.lang.String inchikey)
          Get CID by InChI key.
 java.lang.String[] getCIDBySimilarity(java.lang.String smiles, double sim, int howMany, int speedup)
          Find compounds that are similar to the supplied molecule.
 java.lang.String[] getSmilesByCID(java.lang.String[] cids)
          Get the SMILES corresponding to a compound ID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Structure

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

getSmilesByCID

public java.lang.String[] getSmilesByCID(java.lang.String[] cids)
                                  throws java.lang.Exception
Get the SMILES corresponding to a compound ID.

Parameters:
cids - An array of strings representing the compound ID's for which the SMILES are desired
Returns:
A String array containing the corresponding SMILES
Throws:
java.lang.Exception

getCIDByInChI

public java.lang.String getCIDByInChI(java.lang.String inchi)
                               throws java.lang.Exception
Get CID by InChI.

Parameters:
inchi - The InChI string
Returns:
The CID if found or an empty string if not found
Throws:
java.lang.Exception

getCIDByInChIKey

public java.lang.String getCIDByInChIKey(java.lang.String inchikey)
                                  throws java.lang.Exception
Get CID by InChI key.

Parameters:
inchikey - The InChI key string
Returns:
The CID if found or an empty string if not found
Throws:
java.lang.Exception

getCIDBySimilarity

public java.lang.String[] getCIDBySimilarity(java.lang.String smiles,
                                             double sim,
                                             int howMany,
                                             int speedup)
                                      throws java.lang.Exception
Find compounds that are similar to the supplied molecule.

The similarity is obtained by calculating the Tanimoto coefficient between the 166 bit MACCS keys. Note however that this method is extremely slow since it has to do an exhaustiv comparison

Parameters:
smiles - The target SMILES
sim - The Tanimoto similarity cutoff (between 0 and 1)
howMany - How many should be returned? A negative number will return everything (which may be a huge number and will take a very long time)
speedup - If set to 0 then the speedup described by Swamidass & Baldi will not be employed. If any other value it will be employed. Note that the speedup is only relevant for relatively high similarity values and ends up being equivalent to linear search for low similarity values. For now this is ignored
Returns:
The CID's of the similar molecules. If there are no hits returned then it will return a String array with the single element equal to 'None'
Throws:
java.lang.Exception