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.@Beta @PublicAPI public interface DescriptorGenerator<B extends Descriptor> extends Serializable, DescriptorSerializer<B>
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.
Guarded.EnsureThat, Guarded.New
Modifier and Type | Method and Description |
---|---|
ComparisonContextFactory<? extends DescriptorComparator<B>,B,? extends Serializable> |
comparisonContextFactory()
Get an unguarded context factory.
|
DescriptorComparator<B> |
defaultComparison()
Default comparator.
|
B |
generateDescriptor(Molecule mol)
Calculates the associated descriptor for the given Molecule.
|
B |
getBareDescriptor(B descriptor)
Get bare-only form of a descriptor.
|
DescriptorComparator<B> |
getDefaultComparator()
Deprecated.
This method is kept for compatibility reason. Use
ComparisonContext#descriptorComparator() on
the instance returned by MetricFactory.defaultComparison() from
comparisonContextFactory() |
DescriptorParameters |
getParameters()
Gets the parameter object.
|
fromByteArray, fromString, serializerIsEqualWith, toByteArray, toString
getGuardObject
B generateDescriptor(Molecule mol)
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)
.
mol
- Input moleculegetBareDescriptor(com.chemaxon.descriptors.common.Descriptor)
on either the rich or the
bare representation.IllegalArgumentException
- when an underlying problem occurs during descriptor generation (eg. an
exception thrown from some lower level calculation)B getBareDescriptor(B descriptor)
descriptor
- A descriptor's rich or bare formDescriptorParameters getParameters()
ComparisonContextFactory<? extends DescriptorComparator<B>,B,? extends Serializable> comparisonContextFactory()
byte []
serialization based unguarded representation.
Implementations are expected to provide additional factory methods for unguarded and plain descriptor comparators for implemented metrics.
@Deprecated DescriptorComparator<B> getDefaultComparator()
ComparisonContext#descriptorComparator()
on
the instance returned by MetricFactory.defaultComparison()
from
comparisonContextFactory()
DescriptorComparator<B> defaultComparison()