Package chemaxon.descriptors
Class ECFPParameters
java.lang.Object
chemaxon.descriptors.MDParameters
chemaxon.descriptors.ECFPParameters
Manages ECFP fingerprint parameters. This class reads, stores and provides
parameters for
ECFP
class. These parameters together are
called the ECFP fingerprint configuration. The native format of such
configuration is XML.- Since:
- JChem 5.4
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
default values for parametersFields inherited from class chemaxon.descriptors.MDParameters
asymmetryFactors, cellSize, cellwiseWeights, configFilePath, currentMetricIndex, data, decForm, DEFAULT_ASYMMETRY_FACTOR, DEFAULT_OUTPUT_PRECISION, DEFAULT_SCALE_FACTOR, DEFAULT_WEIGHT, defaultWeight, document, generator, internalSize, length, md, metricIndexes, normalized, outputPrecision, parametrizedMetricNodes, parametrizedMetrics, parametrizedMetricsNode, scaleFactors, screeningConfigurationNode, similarityNode, standardizer, standardizerConfigurationNode, thresholds, tverskyA, tverskyB, weights
-
Constructor Summary
ConstructorDescriptionCreates an empty object.ECFPParameters
(File configFile) Creates a new object based on a given configuration file.ECFPParameters
(String XMLconfig) Creates a new object based on a given configuration string. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets parameters from an XML file.void
fromString
(String parameterString) Sets parameters from a string representation.protected String[]
generate
(Molecule m, MolecularDescriptor ecfp) CallsECFPGenerator
and generates the descriptor for the given molecule.Get the default XML configuration string.static String
Gets the default configuration of the standardizer.int
Gets the preset diameter parameter.boolean
Gets the counts (multiplicity) parameter.protected int
getNumberOfWeights
(int parametrizedMetricIndex) Gets the number of weight factors used by the specified metric.protected void
init()
This method is called by the constructors before processing the XML configuration.protected void
Initializes the fingerprint generator.protected void
Initializes those data members that depend on the XML configuration but are not directly taken from it.protected void
processDocument
(boolean all) Processes pars of the XML configuration specific toECFP
.protected void
readValues
(boolean all) Picks parameter values from the DOM tree.void
setDiameter
(int diameter) Sets the diameter parameter.void
setKeepCounts
(boolean keepCounts) Sets the counts (multiplicity) parameter.void
setLength
(int length) Sets the length (number of cells) of the descriptor.Methods inherited from class chemaxon.descriptors.MDParameters
addParameters, addParameters, addParametrizedMetric, addParametrizedMetricNode, addParametrizedMetricsNode, appendParametrizedMetric, checkDocumentVersion, getAsymmetryFactor, getCellSize, getCurrentMetricIndex, getData, getDecForm, getDescriptorTypeName, getInternalMetricIndex, getInternalSize, getLength, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getScaleFactor, getScalingHypothesis, getScreeningConfigurationString, getThreshold, getThreshold, getTverskyAlpha, getTverskyBeta, getWeights, importNodes, isAsymmetric, isCellwiseWeights, isNormalized, isScaled, isStandardizationMandatory, isWeighted, readFromXmlFile, readFromXmlString, readMetricParameters, readMetricWeights, setAsymmetryFactor, setCellSize, setCellwiseWeights, setCreateStatistics, setCurrentParametrizedMetric, setNormalized, setOutputPrecision, setParameters, setParameters, setScaleFactor, setScalingHypothesis, setThreshold, setWeights, standardize, toString, toString, writeMetricParameter
-
Field Details
-
DEFAULT_LENGTH
public static final int DEFAULT_LENGTHdefault values for parameters- See Also:
-
DEFAULT_DIAMETER
public static final int DEFAULT_DIAMETER- See Also:
-
-
Constructor Details
-
ECFPParameters
public ECFPParameters()Creates an empty object. Initializes fingerprint parameters to default values. -
ECFPParameters
Creates a new object based on a given configuration file.- Parameters:
configFile
- XML configuration file- Throws:
MDParametersException
- missing or bad XML configuration
-
ECFPParameters
Creates a new object based on a given configuration string.- Parameters:
XMLconfig
- XML configuration string- Throws:
MDParametersException
- missing or bad XML configuration
-
-
Method Details
-
fromString
Sets parameters from a string representation. This method processes an XML format, but derived classes may overload this and define their own format.- Overrides:
fromString
in classMDParameters
- Parameters:
parameterString
- parameters in string- Throws:
MDParametersException
- when the parameter string is not well-formed
-
fromFile
Sets parameters from an XML file. Derived classes may overload this and define their own format (even other than XML).- Overrides:
fromFile
in classMDParameters
- Parameters:
parameterFile
- initialized parameter file- Throws:
MDParametersException
- failed to process parameter file
-
setLength
Description copied from class:MDParameters
Sets the length (number of cells) of the descriptor.- Overrides:
setLength
in classMDParameters
- Parameters:
length
- the required length (cell count)- Throws:
MDParametersException
- if argument is not positive
-
setDiameter
public void setDiameter(int diameter) Sets the diameter parameter. It specifies the diameter of the circular neighborhood considered for each atom. -
getDiameter
public int getDiameter()Gets the preset diameter parameter. It specifies the diameter of the circular neighborhood considered for each atom.- Returns:
- the diameter parameter
-
setKeepCounts
public void setKeepCounts(boolean keepCounts) Sets the counts (multiplicity) parameter. It controls whether the generated identifiers are stored with occurrence counts or each identifier is kept only once independently of the number of the corresponding substructural features in the input molecule.- Parameters:
keepCounts
- counts parameter
-
getKeepCounts
public boolean getKeepCounts()Gets the counts (multiplicity) parameter. It controls whether the generated identifiers are stored with occurrence counts or each identifier is kept only once independently of the number of the corresponding substructural features in the input molecule.- Returns:
- counts parameter
-
initGenerator
Initializes the fingerprint generator.- Throws:
MDParametersException
-
init
protected void init()This method is called by the constructors before processing the XML configuration. It creates aECFP
object stored inMDParameters.md
. -
initParameters
protected void initParameters()Initializes those data members that depend on the XML configuration but are not directly taken from it.- Overrides:
initParameters
in classMDParameters
-
generate
CallsECFPGenerator
and generates the descriptor for the given molecule.- Parameters:
m
- a molecular structureecfp
- the ECFP descriptor generated for the given molecule, an output parameter- Returns:
- names of Molecule Property-s (SDfile tags) set by the generator
- Throws:
MDGeneratorException
- when failed to generate descriptor
-
getNumberOfWeights
Gets the number of weight factors used by the specified metric. This method can be applied to the dissimilarity metrics provided by theMolecularDescriptor
class or its derived classes, but not to parametrized metric.- Overrides:
getNumberOfWeights
in classMDParameters
- Parameters:
parametrizedMetricIndex
- parametrized metric index- Returns:
- number of weights the metric uses
- Throws:
IllegalArgumentException
- if the given parameter is not a valid metric index
-
getDefaultDocumentFrame
Get the default XML configuration string. This is needed when the optional ECFP XML configuration is not specified.- Overrides:
getDefaultDocumentFrame
in classMDParameters
- Returns:
- default XML configuration string of the ECFPParameters class
-
getDefaultStandardizerConfiguration
Gets the default configuration of the standardizer. This method is called if no standardizer configuration is set in the parameters configuration. The default standardization forECFP
includes aromatization.- Returns:
- standardizer configuration XML string
-
processDocument
Processes pars of the XML configuration specific toECFP
. Find thenode in the DOM tree and leaves the rest of the work to the parent class. - Overrides:
processDocument
in classMDParameters
- Parameters:
all
- indicates if the entire document has to be processed in which case the existing configuration is overwritten- Throws:
MDParametersException
-
readValues
Picks parameter values from the DOM tree.- Overrides:
readValues
in classMDParameters
- Parameters:
all
- indicates if the entire document has to be processed in which case the existing configuration is overwritten- Throws:
MDParametersException
-