@PublicAPI public class Compare extends Common
An example for running Compare:
ConnectionHandler ch; String selectString1; String selectString2; ... Compare cp=new Compare(); cp.setInput1(ch, selectString1 ); cp.setInput2(ch, selectString2 ); cp.setOutput(System.out); cp.setDimensions(0); cp.setFpSize(512); cp.setStatNeeded(true); cp.setOnlyStat(false); cp.setStatStream(System.out); cp.setIdGeneration(true); cp.setThreshold(0.1f); cp.setOnlyDissimilarListed(true); cp.setDifferentIdsOnly(true); cp.run();
Constructor and Description |
---|
Compare() |
Modifier and Type | Method and Description |
---|---|
int |
getMaxSimilar()
Gets the maximum allowed number of similar objects for a compound.
|
float |
getThreshold()
Gets the threshold value.
|
boolean |
isDifferentIdsOnly()
Indicates whether compounds with different id-s compared only.
|
boolean |
isOnlyDissimilarListed()
Indicates whether only dissimilar objects are printed.
|
boolean |
isOrderSimilarObjects()
Indicates, whether the list similar objects should be ordered by distance
(closest first).
|
boolean |
isSimilarListed()
Indicates whether similar objects listed from the first set.
|
static void |
main(java.lang.String[] args)
The command line version entry point.
|
void |
run()
Starts processing.
|
void |
setDifferentIdsOnly(boolean b)
Specifies whether compounds with identical id should be compared.
|
void |
setInput1(ConnectionHandler conh,
java.lang.String querySQL)
Sets the first compound library (first set) as an SQL query.
|
void |
setInput1(java.io.File file)
Sets the first compound library (first set) as a file.
|
void |
setInput1(java.io.InputStream is)
Sets the first compound library (first set) as an InputStream
|
void |
setInput1(java.lang.String fileName)
Sets the first compound library (first set) as a file, specified by the
file's path.
|
void |
setInput2(ConnectionHandler conh,
java.lang.String querySQL)
Sets the second compound library (second set) as an SQL query.
|
void |
setInput2(java.io.File file)
Sets the second compound library (second set) as a file.
|
void |
setInput2(java.io.InputStream is)
Sets the second compound library (second set) as an InputStream
|
void |
setInput2(java.lang.String fileName)
Sets the second compound library (second set) as a file, specified by the
file's path.
|
void |
setMaxSimilar(int maxSimilar)
Sets the maximum allowed number of similar objects for a compound.
|
void |
setOnlyDissimilarListed(boolean b)
Specifies, if only dissimilar objects are to be printed.
|
void |
setOrderSimilarObjects(boolean orderSimilarObjects)
Specifies, whether the list similar objects should be ordered by distance
(closest first).
|
void |
setSimilarListed(boolean b)
Specifies if similar objects are to be listed from the first set.
|
void |
setThreshold(float threshold)
Sets the threshold value.
|
getDimensions, getElapsedTime, getFpSize, getIdGeneration, getStartTime, getStatStream, getWeights, isOnlyStat, isStatNeeded, setDimensions, setFpSize, setIdGeneration, setOnlyStat, setOutput, setOutput, setOutput, setOutput, setStatNeeded, setStatStream, setWeights
public void setInput1(ConnectionHandler conh, java.lang.String querySQL) throws java.sql.SQLException
conh
- ConnectionHandler object opened to the databasequerySQL
- an SQL SELECT statement used as data sourcejava.sql.SQLException
public void setInput2(ConnectionHandler conh, java.lang.String querySQL) throws java.sql.SQLException
conh
- ConnectionHandler object opened to the databasequerySQL
- an SQL SELECT statement used as data sourcejava.sql.SQLException
public void setInput1(java.io.File file) throws java.io.FileNotFoundException
file
- the File to be used for inputjava.io.FileNotFoundException
public void setInput2(java.io.File file) throws java.io.FileNotFoundException
file
- the File to be used for inputjava.io.FileNotFoundException
public void setInput1(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- the path of the input filejava.io.FileNotFoundException
public void setInput2(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- the path of the input filejava.io.FileNotFoundException
public void setInput1(java.io.InputStream is)
is
- the InputStream to be used for inputpublic void setInput2(java.io.InputStream is)
is
- the InputStream to be used for inputpublic void setThreshold(float threshold)
threshold
- the threshold value to be setpublic float getThreshold()
public void setOnlyDissimilarListed(boolean b)
b
- if set to true
only dissimilar objects are printed,
otherwise all objects are listedpublic boolean isOnlyDissimilarListed()
true
, if only dissimilar objects are printed,
false
otherwisepublic void setSimilarListed(boolean b)
b
- if set to true
, similar objects are printed
from the first setpublic boolean isSimilarListed()
true
, if similar objects are printed
from the first setpublic void setDifferentIdsOnly(boolean b)
b
- if set to true
, compounds with different id-s
compared only. Otherwise all compounds are compared.public boolean isDifferentIdsOnly()
public void setMaxSimilar(int maxSimilar)
maxSimilar
- the maximum number of similar neighborspublic int getMaxSimilar()
public void setOrderSimilarObjects(boolean orderSimilarObjects)
orderSimilarObjects
- if set to true
, the list of
similar objects should be ordered by distance in the output.
Default value is false
.public boolean isOrderSimilarObjects()
true
, if the list of
similar objects will be ordered by distance in the output.
Default value is false
.public void run() throws chemaxon.clustering.ClusteringException, java.io.IOException, java.sql.SQLException, chemaxon.clustering.InvalidLicenseKeyException
chemaxon.clustering.ClusteringException
java.io.IOException
java.sql.SQLException
chemaxon.clustering.InvalidLicenseKeyException
public static void main(java.lang.String[] args)
args
- the command line parameters