Package chemaxon.descriptors
Class MDSet
java.lang.Object
chemaxon.descriptors.MDSet
MDset
combines several MolecularDescriptor
s into
one entity. The purpose of this class is to allow dissimilarity calculations
being performed on various MolecularDescriptors
simultaneously.
This improves the predictive power of individual descriptors and is more
efficient than doing it one-by-one.
MDSet
objects can be compared against each other by dissimilarity
metrics. The dissimilarity coefficient is obtained as the weighted sum of the
dissimilarity coefficients of the pair-wise comparison of components. Weights
are stored in the MDSetParameters
class, aggregated by this
class.
MDSet
instances are associated with (and calculated from) molecular
structures. This connection between the orginal Molecule
and its
MDSet
objects is preserved by the unique identifier of the
molecule which is stored in the MDSet
object too.
Besides
MolecularDescriptor
components, and MDSet
object can take an arbitrary number of external, user defined float values.
Typically, these are calculated by third party software and stored in SDfile
tags or database columns. These values are used in dissimilarity calculations
but they are never modified.
Remark: the term Set is slightly misleading since components constituting the
MDSet
are ordered. Tuple or Record would be
more appropriate though probably quite unusual in a cheminformatics
context.- Since:
- JChem 2.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMDSet()
Creates an emptyMDSet
object.MDSet
(int nComponents) Creates an emptyMDSet
object capable of stroring a given number ofMolecularDescriptor
components.MDSet
(int nComponents, int nUserData) Creates an emptyMDSet
object capable of stroring a given number ofMolecularDescriptor
components and the given number of user defined (external) data.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescriptor
(MolecularDescriptor descriptor) Appends the next component to theMDSet
object.clone()
Clones the object.void
Generates theMDSet
from the given molecular structure.getDescriptor
(int index) Gets a specified component of theMDSet
.float
getDissimilarity
(MDSet other) Calculates the dissimilarity between twoMDSet
objects.int
getId()
Gets the identifier of theMDSet
.float
Gives a lower bound estimation for the value ofgetDissimilarity( final Object o )
.Gets the natural identifier of the sourceMolecule
of theMDSet
.Gets the current parameter settings.float[]
Deprecated, for removal: This API element is subject to removal in a future version.since 2.3float
getUserData
(int index) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3static MDSet
newInstance
(String[] componentTypes) Gets a newMDSet
instance constituted of the specified components.static MDSet
newInstance
(String[] componentTypes, File[] params) Gets a newMDSet
instance constituted of the specified components.static MDSet
newInstance
(String[] componentTypes, String[] params) Gets a newMDSet
instance constituted of the specified components.void
setDescriptor
(int componentIndex, MolecularDescriptor md) Sets a given component of theMDSet
.void
setDescriptors
(MolecularDescriptor[] descriptors) Sets all components of theMDSet
.void
setId
(int id) Sets the unique internal idenifier of theMDSet
object.void
setNaturalId
(String id) Sets the natural idenifier of theMDSet
object.void
setParameters
(MDSetParameters params) Sets the parameters of theMDSet
.void
setSize
(int nComponents) Sets the number ofMolecularDescriptor
components in theMDSet
.void
setSize
(int nComponents, int nUserData) Sets the number ofMolecularDescriptor
components and the number of user defined (external) data in theMDSet
.void
setUserData
(float[] userData) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3void
setUserData
(int dataIndex, float userData) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3int
size()
Gets the number of components constituting theMDSet
.
-
Field Details
-
dissim
public float dissimdissimilarity measured against an other set
-
-
Constructor Details
-
MDSet
public MDSet()Creates an emptyMDSet
object. It can be initialized by callingsetSize( int nComponents )
andsetParameters( final MDSetParameters params )
. -
MDSet
Copy constructor. Creates an identical object, in which components are cloned, but parameters are not cloned.- Parameters:
c
- aMDSet
object to be copied
-
MDSet
public MDSet(int nComponents) Creates an emptyMDSet
object capable of stroring a given number ofMolecularDescriptor
components. Components should be added bysetDescriptor( final MolecularDescriptor descriptor )
.- Parameters:
nComponents
- number of components in the MDSet object
-
MDSet
public MDSet(int nComponents, int nUserData) Creates an emptyMDSet
object capable of stroring a given number ofMolecularDescriptor
components and the given number of user defined (external) data. Components should be added bysetDescriptor( final MolecularDescriptor descriptor )
.- Parameters:
nComponents
- number of components in the MDSet objectnUserData
- number of further floating point values
-
-
Method Details
-
newInstance
Gets a newMDSet
instance constituted of the specified components. MDSetParameters are set to default.- Parameters:
componentTypes
- type names of the components- Returns:
- a new object
-
newInstance
Gets a newMDSet
instance constituted of the specified components. Components are parametrized with the given parameter settings.- Parameters:
componentTypes
- type names of the componentsparams
- parameter strings- Returns:
- a new object; or null, if the required class could not be instanciated
-
newInstance
Gets a newMDSet
instance constituted of the specified components. Components are parametrized from the given parameter files.- Parameters:
componentTypes
- type names of the componentsparams
- parameter files- Returns:
- a new object; or null, if the required class could not be instanciated
-
clone
Clones the object. -
setSize
public void setSize(int nComponents, int nUserData) Sets the number ofMolecularDescriptor
components and the number of user defined (external) data in theMDSet
.- Parameters:
nComponents
- number of components in theMDSet
objectnUserData
- number of further floating point values
-
setSize
public void setSize(int nComponents) Sets the number ofMolecularDescriptor
components in theMDSet
.- Parameters:
nComponents
- number of components in theMDSet
object
-
setId
public void setId(int id) Sets the unique internal idenifier of theMDSet
object.- Parameters:
id
- unique identifier
-
getId
public int getId()Gets the identifier of theMDSet
.- Returns:
- the identifier
-
setNaturalId
Sets the natural idenifier of theMDSet
object. This identifier is taken from aMolecule
(from an SDfile tag).- Parameters:
id
- unique identifier
-
getNaturalId
Gets the natural identifier of the sourceMolecule
of theMDSet
.- Returns:
- the identifier
-
setParameters
Sets the parameters of theMDSet
. Note, that this has no effect on the parameters of individualMolecularDescriptor
components in theMDSet
.- Parameters:
params
- new parameters for thisMDSet
.
-
getParameters
Gets the current parameter settings.- Returns:
- the parameters of the
MDSet
-
addDescriptor
Appends the next component to theMDSet
object.- Parameters:
descriptor
- the next component of theMDSet
-
setDescriptors
Sets all components of theMDSet
.- Parameters:
descriptors
-MDSet
components, they are not cloned
-
setDescriptor
Sets a given component of theMDSet
.- Parameters:
componentIndex
- index of the component to be setmd
- theMolecularDescriptor
type of the specified component
-
size
public int size()Gets the number of components constituting theMDSet
.- Returns:
- number of component
-
getDescriptor
Gets a specified component of theMDSet
.- Parameters:
index
- component index- Returns:
- the selected component
-
generate
Generates theMDSet
from the given molecular structure.- Parameters:
mol
- the molecule to generate from.- Throws:
MDGeneratorException
- when failed to generate one of the components
-
getDissimilarity
Calculates the dissimilarity between twoMDSet
objects. The dissimilarity value is the weighted sum of the component-wise dissimilarity values.- Parameters:
other
- aMDSet
object whichthis
is compared to Its type isObject
in order to implement theClusterable
interface.- Returns:
- the dissimilarity coefficient calculated
-
getLowerBound
Gives a lower bound estimation for the value ofgetDissimilarity( final Object o )
. This method is implemented due to the services requirements by theClusterable
interface.- Parameters:
o
-MDSet
object to whichthis
is compated Its type isObject
in order to implement theClusterable
interface.- Returns:
- the lower bound estimation of the dissimilarity coefficient
-
setUserData
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setUserData(float[] userData) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3Sets all user defined float values in theMDSet
.- Parameters:
userData
- user defined floating point data values
-
setUserData
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setUserData(int dataIndex, float userData) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3Sets a given user defined float value in theMDSet
.- Parameters:
dataIndex
- index of the data value to be setuserData
- user defined floating point data value
-
getUserData
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public float getUserData(int index) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3Gets the value of a user defined data component.- Parameters:
index
- data component index- Returns:
- value of user defined data component
-
getUserData
Deprecated, for removal: This API element is subject to removal in a future version.since 2.3Gets the value of all user defined data components.- Returns:
- array of values of user defined data components
-