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.
  • Constructor Details

    • ShapeDescriptor

      public ShapeDescriptor()
    • ShapeDescriptor

      public ShapeDescriptor(ShapeParameters params)
      Creates a new instance of ShapeDescriptor according to the parameters given.
      Parameters:
      params - parameter settings
    • ShapeDescriptor

      public ShapeDescriptor(String params)
      Creates a new instance of ShapeDescriptor according to the parameters given.s
      Parameters:
      params - parameter settings
    • ShapeDescriptor

      public ShapeDescriptor(ShapeDescriptor sh)
      Copy constructor. An identical copy of the ShapeDescriptor passed is created. The old and the new instances share the same ShapeDescriptorParameters 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 class MolecularDescriptor
      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 class MolecularDescriptor
      Returns:
      array of dissimilarity threshold values
    • setLicenseEnvironment

      public void setLicenseEnvironment(String env)
      Specified by:
      setLicenseEnvironment in interface chemaxon.license.Licensable
    • isLicensed

      public boolean isLicensed()
      Specified by:
      isLicensed in interface chemaxon.license.Licensable
    • clone

      public ShapeDescriptor clone()
      Description copied from class: MolecularDescriptor
      Creates a new instance with identical internal state.
      Specified by:
      clone in class MolecularDescriptor
      Returns:
      the newly copied object
    • setShapeData

      public void setShapeData(ShapeData shapeData)
    • generate

      public String[] generate(Molecule m) throws MDGeneratorException
      Description copied from class: MolecularDescriptor
      Creates the descriptor for the given Molecule.
      Overrides:
      generate in class MolecularDescriptor
      Returns:
      property names set in the molecule passed during generation
      Throws:
      MDGeneratorException - when failed to generate descriptor
    • getName

      public String getName()
      Gets the name of the ShapeDescriptor fingerprint object. This name is not the same as the class name: nicer, and more meaningful for end-users too.
      Overrides:
      getName in class MolecularDescriptor
      Returns:
      the nice, external name for ShapeDescriptor class objects
    • getShortName

      public String getShortName()
      Gets the short name of the fingerprint.
      Overrides:
      getShortName in class MolecularDescriptor
      Returns:
      the short name used in text outputs (tables etc.)
    • getParametersClassName

      public String getParametersClassName()
      Gets the name of the parameters class corresponding to the descriptor.
      Overrides:
      getParametersClassName in class MolecularDescriptor
      Returns:
      the name of the parameters class
    • setParameters

      public void setParameters(String parameters) throws MDParametersException
      Sets the parameters of an already created ShapeDescriptor object.
      Specified by:
      setParameters in class MolecularDescriptor
      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 a MolecularDescriptor instance into an external format that can be stored in a database.
      Specified by:
      toData in class MolecularDescriptor
      Returns:
      binary representation of the descriptor
    • fromData

      public void fromData(byte[] dbRepr)
      Description copied from class: MolecularDescriptor
      Builds a MolecularDescriptor object from its external (database) representation.
      Specified by:
      fromData in class MolecularDescriptor
      Parameters:
      dbRepr - an array generated by toData()
    • toString

      public String toString()
      Description copied from class: MolecularDescriptor
      Creates the string representation of a MolecularDescriptor 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 class MolecularDescriptor
      Returns:
      a formatted string of the descriptor
    • toDecimalString

      public String toDecimalString()
      Description copied from class: MolecularDescriptor
      Creates the string representation of a MolecularDescriptor object. This string value contains all values of the descriptor (including all zeros), values are separated by tabs.
      Specified by:
      toDecimalString in class MolecularDescriptor
      Returns:
      a formatted string of the descriptor
    • fromString

      public void fromString(String descr) throws ParseException
      Description copied from class: MolecularDescriptor
      Builds a molecular descriptor from its string representation. Typically used when SDfile is read.
      Specified by:
      fromString in class MolecularDescriptor
      Parameters:
      descr - descriptor string, previously generated by toString()
      Throws:
      ParseException
    • toFloatArray

      public float[] toFloatArray()
      Description copied from class: MolecularDescriptor
      Creates the float array representation of a MolecularDescriptor object. This array contains all values of the descriptor (including all zeros) in the elements of the array.
      Specified by:
      toFloatArray in class MolecularDescriptor
      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 class MolecularDescriptor
      Parameters:
      descr - descriptor represented in a float array (e.g. generated by toFloatArray())
    • toBinaryString

      public String toBinaryString()
      Description copied from class: MolecularDescriptor
      Creates the binary string representation of a MolecularDescriptor object.
      Overrides:
      toBinaryString in class MolecularDescriptor
      Returns:
      a 0,1 string of the descriptor
    • getDissimilarityMetrics

      public String[] 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 class MolecularDescriptor
      Returns:
      the metrics array
    • getDissimilarity

      public float getDissimilarity(MolecularDescriptor other)
      Description copied from class: MolecularDescriptor
      Calculates the dissimilarity ratio between two MolecularDescriptor objects using the default metric. Default metric is set in the corresponding MDParameters object. In the case of asymmetric distances swapping the two descriptors can make a big difference.
      Specified by:
      getDissimilarity in class MolecularDescriptor
      Parameters:
      other - the query descriptor with initialized Similarity3d object.
      Returns:
      the dissimilarity
    • getShapeSimilarity

      public float getShapeSimilarity(MolecularDescriptor other)
      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.
      Parameters:
      other - the query descriptor with initialized Similarity3d obj.
      Returns:
      the histogram similarity (h) where 0\<= h
    • getDissimilarity

      public float getDissimilarity(MolecularDescriptor other, int parametrizedMetricIndex)
      Description copied from class: MolecularDescriptor
      Calculates the dissimilarity between two MolecularDescriptor objects using the specified metric, apart from that it is the same as getDissimilarity( final MolecularDescriptor other ).
      Specified by:
      getDissimilarity in class MolecularDescriptor
      Parameters:
      other - a descriptor, to which the dissimilarity ratio is measured
      parametrizedMetricIndex - the index of the parameterized metric to used
      Returns:
      dissimilarity ratio
      See Also:
    • getAliasNames

      public List<String> getAliasNames()