@PublicAPI public class ScalarDescriptor extends MolecularDescriptor
Modifier and Type | Field and Description |
---|---|
protected float |
descrValue
descriptor value
|
params
Constructor and Description |
---|
ScalarDescriptor()
Creates a new, empty instance of ScalarDescriptor.
|
ScalarDescriptor(ScalarDescriptor sd)
Copy constructor.
|
ScalarDescriptor(SDParameters params)
Creates a new instance of ScalarDescriptor according to the parameters given.
|
ScalarDescriptor(java.lang.String params)
Creates a new instance of ScalarDescriptor according to the
parameters given.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the descritor: sets its value to zero value.
|
MolecularDescriptor |
clone()
Creates a new instance with identical internal state.
|
void |
fromData(byte[] dbRepr)
Builds a descriptor from an external data format, created by a previous
call to
toData() . |
void |
fromFloatArray(float[] descr)
Builds the descriptor from a float array of one element.
|
void |
fromString(java.lang.String sd)
Builds a descriptpr from its string representation created by
toString() . |
java.lang.String[] |
generate(Molecule m)
Creates the ScalarDescriptor descriptor for the given Molecule.
|
float[] |
getDefaultDissimilarityMetricThresholds()
Gets the default dissimilarity threshold values for all dissimilarity
metrics defined.
|
float |
getDefaultThreshold(int metricIndex)
Gets a metric dependent default threshold value.
|
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.
|
float |
getDissimilarity(MolecularDescriptor sd,
int metricIndex)
Calculates the dissimilarity between two scalar descriptor using the
specified metric.
|
java.lang.String[] |
getDissimilarityMetrics()
Gets the dissimilarity metric names
|
float |
getLowerBound(MolecularDescriptor sd)
Calculates the lower bound estimate of the dissimilarity from the given
descriptor.
|
java.lang.String |
getName()
Gets the name of the ScalarDescriptor object.
|
java.lang.String |
getParametersClassName()
Gets the name of the parameters class corresponding to the descriptor.
|
java.lang.String |
getShortName()
Gets the short name of the descriptor.
|
void |
set(float newValue)
Set the value of the descriptor.
|
void |
setParameters(MDParameters parameters)
Sets parameters, allocates internal storage if needed and cleans
the descriptor.
|
void |
setParameters(java.lang.String parameters)
Sets the parameters of an already created
ScalarDescriptor object. |
byte[] |
toData()
Converts a
ScalarDescriptor object into an array of bytes. |
java.lang.String |
toDecimalString()
Converts the descriptor value into a readable string.
|
float[] |
toFloatArray()
Creates the float array representation of the descriptor.
|
java.lang.String |
toString()
Converts the descriptor value into a readable string.
|
generate, getAtomSetColors, getAtomSetIndexes, getAtomSetNames, getDefaultMetricIndex, getDissimilarityMetricIndex, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getParameters, getThreshold, getThreshold, main, needsConfig, newInstance, newInstance, newInstanceFromXML, newInstanceSupplier, setScreeningConfiguration, toBinaryString
public ScalarDescriptor()
public ScalarDescriptor(SDParameters params)
params
- parameters settingspublic ScalarDescriptor(java.lang.String params)
params
- parameter stringpublic ScalarDescriptor(ScalarDescriptor sd)
SDParameters
object.sd
- a ScalarDescriptor to be copiedpublic MolecularDescriptor clone()
clone
in class MolecularDescriptor
public java.lang.String getName()
getName
in class MolecularDescriptor
public java.lang.String getShortName()
getShortName
in class MolecularDescriptor
public java.lang.String getParametersClassName()
getParametersClassName
in class MolecularDescriptor
public void setParameters(MDParameters parameters)
setParameters
in class MolecularDescriptor
parameters
- fingerprint parameterspublic void setParameters(java.lang.String parameters) throws MDParametersException
ScalarDescriptor
object.setParameters
in class MolecularDescriptor
parameters
- parameter settings for the descriptorMDParametersException
- any XML errorpublic byte[] toData()
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.
fromData()
method to build the scalar descriptor
from this "external" representation.toData
in class MolecularDescriptor
public void fromData(byte[] dbRepr)
toData()
.fromData
in class MolecularDescriptor
dbRepr
- "external" representation of the ScalarDescriptor
objectpublic final float[] toFloatArray()
toFloatArray
in class MolecularDescriptor
public void fromFloatArray(float[] descr) throws java.lang.RuntimeException
fromFloatArray
in class MolecularDescriptor
descr
- descriptor stored in a (one element) float arrayjava.lang.RuntimeException
public void clear()
public final java.lang.String toString()
toString
in class MolecularDescriptor
public java.lang.String toDecimalString()
toDecimalString
in class MolecularDescriptor
public final void fromString(java.lang.String sd) throws java.text.ParseException
toString()
.fromString
in class MolecularDescriptor
sd
- descriptor value as stringjava.text.ParseException
public void set(float newValue)
newValue
- the value to be setpublic java.lang.String[] generate(Molecule m) throws MDGeneratorException
MDParameters
).generate
in class MolecularDescriptor
MDGeneratorException
- when failed to generate descriptorpublic java.lang.String[] getDissimilarityMetrics()
getDissimilarityMetrics
in class MolecularDescriptor
public float[] getDefaultDissimilarityMetricThresholds()
getDefaultDissimilarityMetricThresholds
in class MolecularDescriptor
public float getDefaultThreshold(int metricIndex)
getDefaultThreshold
in class MolecularDescriptor
metricIndex
- index of a parameterized metricpublic float getDissimilarity(MolecularDescriptor sd)
getDissimilarity
in class MolecularDescriptor
sd
- a scalar descriptor valuepublic float getDissimilarity(MolecularDescriptor sd, int metricIndex)
getDissimilarity
in class MolecularDescriptor
sd
- a scalar descriptormetricIndex
- index of the metric to be usedMDParameters
,
PFParameters
public float getLowerBound(MolecularDescriptor sd)
getLowerBound
in class MolecularDescriptor
sd
- a descriptor value