Class ScalarDescriptor

    • Field Detail

      • descrValue

        protected float descrValue
        descriptor value
    • Constructor Detail

      • ScalarDescriptor

        public ScalarDescriptor()
        Creates a new, empty instance of ScalarDescriptor.
      • ScalarDescriptor

        public ScalarDescriptor​(SDParameters params)
        Creates a new instance of ScalarDescriptor according to the parameters given.
        Parameters:
        params - parameters settings
      • ScalarDescriptor

        public ScalarDescriptor​(String params)
        Creates a new instance of ScalarDescriptor according to the parameters given.
        Parameters:
        params - parameter string
      • ScalarDescriptor

        public ScalarDescriptor​(ScalarDescriptor sd)
        Copy constructor. An identical copy of the descriptor passed is created. The old and the new instances share the same SDParameters object.
        Parameters:
        sd - a ScalarDescriptor to be copied
    • Method Detail

      • getName

        public String getName()
        Gets the name of the ScalarDescriptor object. The name is not the same as the class name, but a nicer, readable and more meaningful for end-users.
        Overrides:
        getName in class MolecularDescriptor
        Returns:
        the nice external name for ScalarDescriptor class objects
      • getShortName

        public String getShortName()
        Gets the short name of the descriptor.
        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​(MDParameters parameters)
        Sets parameters, allocates internal storage if needed and cleans the descriptor.
        Overrides:
        setParameters in class MolecularDescriptor
        Parameters:
        parameters - fingerprint parameters
      • toData

        public byte[] toData()
        Converts a ScalarDescriptor object into an array of bytes. This format can be reffered to as an "external representation" since it servers as the data format for storing scalar descriptors in databases.
        Use the fromData() method to build the scalar descriptor from this "external" representation.
        Specified by:
        toData in class MolecularDescriptor
        Returns:
        byte array representation of the descriptor object
      • fromData

        public void fromData​(byte[] dbRepr)
        Builds a descriptor from an external data format, created by a previous call to toData().
        Specified by:
        fromData in class MolecularDescriptor
        Parameters:
        dbRepr - "external" representation of the ScalarDescriptor object
      • toFloatArray

        public final float[] toFloatArray()
        Creates the float array representation of the descriptor.
        Specified by:
        toFloatArray in class MolecularDescriptor
        Returns:
        a float array of one element
      • clear

        public void clear()
        Clears the descritor: sets its value to zero value.
      • toString

        public final String toString()
        Converts the descriptor value into a readable string. This is the default external text format.
        Specified by:
        toString in class MolecularDescriptor
        Returns:
        string representation of the descriptor value
      • toDecimalString

        public String toDecimalString()
        Converts the descriptor value into a readable string. This is the default external text format.
        Specified by:
        toDecimalString in class MolecularDescriptor
        Returns:
        string representation of the descriptor value
      • set

        public void set​(float newValue)
        Set the value of the descriptor.
        Parameters:
        newValue - the value to be set
      • generate

        public String[] generate​(Molecule m)
                          throws MDGeneratorException
        Creates the ScalarDescriptor descriptor for the given Molecule. Side-effect!!!!!! Standardizes the input molecule (as defined in MDParameters).
        Overrides:
        generate in class MolecularDescriptor
        Returns:
        property names set in the molecule passed during generation
        Throws:
        MDGeneratorException - when failed to generate descriptor
      • getDefaultDissimilarityMetricThresholds

        public float[] getDefaultDissimilarityMetricThresholds()
        Gets the default dissimilarity threshold values for all dissimilarity metrics defined.
        Specified by:
        getDefaultDissimilarityMetricThresholds in class MolecularDescriptor
        Returns:
        array of dissimilarity threshold values
      • getDefaultThreshold

        public float getDefaultThreshold​(int metricIndex)
        Gets a metric dependent default threshold value.
        Overrides:
        getDefaultThreshold in class MolecularDescriptor
        Parameters:
        metricIndex - index of a parameterized metric
      • getDissimilarity

        public float getDissimilarity​(MolecularDescriptor sd)
        Calculates the dissimilarity between two scalar descriptor using the default metrics In the present implementation it is always the absolute difference between them.
        Specified by:
        getDissimilarity in class MolecularDescriptor
        Parameters:
        sd - a scalar descriptor value
        Returns:
        dissimilarity value
      • getDissimilarity

        public float getDissimilarity​(MolecularDescriptor sd,
                                      int metricIndex)
        Calculates the dissimilarity between two scalar descriptor using the specified metric.
        Specified by:
        getDissimilarity in class MolecularDescriptor
        Parameters:
        sd - a scalar descriptor
        metricIndex - index of the metric to be used
        Returns:
        the dissimilarity ratio
        See Also:
        MDParameters, PFParameters
      • getLowerBound

        public float getLowerBound​(MolecularDescriptor sd)
        Calculates the lower bound estimate of the dissimilarity from the given descriptor.
        Overrides:
        getLowerBound in class MolecularDescriptor
        Parameters:
        sd - a descriptor value
        Returns:
        always returns 0