public final class SlowUnguardedComparator<T> extends Object implements UnguardedDissimilarityCalculator<T>
Usage:
# Import MMS
bin/createMms.sh -in data/molecules/drugbank/drugbank-common_name.smi.gz -out mms.bin
# Calculate fingerprint; inject slow comparator wrapper as the default comparison
# Note that the similarity search internally will further group pages together
# Specify pagesize 1 in order to avoid grouping all targets together a single page
bin/buildStorage.sh \
-in data/molecules/drugbank/drugbank-common_name.smi.gz \
-out fp.bin \
-context createSimpleCfp7Context \
-contextjs 'ctx.pagesize(1).unguarded(
ctx.getUnguardedExtractor(),
new Packages.com.chemaxon.overlap.wui.SlowUnguardedComparator(
ctx.getUnguardedDissimilarityCalculator(), 1
)
);'
# Launch embedded server
# Specify to use only a single working thread for search execution
bin/gui.sh \
-tp 1 \
-allowedOrigins "*,*" -nobrowse -port 8085\
-mols -mms:mms.bin:-name:m \
-desc -desc:fp.bin:-name:slow-fp:-mols:m
Constructor and Description |
---|
SlowUnguardedComparator(UnguardedDissimilarityCalculator<T> base,
long delay) |
Modifier and Type | Method and Description |
---|---|
double |
denormalize(double d)
Calculate raw value for a normalized dissimilarity value.
|
double |
dissimilarity(T t,
T t1)
Compare dissimilarity of two objects.
|
double |
normalize(double d)
Normalize dissimilarity value returned by
UnguardedDissimilarityCalculator.dissimilarity(java.lang.Object, java.lang.Object) . |
String |
toString() |
public SlowUnguardedComparator(UnguardedDissimilarityCalculator<T> base, long delay)
public double dissimilarity(T t, T t1)
UnguardedDissimilarityCalculator
Note that implementations might not check even basic consistency of compared objects.
Implementations must return valid real numbers which are smaller than Double.MAX_VALUE
.
dissimilarity
in interface UnguardedDissimilarityCalculator<T>
t
- Target to comparet1
- Query to comparepublic double normalize(double d)
UnguardedDissimilarityCalculator
UnguardedDissimilarityCalculator.dissimilarity(java.lang.Object, java.lang.Object)
.normalize
in interface UnguardedDissimilarityCalculator<T>
d
- Raw dissimilarity valuepublic double denormalize(double d)
UnguardedDissimilarityCalculator
denormalize
in interface UnguardedDissimilarityCalculator<T>
d
- Normalized dissimilarity value