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
ConstructorDescriptionCopy 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 TypeMethodDescriptionvoid
clear()
Clears the fingerprint, all values are set to zero.clone()
Creates a new instance with identical internal state.void
fromData
(byte[] dbRepr) Builds aMolecularDescriptor
object from its external (database) representation.void
fromFloatArray
(float[] descr) Builds a molecular descriptor from its float array representation.void
fromString
(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.float
getDefaultThreshold
(int metricIndex) Gets a metric dependent default threshold value.float
Calculates the dissimilarity ratio between twoMolecularDescriptor
objects using the default metric.float
getDissimilarity
(MolecularDescriptor other, int parametrizedMetricIndex) Calculates the dissimilarity between twoMolecularDescriptor
objects using the specified metric, apart from that it is the same asgetDissimilarity( final MolecularDescriptor other )
.String[]
Gets the dissimilarity metric names in an array.float
Deprecated, for removal: This API element is subject to removal in a future version.getName()
Gets the name of theShapeDescriptor
fingerprint object.Gets the name of the parameters class corresponding to the descriptor.float
Gets the short name of the fingerprint.boolean
void
void
setParameters
(String parameters) Sets the parameters of an already createdShapeDescriptor
object.void
setShapeData
(ShapeData shapeData) Creates the binary string representation of aMolecularDescriptor
object.byte[]
toData()
Converts the internal (memory) representation of aMolecularDescriptor
instance into an external format that can be stored in a database.Creates the string representation of aMolecularDescriptor
object.float[]
Creates the float array representation of aMolecularDescriptor
object.toString()
Creates the string representation of aMolecularDescriptor
object.Methods inherited from class chemaxon.descriptors.MolecularDescriptor
generate, getAtomSetColors, getAtomSetIndexes, getAtomSetNames, getDefaultMetricIndex, getDissimilarityMetricIndex, getLowerBound, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getParameters, getThreshold, getThreshold, main, 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 theShapeDescriptor
passed is created. The old and the new instances share the sameShapeDescriptorParameters
object.- 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:
getDefaultThreshold
in 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:
getDefaultDissimilarityMetricThresholds
in classMolecularDescriptor
- Returns:
- array of dissimilarity threshold values
-
setLicenseEnvironment
- Specified by:
setLicenseEnvironment
in interfacechemaxon.license.Licensable
-
isLicensed
public boolean isLicensed()- Specified by:
isLicensed
in interfacechemaxon.license.Licensable
-
clone
Description copied from class:MolecularDescriptor
Creates a new instance with identical internal state.- Specified by:
clone
in classMolecularDescriptor
- Returns:
- the newly copied object
-
setShapeData
-
generate
Description copied from class:MolecularDescriptor
Creates the descriptor for the given Molecule.- Overrides:
generate
in classMolecularDescriptor
- Returns:
- property names set in the molecule passed during generation
- Throws:
MDGeneratorException
- when failed to generate descriptor
-
getName
Gets the name of theShapeDescriptor
fingerprint object. This name is not the same as the class name: nicer, and more meaningful for end-users too.- Overrides:
getName
in classMolecularDescriptor
- Returns:
- the nice, external name for
ShapeDescriptor
class objects
-
getShortName
Gets the short name of the fingerprint.- Overrides:
getShortName
in classMolecularDescriptor
- Returns:
- the short name used in text outputs (tables etc.)
-
getParametersClassName
Gets the name of the parameters class corresponding to the descriptor.- Overrides:
getParametersClassName
in classMolecularDescriptor
- Returns:
- the name of the parameters class
-
setParameters
Sets the parameters of an already createdShapeDescriptor
object.- Specified by:
setParameters
in 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:MolecularDescriptor
Converts the internal (memory) representation of aMolecularDescriptor
instance into an external format that can be stored in a database.- Specified by:
toData
in classMolecularDescriptor
- Returns:
- binary representation of the descriptor
-
fromData
public void fromData(byte[] dbRepr) Description copied from class:MolecularDescriptor
Builds aMolecularDescriptor
object from its external (database) representation.- Specified by:
fromData
in classMolecularDescriptor
- Parameters:
dbRepr
- an array generated bytoData()
-
toString
Description copied from class:MolecularDescriptor
Creates the string representation of aMolecularDescriptor
object. 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:
toString
in classMolecularDescriptor
- Returns:
- a formatted string of the descriptor
-
toDecimalString
Description copied from class:MolecularDescriptor
Creates the string representation of aMolecularDescriptor
object. This string value contains all values of the descriptor (including all zeros), values are separated by tabs.- Specified by:
toDecimalString
in classMolecularDescriptor
- Returns:
- a formatted string of the descriptor
-
fromString
Description copied from class:MolecularDescriptor
Builds a molecular descriptor from its string representation. Typically used when SDfile is read.- Specified by:
fromString
in classMolecularDescriptor
- Parameters:
descr
- descriptor string, previously generated bytoString()
- Throws:
ParseException
-
toFloatArray
public float[] toFloatArray()Description copied from class:MolecularDescriptor
Creates the float array representation of aMolecularDescriptor
object. This array contains all values of the descriptor (including all zeros) in the elements of the array.- Specified by:
toFloatArray
in classMolecularDescriptor
- Returns:
- a formatted float array of the descriptor
-
fromFloatArray
public void fromFloatArray(float[] descr) Description copied from class:MolecularDescriptor
Builds a molecular descriptor from its float array representation. Typically used when a hypothesis is created.- Specified by:
fromFloatArray
in classMolecularDescriptor
- Parameters:
descr
- descriptor represented in a float array (e.g. generated bytoFloatArray()
)
-
toBinaryString
Description copied from class:MolecularDescriptor
Creates the binary string representation of aMolecularDescriptor
object.- Overrides:
toBinaryString
in classMolecularDescriptor
- Returns:
- a 0,1 string of the descriptor
-
getDissimilarityMetrics
Description copied from class:MolecularDescriptor
Gets 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:
getDissimilarityMetrics
in classMolecularDescriptor
- Returns:
- the metrics array
-
getDissimilarity
Description copied from class:MolecularDescriptor
Calculates the dissimilarity ratio between twoMolecularDescriptor
objects using the default metric. Default metric is set in the correspondingMDParameters
object. In the case of asymmetric distances swapping the two descriptors can make a big difference.- Specified by:
getDissimilarity
in 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\<= s \<=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\<= h
-
getDissimilarity
Description copied from class:MolecularDescriptor
Calculates the dissimilarity between twoMolecularDescriptor
objects using the specified metric, apart from that it is the same asgetDissimilarity( final MolecularDescriptor other )
.- Specified by:
getDissimilarity
in 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