Package chemaxon.clustering
Class NearestNeighbors
java.lang.Object
chemaxon.clustering.Common
chemaxon.clustering.NearestNeighbors
- Direct Known Subclasses:
JarvisPatrick
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.
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
Gets the threshold value.static void
Deprecated, for removal: This API element is subject to removal in a future version.This main method will be removed, CLI interfaces should not be used directly from Java code.void
run()
Starts processing.void
setInput
(ConnectionHandler conh, String querySQL) Sets input as an SQL query.void
Sets input as a File.void
setInput
(InputStream is) Sets input as an InputStreamvoid
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
-
Constructor Details
-
NearestNeighbors
public NearestNeighbors()
-
-
Method Details
-
setInput
Sets input as an SQL query.- Parameters:
conh
- ConnectionHandler object opened to the databasequerySQL
- an SQL SELECT statement used as data source- Throws:
SQLException
- Since:
- JChem 1.6.2
-
setInput
Sets input as a File.- Parameters:
file
- the File to be used for input- Throws:
FileNotFoundException
- Since:
- JChem 1.6.2
-
setInput
Sets input as a file, specified by its path.- Parameters:
fileName
- the path of File to be used for input- Throws:
FileNotFoundException
- Since:
- JChem 1.6.2
-
setInput
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
Starts processing.- Throws:
ClusteringException
IOException
SQLException
InvalidLicenseKeyException
- Since:
- JChem 1.6.2
-
main
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JAN_01_2025) public static void main(String[] args) Deprecated, for removal: This API element is subject to removal in a future version.This main method will be removed, CLI interfaces should not be used directly from Java code.The command line version entry point. Parameter parsing, initialization then start.
-