|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.descriptors.MolecularDescriptor
chemaxon.descriptors.CustomDescriptor
public class CustomDescriptor
The CustomDescriptor class implements a generic molecular
descriptor class which supports third party or use defined descriptors.
Such descriptors can be used throughout the entire JChem system as any other
MolecularDescriptor with only one exception: they cannot be
generated by this class, they must be provided
by the user of this class. CustomDescriptor supports the
management (storage/retrival) and dissimilarity calculations of such
descriptors. These descriptors can have three distinct types: float, int or
binary, their dimension is not limited. All metrics implemented in the
class are supported
and can be optimized.
Metrics
| Field Summary | |
|---|---|
protected float[] |
floatDescr
storage for the floating point descriptors |
protected int[] |
intDescr
storage for the integer or binary descriptors |
| Fields inherited from class chemaxon.descriptors.MolecularDescriptor |
|---|
params |
| Constructor Summary | |
|---|---|
CustomDescriptor()
Creates a new, empty instance of CustomDescriptor without allocating internal storage for its value. |
|
CustomDescriptor(CDParameters params)
Creates a new instance of CustomDescriptor according to the parameters given. |
|
CustomDescriptor(CustomDescriptor cd)
Copy constructor. |
|
CustomDescriptor(int type,
int length)
Creates a new, empty instance of CustomDescriptor and allocates internal storage to store values. |
|
CustomDescriptor(java.lang.String params)
Creates a new instance of CustomDescriptor according to the parameters given. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the descriptor: sets all cells to store zero value. |
CustomDescriptor |
clone()
Creates a new instance with identical internal state. |
void |
fromData(byte[] dbRepr)
Builds a CustomDescriptor from an external data format,
created by a previous call to toData(). |
void |
fromFloatArray(float[] descr)
Builds a molecular descriptor from its float array representation. |
void |
fromString(java.lang.String descr)
Builds a descriptor from its string representation created by toString(). |
float |
getAsymmetricEuclidean(CustomDescriptor f)
Calculates the asymmetric Euclidean distance. |
int |
getBit(int cell)
|
float[] |
getDefaultDissimilarityMetricThresholds()
Gets the default dissimilarity threshold values for all dissimilarity metrics defined. |
float |
getDissimilarity(MolecularDescriptor descr)
Calculates the dissimilarity between two pharmacophore fingerprints using the default distance measure. |
float |
getDissimilarity(MolecularDescriptor descr,
int metricIndex)
Calculates the dissimilarity between two descriptors using the specified parametrized dissimilarity metric. |
java.lang.String[] |
getDissimilarityMetrics()
Gets the dissimilarity metric names. |
float |
getEuclidean(CustomDescriptor f)
Calculates the Euclidean distance. |
float |
getFloat(int cell)
|
int |
getInt(int cell)
|
java.lang.String |
getName()
Gets the name of the CustomDescriptor object. |
java.lang.String |
getParametersClassName()
Gets the name of the parameters class corresponding to the descriptor. |
float |
getScaledTanimoto(CustomDescriptor f)
Gets the Tanimoto dissimilarity coefficient. |
java.lang.String |
getShortName()
Gets the short name of the descriptor. |
float |
getTanimoto(CustomDescriptor f)
Gets the Tanimoto dissimilarity coefficient. |
float |
getWeightedAsymmetricEuclidean(CustomDescriptor f)
Calculates the weighted asymmetric Euclidean distance. |
float |
getWeightedEuclidean(CustomDescriptor f)
Calculates the weighted Euclidean distance. |
void |
set(int cell,
float value)
Sets the value of one cell of the descriptor. |
void |
set(int cell,
float[] values)
Sets values of the descriptor. |
void |
set(int cell,
int value)
Sets the value of one cell of the descriptor. |
void |
set(int cell,
int[] values)
Sets values of the descriptor. |
void |
setParameters(CDParameters parameters)
Sets parameters, allocates internal storage if needed and clears the descriptor. |
void |
setParameters(java.lang.String parameters)
Sets the parameters of an already created CustomDescriptor
object. |
byte[] |
toData()
Converts a CustomDescriptor object into a byte array. |
java.lang.String |
toDecimalString()
Converts the descriptor into a readable string of decimal numbers (float or integer, depending on descriptor type). |
float[] |
toFloatArray()
Creates the float array representation of a CustomDescriptor
object. |
java.lang.String |
toString()
Converts the descriptor into a readable string. |
| Methods inherited from class chemaxon.descriptors.MolecularDescriptor |
|---|
generate, generate, getAtomSetColors, getAtomSetIndexes, getAtomSetNames, getDefaultMetricIndex, getDefaultThreshold, getDissimilarityMetricIndex, getLowerBound, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getParameters, getThreshold, getThreshold, main, needsConfig, newInstance, newInstance, newInstanceFromXML, setParameters, setScreeningConfiguration, toBinaryString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected float[] floatDescr
protected int[] intDescr
| Constructor Detail |
|---|
public CustomDescriptor()
public CustomDescriptor(int type,
int length)
type - type of each cell of the descriptor (binary, int, float)length - size (dimension) of the descriptorpublic CustomDescriptor(CDParameters params)
params - parameter configurationpublic CustomDescriptor(java.lang.String params)
params - parameter configuration (XML) stringpublic CustomDescriptor(CustomDescriptor cd)
CustomDescriptor
object passed is created. The original and the copy share the same
CDParameters object.
cd - descriptor object to be copied| Method Detail |
|---|
public CustomDescriptor clone()
clone in class MolecularDescriptorpublic java.lang.String getName()
CustomDescriptor object. This name is
not the same as the class name, it is nicer, more readable and meaningful
for end-users too.
getName in class MolecularDescriptorCCustomDescriptor class
objectspublic java.lang.String getShortName()
getShortName in class MolecularDescriptorpublic java.lang.String getParametersClassName()
getParametersClassName in class MolecularDescriptorpublic void setParameters(CDParameters parameters)
parameters - descriptor parameters
public void setParameters(java.lang.String parameters)
throws MDParametersException
CustomDescriptor
object.
setParameters in class MolecularDescriptorparameters - parameter settings for the descriptor
MDParametersException - any XML errorpublic byte[] toData()
CustomDescriptor object into a byte array.
This format can be reffered to as an "external representation" since
it servers for storing fingerprints in databases.
fromData() method to build the object from this
"external" representation.
toData in class MolecularDescriptorpublic void fromData(byte[] dbRepr)
CustomDescriptor from an external data format,
created by a previous call to toData().
fromData in class MolecularDescriptordbRepr - "external" representation of CustomDescriptor
public void set(int cell,
float[] values)
cell - the index of the first cell (dimension) to be modifiedvalues - new values to be stored
public void set(int cell,
float value)
cell - the index of the first cell to be modifiedvalue - new value to be stored
public void set(int cell,
int[] values)
cell - the index of the first cell (dimension) to be modifiedvalues - new values to be stored
public void set(int cell,
int value)
cell - the index of the first cell to be modifiedvalue - new value to be storedpublic int getBit(int cell)
public int getInt(int cell)
public float getFloat(int cell)
public void clear()
public java.lang.String toString()
CustomDescriptor.
toString in class MolecularDescriptorpublic java.lang.String toDecimalString()
toDecimalString in class MolecularDescriptor
public void fromString(java.lang.String descr)
throws java.text.ParseException
toString().
fromString in class MolecularDescriptordescr - a custom descriptor string of decimal values
java.text.ParseExceptionpublic float[] toFloatArray()
CustomDescriptor
object. This array contains all values of the descriptor
(including all zeros) in the elements of the array.
toFloatArray in class MolecularDescriptorpublic void fromFloatArray(float[] descr)
fromFloatArray in class MolecularDescriptordescr - descriptor represented in a float arraypublic java.lang.String[] getDissimilarityMetrics()
getDissimilarityMetrics in class MolecularDescriptorpublic float[] getDefaultDissimilarityMetricThresholds()
getDefaultDissimilarityMetricThresholds in class MolecularDescriptorpublic float getTanimoto(CustomDescriptor f)
f - the descriptor form which distance is measured
public float getScaledTanimoto(CustomDescriptor f)
CDParameters
object.
f - the descriptor form which distance is measured
public float getEuclidean(CustomDescriptor f)
f - another fingerprint from which the distance is measured
public float getAsymmetricEuclidean(CustomDescriptor f)
CDParameters
object.
f - another fingerprint from which the distance is measured
public float getWeightedEuclidean(CustomDescriptor f)
CDParameters object.
f - a fingerprint from which the distance is measured
public float getWeightedAsymmetricEuclidean(CustomDescriptor f)
CDParameters
object.
f - a fingerprint from which the distance is measured
public float getDissimilarity(MolecularDescriptor descr)
getDissimilarity in class MolecularDescriptordescr - the other descriptor
public float getDissimilarity(MolecularDescriptor descr,
int metricIndex)
getDissimilarity in class MolecularDescriptordescr - the descriptor from which the distance
is measuredmetricIndex - index of the parametrized metric to be used
MDParameters,
PFParameters
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||