|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.descriptors.MolecularDescriptor
public abstract class MolecularDescriptor
Generic definition of molecular descriptors. The MolecularDescriptor
class models all kinds of structural keys, fingerprints (hashed,
pharmacophoric), MDL keys and many others which can be implemented in derived
classes, some of these are implemented in JChem.
For the sake of generality the MolecularDescriptor class does
not introduce operations that manipulate descriptors on "atomic"
level, that is, cells (or bins) of descriptors cannot be accesed either for
reading or for writing. This is because cells in various chemical descriptors
can have different type (for example bit, integer or floating point value).
Operations between different MolecularDescriptor derivatives
are not supported, though for the sake of efficiency no extra type checking
is introduced (other than provided by the language itself).
Derived classes should define their own dissimilarity metrics for the sake
of efficiency. This is one reason why this class does not define any
dissimilarity metric; the other is, that different MolecularDescriptor
subclasses may have different representations (for instance integer
array vs. float array).
| Field Summary | |
|---|---|
protected MDParameters |
params
Parameter settings related to the descriptor. |
| Constructor Summary | |
|---|---|
MolecularDescriptor()
Default constructor, creates an empty object. |
|
MolecularDescriptor(MDParameters parameters)
Creates a new MolecularDescriptor with the given
parameters. |
|
MolecularDescriptor(MolecularDescriptor c)
Copy constructor, creates am identical copy of the MolecularDescriptor passed as a parameter. |
|
| Method Summary | |
|---|---|
abstract java.lang.Object |
clone()
Creates a new instance with identical internal state. |
abstract void |
fromData(byte[] dbRepr)
Builds a MolecularDescriptor object from its external
(database) representation. |
abstract void |
fromFloatArray(float[] descr)
Builds a molecular descriptor from its float array representation. |
abstract void |
fromString(java.lang.String descr)
Builds a molecular descriptor from its string representation. |
java.lang.String[] |
generate(Molecule m)
Creates the descriptor for the given Molecule. |
java.awt.Color[] |
getAtomSetColors()
Determines the coloring of atoms. |
int[] |
getAtomSetIndexes(Molecule m)
Gets the individual atom color indexes. |
java.lang.String[] |
getAtomSetNames()
|
abstract float[] |
getDefaultDissimilarityMetricThresholds()
Gets the default dissimilarity threshold values for all dissimilarity metrics defined. |
int |
getDefaultMetricIndex()
Gets the index of the default metric. |
float |
getDefaultThreshold(int metricIndex)
Gets a metric dependent default threshold value. |
abstract float |
getDissimilarity(java.lang.Object other)
Calculates the dissimilarity ratio between two MolecularDescriptor
objects using the default metric. |
abstract float |
getDissimilarity(java.lang.Object other,
int parametrizedMetricIndex)
Calculates the dissimilarity between two MolecularDescriptor
objects using the specified metric, apart from that it is the same as
getDissimilarity( final Object other ). |
int |
getDissimilarityMetricIndex(java.lang.String metricName)
Gets the internal index of the given metric. |
abstract java.lang.String[] |
getDissimilarityMetrics()
Gets the dissimilarity metric names in an array. |
float |
getLowerBound(java.lang.Object other)
Calculates an estimate for the minimum value of the distance distance using the default distance metric. |
int |
getMetricIndex(java.lang.String metricName)
Gets the index of the given parametrized metric. |
java.lang.String |
getMetricName()
Gets the name of the current parametrized metric. |
java.lang.String |
getMetricName(int metricIndex)
Gets the name of a metric specified parametrized metric by its index. |
java.lang.String |
getName()
Gets the sname of the descriptor. |
int |
getNumberOfMetrics()
Gets the number of parametrized metrics available for the particular descriptor. |
int |
getNumberOfWeights(java.lang.String dissimilarityMetricName)
Gets the number of weight factors used by the specified metric. |
MDParameters |
getParameters()
Gets the parameters associated with the object. |
java.lang.String |
getParametersClassName()
Gets the name of the parameters class corresponding to the descriptor (prefixed with the package name as getClass().getName() would return). |
java.lang.String |
getShortName()
Gets the short name of the descriptor. |
float |
getThreshold()
Gets threshold value of the current parameterized metric. |
float |
getThreshold(int metricIndex)
Gets a metric dependent default threshold value. |
static void |
main(java.lang.String[] args)
|
boolean |
needsConfig()
Indicates if class takes parameters from configuration file. |
static MolecularDescriptor |
newInstance(java.lang.String descriptorTypeName)
Creates a MolecularDescriptor specified by its name. |
static MolecularDescriptor |
newInstance(java.lang.String descriptorTypeName,
java.lang.String parameters)
Creates a MolecularDescriptor specified by its name and xml parameter. |
static MolecularDescriptor |
newInstanceFromXML(java.lang.String parameters)
Creates a new MolecularDescriptor instance according to the given parameter string. |
void |
setParameters(MDParameters parameters)
Sets the parameters for an already created MolecularDescriptor. |
abstract void |
setParameters(java.lang.String parameters)
Sets the parameters for an already created MolecularDescriptor. |
void |
setScreeningConfiguration(java.lang.String config)
Sets the screening configuration. |
java.lang.String |
toBinaryString()
Creates the binary string representation of a MolecularDescriptor
object. |
abstract byte[] |
toData()
Converts the internal (memory) representation of a MolecularDescriptor instance into an external format that
can be stored in a database. |
abstract java.lang.String |
toDecimalString()
Creates the string representation of a MolecularDescriptor
object. |
abstract float[] |
toFloatArray()
Creates the float array representation of a MolecularDescriptor
object. |
abstract java.lang.String |
toString()
Creates the string representation of a MolecularDescriptor
object. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected MDParameters params
MolecularDescriptor class with the same parameter setting
share a common MDParameter object, however
MolecularDescriptor objects having different parameters
are also allowed in the same application.
MDParameters can be specialized with inheritance, thus
classes derived from MolecularDescriptor are recommended
to derive their own MDParameters sub-clusses.
| Constructor Detail |
|---|
public MolecularDescriptor(MDParameters parameters)
MolecularDescriptor with the given
parameters.
parameters - parameter settings of the descriptor to be createdpublic MolecularDescriptor()
public MolecularDescriptor(MolecularDescriptor c)
MolecularDescriptor passed as a parameter.
c - a MolecularDescriptor to be copied| Method Detail |
|---|
public static final MolecularDescriptor newInstance(java.lang.String descriptorTypeName,
java.lang.String parameters)
descriptorTypeName - predefined type name or class name
If the name doesn't match any of the predefined names,
it's assumed that it's a class name
parameters xml parameter configuration
public static final MolecularDescriptor newInstance(java.lang.String descriptorTypeName)
descriptorTypeName - predefined type name or class name
If the name doesn't match any of the predefined names,
it's assumed that it's a class name
public static final MolecularDescriptor newInstanceFromXML(java.lang.String parameters)
parameters - XML configuration string
public abstract java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String getName()
public java.lang.String getShortName()
public java.lang.String getParametersClassName()
public void setParameters(MDParameters parameters)
MolecularDescriptor.
parameters - parameter settings of the descriptor to be created
public abstract void setParameters(java.lang.String parameters)
throws chemaxon.descriptors.MDParametersException
MolecularDescriptor.
parameters - parameter settings of the descriptor
chemaxon.descriptors.MDParametersExceptionpublic MDParameters getParameters()
public boolean needsConfig()
public void setScreeningConfiguration(java.lang.String config)
throws chemaxon.descriptors.MDParametersException
config - screening configuraton string
chemaxon.descriptors.MDParametersExceptionpublic abstract byte[] toData()
MolecularDescriptor instance into an external format that
can be stored in a database.
public abstract void fromData(byte[] dbRepr)
MolecularDescriptor object from its external
(database) representation.
dbRepr - an array generated by toData()public abstract java.lang.String toString()
MolecularDescriptor
object. This string value is stored in SDfiles, though the use of this
string is not limited to this purpose. Typically, this string is compact,
for instance zero values are not necessarily printed.
toString in class java.lang.Objectpublic abstract java.lang.String toDecimalString()
MolecularDescriptor
object. This string value contains all values of the descriptor
(including all zeros), values are separated by tabs.
public java.lang.String toBinaryString()
MolecularDescriptor
object.
public abstract void fromString(java.lang.String descr)
throws java.text.ParseException
descr - descriptor string, previously generated by toString()
java.text.ParseExceptionpublic abstract float[] toFloatArray()
MolecularDescriptor
object. This array contains all values of the descriptor
(including all zeros) in the elements of the array.
public abstract void fromFloatArray(float[] descr)
descr - descriptor represented in a float array
(e.g. generated by toFloatArray())
public java.lang.String[] generate(Molecule m)
throws chemaxon.descriptors.MDGeneratorException
chemaxon.descriptors.MDGeneratorException - when failed to generate descriptorpublic java.awt.Color[] getAtomSetColors()
getAtomSetColors() to obtain the current coloring
scheme.
Typically, the colorig scheme is defined in the MDParameters
object associated with the MolecularDescriptor object.
public java.lang.String[] getAtomSetNames()
public int[] getAtomSetIndexes(Molecule m)
MolecularDescriptor. Prior to this method,
getAtomSetColors() has to be called to obtain a color array.
This method returns a per atom color index array and the returned
indexes refer to to the color array returned by getAtomSetColors.
m - a molecule to assign atom colors to
public abstract java.lang.String[] getDissimilarityMetrics()
public abstract float[] getDefaultDissimilarityMetricThresholds()
public int getDissimilarityMetricIndex(java.lang.String metricName)
throws java.lang.IllegalArgumentException
metricName - name of a metric
java.lang.IllegalArgumentException
public int getNumberOfWeights(java.lang.String dissimilarityMetricName)
throws java.lang.IllegalArgumentException
MolecularDescriptor class or its derived classes, but not
to parametrized metric.
dissimilarityMetricName - name as returned by
getDissimilarityMetrics()
java.lang.IllegalArgumentException - if the given parameter is not a valid
metric namepublic int getNumberOfMetrics()
public int getMetricIndex(java.lang.String metricName)
throws java.lang.IllegalArgumentException
metricName - name of a metric
java.lang.IllegalArgumentException - when given metric name is not validpublic float getDefaultThreshold(int metricIndex)
metricIndex - index of a parametrized metricpublic float getThreshold(int metricIndex)
metricIndex - index of a parametrized metricpublic float getThreshold()
public java.lang.String getMetricName()
public java.lang.String getMetricName(int metricIndex)
metricIndex - metric index
public int getDefaultMetricIndex()
MolecularDescriptor.
public abstract float getDissimilarity(java.lang.Object other)
MolecularDescriptor
objects using the default metric.
Default metric is set in the corresponding MDParameters
object.
In the case of assymetric distances swapping the two descriptors can
make a big difference.
getDissimilarity in interface chemaxon.stat.Diffableother - a descriptor, to which the dissimilarity ratio is measured
public abstract float getDissimilarity(java.lang.Object other,
int parametrizedMetricIndex)
MolecularDescriptor
objects using the specified metric, apart from that it is the same as
getDissimilarity( final Object other ).
other - a descriptor, to which the dissimilarity ratio is measuredparametrizedMetricIndex - the index of the parametrized metric to used
MDParameters,
PFParameterspublic float getLowerBound(java.lang.Object other)
chemaxon.stat.Diffable for further explanation.
getLowerBound in interface chemaxon.stat.Diffablepublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||