Interface DescriptorGenerator<B extends Descriptor>

Type Parameters:
B - Represented bare descriptor type. Note that rich descriptor type is not referenced in this level. Rich descriptor type is only introduced by the implementations.
All Superinterfaces:
DescriptorSerializer<B>, Guarded, Serializable
All Known Subinterfaces:
BvGenerator, CfpGenerator, EcfpGenerator, FvGenerator, MaccsGenerator, PfGenerator
All Known Implementing Classes:
AbstractShapeGenerator

@Beta @PublicApi public interface DescriptorGenerator<B extends Descriptor> extends Serializable, DescriptorSerializer<B>
DescriptorGenerator implements molecule to descriptor calculation functionality.

An instance of DescriptorGenerator represents a specific molecular descriptor with a specific settings.

The generated descriptors can have two representations: rich and bare. Both representations are consistent with each other in terms of comparison. The rich form might provide additional details of the descriptor itself. These additional details are not preserved during serialization; so deserialization is possible only into the bare form. Note that it is possible for a DescriptorGenerator to not distinguish between rich and bare descriptors.

For example, structure based descriptors are represented as a feature ID list or binary fingerprints. The features themself are considered as such additional details. The underlying "bare" representation itself is suitable for comparison and memory efficient storage.

Note that serialization must preserve guard objects returned by Guarded.getGuardObject().

Please note that this interface is marked with Beta annotation, so it can be subject of incompatible changes or removal in later releases.

  • Method Details

    • generateDescriptor

      B generateDescriptor(Molecule mol)
      Calculates the associated descriptor for the given Molecule.

      Note that different descriptors/application scenarios might need different structure standardization. Currently structure standardization is generally not in the scope of the responsibilities of DescriptorGenerator to the possible maximal extent.

      Since the returned descriptor might contain additional data (reference to input Molecule, etc) if it is stored for later comparison it is recommended to use the bare-only representation returned by getBareDescriptor(com.chemaxon.descriptors.common.Descriptor).

      Parameters:
      mol - Input molecule
      Returns:
      The calculated descriptor. If the implementation discriminates between rich and bare types then the rich type is returned, otherwise the bare type. Note that the bare type is always available using getBareDescriptor(com.chemaxon.descriptors.common.Descriptor) on either the rich or the bare representation.
      Throws:
      IllegalArgumentException - when an underlying problem occurs during descriptor generation (eg. an exception thrown from some lower level calculation)
    • getBareDescriptor

      B getBareDescriptor(B descriptor)
      Get bare-only form of a descriptor.
      Parameters:
      descriptor - A descriptor's rich or bare form
      Returns:
      Bare-only representation of given descriptor
    • getParameters

      DescriptorParameters getParameters()
      Gets the parameter object.
      Returns:
      paramater obj
    • comparisonContextFactory

      com.chemaxon.descriptors.common.comparison.ComparisonContextFactory<? extends DescriptorComparator<B>,B,? extends Serializable> comparisonContextFactory()
      Get an unguarded context factory. For internal use only.

      Implementations are supposed to provide space/processing efficient unguarded representation if applicable. Otherwise it is possible to expose byte [] serialization based unguarded representation.

      Implementations are expected to provide additional factory methods for unguarded and plain descriptor comparators for implemented metrics.

      Returns:
      an unguarded context factory
    • defaultComparison

      DescriptorComparator<B> defaultComparison()
      Default comparator.
      Returns:
      Default comparator