chemaxon.clustering
Class NearestNeighbors

java.lang.Object
  extended by chemaxon.clustering.Common
      extended by chemaxon.clustering.NearestNeighbors
Direct Known Subclasses:
JarvisPatrick

public class NearestNeighbors
extends Common

Compares two sets of objects (like compound libraries) using diversity and dissimilarity calculations.
This class can be used from command-line or from the API.

An example for running NearestNeighbours:


 ConnectionHandler ch;
 String selectString;
 ...
 NearestNeighbors nn=new NearestNeighbors();
 nn.setInput(ch, selectString);
 nn.setOutput(System.out);
 nn.setDimensions(0);
 nn.setFpSize(0);
 nn.setIdGeneration(true);
 nn.setThreshold(0.1f);
 nn.run();
 

Since:
JChem 1.6.2
Author:
Ferenc Csizmadia, Szilard Dorant

Constructor Summary
NearestNeighbors()
           
 
Method Summary
 float getThreshold()
          Gets the threshold value.
static void main(java.lang.String[] args)
          The command line version entry point.
 void run()
          Starts processing.
 void setInput(ConnectionHandler conh, java.lang.String querySQL)
          Sets input as an SQL query.
 void setInput(java.io.File file)
          Sets input as a File.
 void setInput(java.io.InputStream is)
          Sets input as an InputStream
 void setInput(java.lang.String fileName)
          Sets input as a file, specified by its path.
 void setThreshold(float threshold)
          Sets the threshold value.
 
Methods inherited from class chemaxon.clustering.Common
getDimensions, getElapsedTime, getFpSize, getIdGeneration, getStartTime, getStatStream, getWeights, isOnlyStat, isStatNeeded, setDimensions, setFpSize, setIdGeneration, setOnlyStat, setOutput, setOutput, setOutput, setOutput, setStatNeeded, setStatStream, setWeights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NearestNeighbors

public NearestNeighbors()
Method Detail

setInput

public void setInput(ConnectionHandler conh,
                     java.lang.String querySQL)
              throws java.sql.SQLException
Sets input as an SQL query.

Parameters:
conh - ConnectionHandler object opened to the database
querySQL - an SQL SELECT statement used as data source
Throws:
java.sql.SQLException
Since:
JChem 1.6.2

setInput

public void setInput(java.io.File file)
              throws java.io.FileNotFoundException
Sets input as a File.

Parameters:
file - the File to be used for input
Throws:
java.io.FileNotFoundException
Since:
JChem 1.6.2

setInput

public void setInput(java.lang.String fileName)
              throws java.io.FileNotFoundException
Sets input as a file, specified by its path.

Parameters:
fileName - the path of File to be used for input
Throws:
java.io.FileNotFoundException
Since:
JChem 1.6.2

setInput

public void setInput(java.io.InputStream is)
Sets input as an InputStream

Parameters:
is - the InputStream to be used for input
Since:
JChem 1.6.2

setThreshold

public void setThreshold(float threshold)
Sets the threshold value.

Parameters:
threshold - the threshold value to be used
Since:
JChem 1.6.2

getThreshold

public float getThreshold()
Gets the threshold value.

Returns:
the current threshold value
Since:
JChem 1.6.2

run

public void run()
         throws chemaxon.clustering.ClusteringException,
                java.io.IOException,
                java.sql.SQLException,
                chemaxon.clustering.InvalidLicenseKeyException
Starts processing.

Throws:
chemaxon.clustering.ClusteringException
java.io.IOException
java.sql.SQLException
chemaxon.clustering.InvalidLicenseKeyException
Since:
JChem 1.6.2

main

public static void main(java.lang.String[] args)
The command line version entry point. Parameter parsing, initialization then start.