Package chemaxon.descriptors
Class ShapeDescriptor
java.lang.Object
chemaxon.descriptors.MolecularDescriptor
chemaxon.descriptors.ShapeDescriptor
- All Implemented Interfaces:
chemaxon.license.Licensable,Cloneable
@PublicApi
@Beta
public class ShapeDescriptor
extends MolecularDescriptor
implements chemaxon.license.Licensable
Shape descriptor implements a 3D alignment based similarity calculation.
At descriptor generation a specific molecule representation is stored and additional data is calculated.
The similarity calculation itself compares two of such representations using (flexible) 3D structural overlay.
-
Field Summary
Fields inherited from class chemaxon.descriptors.MolecularDescriptor
params -
Constructor Summary
ConstructorsConstructorDescriptionCopy constructor.ShapeDescriptor(ShapeParameters params) Creates a new instance of ShapeDescriptor according to the parameters given.ShapeDescriptor(String params) Creates a new instance of ShapeDescriptor according to the parameters given.s -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the fingerprint, all values are set to zero.clone()Creates a new instance with identical internal state.voidfromData(byte[] dbRepr) Builds aMolecularDescriptorobject from its external (database) representation.voidfromFloatArray(float[] descr) Builds a molecular descriptor from its float array representation.voidfromString(String descr) Builds a molecular descriptor from its string representation.String[]Creates the descriptor for the given Molecule.float[]Gets the default dissimilarity threshold values for all dissimilarity metrics defined.floatgetDefaultThreshold(int metricIndex) Gets a metric dependent default threshold value.floatCalculates the dissimilarity ratio between twoMolecularDescriptorobjects using the default metric.floatgetDissimilarity(MolecularDescriptor other, int parametrizedMetricIndex) Calculates the dissimilarity between twoMolecularDescriptorobjects using the specified metric, apart from that it is the same asgetDissimilarity( final MolecularDescriptor other ).String[]Gets the dissimilarity metric names in an array.floatDeprecated, for removal: This API element is subject to removal in a future version.getName()Gets the name of theShapeDescriptorfingerprint object.Gets the name of the parameters class corresponding to the descriptor.floatGets the short name of the fingerprint.booleanvoidvoidsetParameters(String parameters) Sets the parameters of an already createdShapeDescriptorobject.voidsetShapeData(ShapeData shapeData) Creates the binary string representation of aMolecularDescriptorobject.byte[]toData()Converts the internal (memory) representation of aMolecularDescriptorinstance into an external format that can be stored in a database.Creates the string representation of aMolecularDescriptorobject.float[]Creates the float array representation of aMolecularDescriptorobject.toString()Creates the string representation of aMolecularDescriptorobject.Methods inherited from class chemaxon.descriptors.MolecularDescriptor
generate, getAtomSetColors, getAtomSetIndexes, getAtomSetNames, getDefaultMetricIndex, getDissimilarityMetricIndex, getLowerBound, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getParameters, getThreshold, getThreshold, needsConfig, newInstance, newInstance, newInstanceFromXML, setParameters, setScreeningConfiguration
-
Constructor Details
-
ShapeDescriptor
public ShapeDescriptor() -
ShapeDescriptor
Creates a new instance of ShapeDescriptor according to the parameters given.- Parameters:
params- parameter settings
-
ShapeDescriptor
Creates a new instance of ShapeDescriptor according to the parameters given.s- Parameters:
params- parameter settings
-
ShapeDescriptor
Copy constructor. An identical copy of theShapeDescriptorpassed is created. The old and the new instances share the sameShapeDescriptorParametersobject.- Parameters:
sh- fingerprint to be copied
-
-
Method Details
-
getDefaultThreshold
public float getDefaultThreshold(int metricIndex) Gets a metric dependent default threshold value. Ideally, this value should be based on statistics, though the actual value is not too critical, since these are only used in user interfaces to simplify the use of applications for beginners. Do not use this method. Required only for the compatibility with the screening framework.- Overrides:
getDefaultThresholdin classMolecularDescriptor- Parameters:
metricIndex- index of a parameterized metric
-
getDefaultDissimilarityMetricThresholds
public float[] getDefaultDissimilarityMetricThresholds()Gets the default dissimilarity threshold values for all dissimilarity metrics defined. Do not use this method. Required only for the compatibility with the screening framework.- Specified by:
getDefaultDissimilarityMetricThresholdsin classMolecularDescriptor- Returns:
- array of dissimilarity threshold values
-
setLicenseEnvironment
- Specified by:
setLicenseEnvironmentin interfacechemaxon.license.Licensable
-
isLicensed
public boolean isLicensed()- Specified by:
isLicensedin interfacechemaxon.license.Licensable
-
clone
Description copied from class:MolecularDescriptorCreates a new instance with identical internal state.- Specified by:
clonein classMolecularDescriptor- Returns:
- the newly copied object
-
setShapeData
-
generate
Description copied from class:MolecularDescriptorCreates the descriptor for the given Molecule.- Overrides:
generatein classMolecularDescriptor- Returns:
- property names set in the molecule passed during generation
- Throws:
MDGeneratorException- when failed to generate descriptor
-
getName
Gets the name of theShapeDescriptorfingerprint object. This name is not the same as the class name: nicer, and more meaningful for end-users too.- Overrides:
getNamein classMolecularDescriptor- Returns:
- the nice, external name for
ShapeDescriptorclass objects
-
getShortName
Gets the short name of the fingerprint.- Overrides:
getShortNamein classMolecularDescriptor- Returns:
- the short name used in text outputs (tables etc.)
-
getParametersClassName
Gets the name of the parameters class corresponding to the descriptor.- Overrides:
getParametersClassNamein classMolecularDescriptor- Returns:
- the name of the parameters class
-
setParameters
Sets the parameters of an already createdShapeDescriptorobject.- Specified by:
setParametersin classMolecularDescriptor- Parameters:
parameters- parameter settings for the fingerprint- Throws:
MDParametersException- any XML error
-
clear
public void clear()Clears the fingerprint, all values are set to zero. -
toData
public byte[] toData()Description copied from class:MolecularDescriptorConverts the internal (memory) representation of aMolecularDescriptorinstance into an external format that can be stored in a database.- Specified by:
toDatain classMolecularDescriptor- Returns:
- binary representation of the descriptor
-
fromData
public void fromData(byte[] dbRepr) Description copied from class:MolecularDescriptorBuilds aMolecularDescriptorobject from its external (database) representation.- Specified by:
fromDatain classMolecularDescriptor- Parameters:
dbRepr- an array generated bytoData()
-
toString
Description copied from class:MolecularDescriptorCreates the string representation of aMolecularDescriptorobject. This string value is stored in SDfiles, though the use of this string is not limited to this purpose. Typically, this string is compact, for instance zero values are not necessarily printed.- Specified by:
toStringin classMolecularDescriptor- Returns:
- a formatted string of the descriptor
-
toDecimalString
Description copied from class:MolecularDescriptorCreates the string representation of aMolecularDescriptorobject. This string value contains all values of the descriptor (including all zeros), values are separated by tabs.- Specified by:
toDecimalStringin classMolecularDescriptor- Returns:
- a formatted string of the descriptor
-
fromString
Description copied from class:MolecularDescriptorBuilds a molecular descriptor from its string representation. Typically used when SDfile is read.- Specified by:
fromStringin classMolecularDescriptor- Parameters:
descr- descriptor string, previously generated bytoString()- Throws:
ParseException
-
toFloatArray
public float[] toFloatArray()Description copied from class:MolecularDescriptorCreates the float array representation of aMolecularDescriptorobject. This array contains all values of the descriptor (including all zeros) in the elements of the array.- Specified by:
toFloatArrayin classMolecularDescriptor- Returns:
- a formatted float array of the descriptor
-
fromFloatArray
public void fromFloatArray(float[] descr) Description copied from class:MolecularDescriptorBuilds a molecular descriptor from its float array representation. Typically used when a hypothesis is created.- Specified by:
fromFloatArrayin classMolecularDescriptor- Parameters:
descr- descriptor represented in a float array (e.g. generated bytoFloatArray())
-
toBinaryString
Description copied from class:MolecularDescriptorCreates the binary string representation of aMolecularDescriptorobject.- Overrides:
toBinaryStringin classMolecularDescriptor- Returns:
- a 0,1 string of the descriptor
-
getDissimilarityMetrics
Description copied from class:MolecularDescriptorGets the dissimilarity metric names in an array.
This method must be overloaded by derived classes in order to get the metrics array depending on the dynamic type. (This is needed because the metrics[] array is a class variable, but class variables are shared among all derived classes.)- Specified by:
getDissimilarityMetricsin classMolecularDescriptor- Returns:
- the metrics array
-
getDissimilarity
Description copied from class:MolecularDescriptorCalculates the dissimilarity ratio between twoMolecularDescriptorobjects using the default metric. Default metric is set in the correspondingMDParametersobject. In the case of asymmetric distances swapping the two descriptors can make a big difference.- Specified by:
getDissimilarityin classMolecularDescriptor- Parameters:
other- the query descriptor with initialized Similarity3d object.- Returns:
- the dissimilarity
-
getShapeSimilarity
- Parameters:
other- the query descriptor with initialized Similarity3d obj.- Returns:
- the shape similarity (s) where 0\invalid input: '<'= s \invalid input: '<'=1
-
getHistogramSimilarity
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public float getHistogramSimilarity(MolecularDescriptor other) Deprecated, for removal: This API element is subject to removal in a future version.usegetShapeSimilarity(MolecularDescriptor)instead- Parameters:
other- the query descriptor with initialized Similarity3d obj.- Returns:
- the histogram similarity (h) where 0\invalid input: '<'= h
-
getDissimilarity
Description copied from class:MolecularDescriptorCalculates the dissimilarity between twoMolecularDescriptorobjects using the specified metric, apart from that it is the same asgetDissimilarity( final MolecularDescriptor other ).- Specified by:
getDissimilarityin classMolecularDescriptor- Parameters:
other- a descriptor, to which the dissimilarity ratio is measuredparametrizedMetricIndex- the index of the parameterized metric to used- Returns:
- dissimilarity ratio
- See Also:
-
getAliasNames
-
getShapeSimilarity(MolecularDescriptor)instead