Class NearestNeighbors

  • Direct Known Subclasses:
    JarvisPatrick

    @PublicAPI
    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.
    • Comparing all individual compounds of a set with a library.
    • Comparing two libraries.
    • Library self-dissimilarity test: comparing all individual compounds of a set with the rest of the compounds.

    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
    • Constructor Detail

      • NearestNeighbors

        public NearestNeighbors()
    • Method Detail

      • setInput

        public void setInput​(ConnectionHandler conh,
                             String querySQL)
                      throws 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:
        SQLException
        Since:
        JChem 1.6.2
      • setInput

        public void setInput​(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,
                        IOException,
                        SQLException,
                        chemaxon.clustering.InvalidLicenseKeyException
        Starts processing.
        Throws:
        chemaxon.clustering.ClusteringException
        IOException
        SQLException
        chemaxon.clustering.InvalidLicenseKeyException
        Since:
        JChem 1.6.2
      • main

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