schrodinger.application.canvas.similarity module¶
Support for Canvas fingerprint similarity operations.
There are classes to perform similarity calculations and to support command line interfaces for similarity options.
Copyright Schrodinger, LLC. All rights reserved.
- exception schrodinger.application.canvas.similarity.CanvasSimilarityNotImplemented(*args)[source]¶
Bases:
Exception
For CanvasSimilarity method not yet implemented
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class schrodinger.application.canvas.similarity.CanvasFingerprintSimilarity(logger)[source]¶
Bases:
object
A class which encapsulates the Canvas fingerprint similarity tools. This includes recording and implementing the available similarity metrics. Currently the metrics are implemented at the Python level as this demonstrates how the fingerprint manipulations are performed however ultimately these will be replaced with wrappers to the underlying Canvaslibs tools which should be more efficient
- SIMILARITY_METRICS = ['Tanimoto', 'Modified Tanimoto', 'Hamming', 'Soergel', 'McConnaughey', 'Dice', 'Cosine', 'Simpson', 'Petke', 'Kulczynski', 'Euclidean', 'Tversky', 'Buser', 'Variance', 'Size', 'Shape', 'Pattern Difference', 'Hamann', 'Matching', 'Pearson', 'Rogers Tanimoto', 'Yule', 'Dixon', 'MinMax']¶
- getDescription()[source]¶
Returns a string representing a summary of the current similarity settings
- calculateSimilarity(fp1, fp2)[source]¶
Calculate the similarity between the two fingerprints and return the value. The similarity is calculated using the similarity method which is current for this object (as set by setMetric())
- class schrodinger.application.canvas.similarity.CanvasFingerprintSimilarityCLI(logger)[source]¶
Bases:
schrodinger.application.canvas.similarity.CanvasFingerprintSimilarity
A subclass of the CanvasFingerprintSimilarity class which supports operations from the command line. In particular the parsing and applying of options and the printing of a description of the available similarity metrics
- getSimilarityMetricDescription()[source]¶
Return a string which contains a description available similarity
- SIMILARITY_METRICS = ['Tanimoto', 'Modified Tanimoto', 'Hamming', 'Soergel', 'McConnaughey', 'Dice', 'Cosine', 'Simpson', 'Petke', 'Kulczynski', 'Euclidean', 'Tversky', 'Buser', 'Variance', 'Size', 'Shape', 'Pattern Difference', 'Hamann', 'Matching', 'Pearson', 'Rogers Tanimoto', 'Yule', 'Dixon', 'MinMax']¶
- calculateSimilarity(fp1, fp2)¶
Calculate the similarity between the two fingerprints and return the value. The similarity is calculated using the similarity method which is current for this object (as set by setMetric())
- debug(output)¶
Wrapper for debug logging, just to simplify logging
- getAlpha()¶
Get the value of Alpha as used in the tversky similarity
- getBeta()¶
Get the value of Alpha as used in the tversky similarity
- getDescription()¶
Returns a string representing a summary of the current similarity settings
- getMetric()¶
Returns the currently set metric
- getMetricStyle()¶
Return a value corresponding to the current metric style. This is used in difference matrix construction as part of clustering
- setAlpha(alpha)¶
Set the value of Alpha as used in the tversky similarity
- setBeta(beta)¶
Set the value of Alpha as used in the tversky similarity
- setMetric(metric_name)¶
Set the current metric based on the metric name
- simBuser(fp1, fp2)¶
- simCosine(fp1, fp2)¶
- simDice(fp1, fp2)¶
- simDixon(fp1, fp2)¶
- simEuclidean(fp1, fp2)¶
- simHamann(fp1, fp2)¶
- simHamming(fp1, fp2)¶
- simKulczynski(fp1, fp2)¶
- simMatching(fp1, fp2)¶
- simMcConnaughey(fp1, fp2)¶
- simMinMax(fp1, fp2)¶
- simModifiedTanimoto(fp1, fp2)¶
- simPatternDifference(fp1, fp2)¶
- simPearson(fp1, fp2)¶
- simPetke(fp1, fp2)¶
- simRogersTanimoto(fp1, fp2)¶
- simShape(fp1, fp2)¶
- simSimpson(fp1, fp2)¶
- simSize(fp1, fp2)¶
- simSoergel(fp1, fp2)¶
- simTanimoto(fp1, fp2)¶
- simTversky(fp1, fp2)¶
- simVariance(fp1, fp2)¶
- simYule(fp1, fp2)¶