Class OxygenAtomCountDescriptor
- java.lang.Object
-
- org.openscience.cdk.qsar.descriptors.substance.OxygenAtomCountDescriptor
-
- All Implemented Interfaces:
ISubstanceDescriptor
,IDescriptor
public class OxygenAtomCountDescriptor extends Object implements ISubstanceDescriptor
Descriptor that returns the number of oxygens in the chemical formula. Originally aimed at metal oxide nanoparticles [Liu, R. et. al.. Small. 2011. 7].- Author:
- egonw
- Source code:
- main
-
-
Constructor Summary
Constructors Constructor Description OxygenAtomCountDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DescriptorValue
calculate(ISubstance substance)
Calculates the descriptor value for the givenISubstance
.String[]
getDescriptorNames()
Returns an array of names for each descriptor value calculated.IDescriptorResult
getDescriptorResultType()
Returns the specific type of the DescriptorResult object.String[]
getParameterNames()
Returns the names of the parameters for this descriptor.Object[]
getParameters()
Returns the current parameter values.Object
getParameterType(String substance)
Returns a class matching that of the parameter with the given name.DescriptorSpecification
getSpecification()
Returns aIImplementationSpecification
which specifies which descriptor is implemented by this class.void
initialise(IChemObjectBuilder builder)
Initialise the descriptor with the specified chem object builder.void
setParameters(Object[] parameters)
Sets the parameters for this descriptor.
-
-
-
Method Detail
-
getDescriptorNames
public String[] getDescriptorNames()
Returns an array of names for each descriptor value calculated. Many descriptors return multiple values. In general it is useful for the descriptor to indicate the names for each value. In many cases, these names can be as simple as X1, X2, ..., XN where X is a prefix and 1, 2, ..., N are the indices. On the other hand it is also possible to return other arbitrary names, which should be documented in the Javadocs for the descriptor (e.g., the CPSA descriptor). Note that by default if a descriptor returns a single value (such asALOGPDescriptor
the return array will have a single element- Specified by:
getDescriptorNames
in interfaceIDescriptor
- Returns:
- An array of descriptor names, equal in length to the number of descriptor calculated..
-
getParameterNames
public String[] getParameterNames()
Returns the names of the parameters for this descriptor. The method returns null or a zero-length Object[] array if the descriptor does not have any parameters.- Specified by:
getParameterNames
in interfaceIDescriptor
- Returns:
- An array of String containing the names of the parameters that this descriptor can accept.
-
getParameterType
public Object getParameterType(String substance)
Returns a class matching that of the parameter with the given name. May only return null for when 'name' does not match any parameters returned by the getParameters() method.- Specified by:
getParameterType
in interfaceIDescriptor
- Parameters:
substance
- The name of the parameter whose type is requested- Returns:
- An Object of the class corresponding to the parameter with the supplied name
-
getParameters
public Object[] getParameters()
Returns the current parameter values. If not parameters have been set, it must return the default parameters. The method returns null or a zero-length Object[] array if the descriptor does not have any parameters.- Specified by:
getParameters
in interfaceIDescriptor
- Returns:
- An array of Object containing the parameter default values
- See Also:
IDescriptor.setParameters(java.lang.Object[])
-
getSpecification
public DescriptorSpecification getSpecification()
Returns aIImplementationSpecification
which specifies which descriptor is implemented by this class. These fields are used in the map:- Specification-Reference: refers to an entry in a unique dictionary
- Implementation-Title: anything
- Implementation-Identifier: a unique identifier for this version of this class
- Implementation-Vendor: CDK, JOELib, or anything else
- Specified by:
getSpecification
in interfaceIDescriptor
- Returns:
- An object containing the descriptor specification
-
setParameters
public void setParameters(Object[] parameters) throws CDKException
Sets the parameters for this descriptor. Must be done before calling calculate as the parameters influence the calculation outcome.- Specified by:
setParameters
in interfaceIDescriptor
- Parameters:
parameters
- An array of Object containing the parameters for this descriptor- Throws:
CDKException
- if invalid number of type of parameters are passed to it- See Also:
IDescriptor.getParameters()
-
calculate
public DescriptorValue calculate(ISubstance substance)
Calculates the descriptor value for the givenISubstance
.- Specified by:
calculate
in interfaceISubstanceDescriptor
- Parameters:
substance
- AnISubstance
for which this descriptor should be calculated- Returns:
- An object of
DescriptorValue
that contain the calculated value as well as specification details
-
getDescriptorResultType
public IDescriptorResult getDescriptorResultType()
Returns the specific type of the DescriptorResult object. The return value from this method really indicates what type of result will be obtained from theDescriptorValue
object. Note that the same result can be achieved by interrogating theDescriptorValue
object; this method allows you to do the same thing, without actually calculating the descriptor.Additionally, the length indicated by the result type must match the actual length of a descriptor calculated with the current parameters. Typically, the length of array result types vary with the values of the parameters. See
IDescriptor
for more details.- Specified by:
getDescriptorResultType
in interfaceISubstanceDescriptor
- Returns:
- an object that implements the
IDescriptorResult
interface indicating the actual type of values returned by the descriptor in theDescriptorValue
object
-
initialise
public void initialise(IChemObjectBuilder builder)
Initialise the descriptor with the specified chem object builder. This allows descriptors that required domain objects, such as for SMARTS queries to initialise correctly. If you do not need domain objects then this method does not need to be implemented.- Specified by:
initialise
in interfaceIDescriptor
- Parameters:
builder
- chem object builder to use with this descriptor
-
-