Package chemaxon.descriptors
Class MDSet
java.lang.Object
chemaxon.descriptors.MDSet
MDset combines several MolecularDescriptors 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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMDSet()Creates an emptyMDSetobject.MDSet(int nComponents) Creates an emptyMDSetobject capable of stroring a given number ofMolecularDescriptorcomponents.MDSet(int nComponents, int nUserData) Creates an emptyMDSetobject capable of stroring a given number ofMolecularDescriptorcomponents and the given number of user defined (external) data.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDescriptor(MolecularDescriptor descriptor) Appends the next component to theMDSetobject.clone()Clones the object.voidGenerates theMDSetfrom the given molecular structure.getDescriptor(int index) Gets a specified component of theMDSet.floatgetDissimilarity(MDSet other) Calculates the dissimilarity between twoMDSetobjects.intgetId()Gets the identifier of theMDSet.floatGives a lower bound estimation for the value ofgetDissimilarity( final Object o ).Gets the natural identifier of the sourceMoleculeof theMDSet.Gets the current parameter settings.float[]Deprecated, for removal: This API element is subject to removal in a future version.since 2.3floatgetUserData(int index) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3static MDSetnewInstance(String[] componentTypes) Gets a newMDSetinstance constituted of the specified components.static MDSetnewInstance(String[] componentTypes, File[] params) Gets a newMDSetinstance constituted of the specified components.static MDSetnewInstance(String[] componentTypes, String[] params) Gets a newMDSetinstance constituted of the specified components.voidsetDescriptor(int componentIndex, MolecularDescriptor md) Sets a given component of theMDSet.voidsetDescriptors(MolecularDescriptor[] descriptors) Sets all components of theMDSet.voidsetId(int id) Sets the unique internal idenifier of theMDSetobject.voidsetNaturalId(String id) Sets the natural idenifier of theMDSetobject.voidsetParameters(MDSetParameters params) Sets the parameters of theMDSet.voidsetSize(int nComponents) Sets the number ofMolecularDescriptorcomponents in theMDSet.voidsetSize(int nComponents, int nUserData) Sets the number ofMolecularDescriptorcomponents and the number of user defined (external) data in theMDSet.voidsetUserData(float[] userData) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3voidsetUserData(int dataIndex, float userData) Deprecated, for removal: This API element is subject to removal in a future version.since 2.3intsize()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 emptyMDSetobject. 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- aMDSetobject to be copied
-
MDSet
public MDSet(int nComponents) Creates an emptyMDSetobject capable of stroring a given number ofMolecularDescriptorcomponents. 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 emptyMDSetobject capable of stroring a given number ofMolecularDescriptorcomponents 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 newMDSetinstance constituted of the specified components. MDSetParameters are set to default.- Parameters:
componentTypes- type names of the components- Returns:
- a new object
-
newInstance
Gets a newMDSetinstance 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 newMDSetinstance 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 ofMolecularDescriptorcomponents and the number of user defined (external) data in theMDSet.- Parameters:
nComponents- number of components in theMDSetobjectnUserData- number of further floating point values
-
setSize
public void setSize(int nComponents) Sets the number ofMolecularDescriptorcomponents in theMDSet.- Parameters:
nComponents- number of components in theMDSetobject
-
setId
public void setId(int id) Sets the unique internal idenifier of theMDSetobject.- Parameters:
id- unique identifier
-
getId
public int getId()Gets the identifier of theMDSet.- Returns:
- the identifier
-
setNaturalId
Sets the natural idenifier of theMDSetobject. This identifier is taken from aMolecule(from an SDfile tag).- Parameters:
id- unique identifier
-
getNaturalId
Gets the natural identifier of the sourceMoleculeof theMDSet.- Returns:
- the identifier
-
setParameters
Sets the parameters of theMDSet. Note, that this has no effect on the parameters of individualMolecularDescriptorcomponents 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 theMDSetobject.- Parameters:
descriptor- the next component of theMDSet
-
setDescriptors
Sets all components of theMDSet.- Parameters:
descriptors-MDSetcomponents, they are not cloned
-
setDescriptor
Sets a given component of theMDSet.- Parameters:
componentIndex- index of the component to be setmd- theMolecularDescriptortype 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 theMDSetfrom 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 twoMDSetobjects. The dissimilarity value is the weighted sum of the component-wise dissimilarity values.- Parameters:
other- aMDSetobject whichthisis compared to Its type isObjectin order to implement theClusterableinterface.- 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 theClusterableinterface.- Parameters:
o-MDSetobject to whichthisis compated Its type isObjectin order to implement theClusterableinterface.- 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
-