Package chemaxon.descriptors
Class PFParameters
java.lang.Object
chemaxon.descriptors.MDParameters
chemaxon.descriptors.PFParameters
Manages 2D pharmacophore fingerprint parameters. This class has multiple
 roles: 1. reads, stores and provides parameters for 
PharmacophoreFingerprint ;
 and 2. acts as a shared memory area of all PharmacophoreFingerprint instances.
 This latter serves pure running-time and storage efficiency needs by removing
 redundant data from PharmacophoreFingerprint objects and easing the communication
 (that is passing data) between parts of the program. Example for these
 include the following data members: compressedData, xyz, asymmetricXYZSum.
 Most of these members have public access for the sake of ease. (The
 use of private access members and the introduction of corresponding
 setter/getter methods would not increase the safety (or any other quality)
 quality of the code at all (as they would not add any further functionality,
 than the mere change or retrieval of the value, which can now be done
 directly).)- Since:
- JChem 2.2
- 
Field SummaryFieldsModifier and TypeFieldDescriptionfloatStores last calculatred asymmetric Tanimoto sum.protected chemaxon.pharmacophore.ColorDecoderatom set colorsprotected byte[][]Buffer for compressed data, used inMolecularDescriptor.toData( final int[] ).static final floatstatic final floatstatic final intstatic final intdefault valuesstatic final Stringprotected ArrayListfuzziness factors of parametrized metricsprotected float[][]fuzzi exponent for the FBPA metric, calculated from the fuzziness factorprotected float[][]Fuzzy smoothing values for gaussian smoothing.protected String[]Pharmacophore point type names.protected float[][][]Fuzzy smoothing values for smoothing with user defined smoothing vector.float[]ThecalculateXYZ()methods (in PharmacophoreFingerprint sub-classes) calculate three numbers (denoted by x,y and z), but methods in java cannot have output parameters.Fields inherited from class chemaxon.descriptors.MDParametersasymmetryFactors, 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 SummaryConstructorsConstructorDescriptionCreates an empty object.PFParameters(File configFile) Creates a new object based on a given configuration file.PFParameters(String XMLconfig) Creates a new object based on a given configuration string.
- 
Method SummaryModifier and TypeMethodDescriptionprotected intappendParametrizedMetric(String name, String metric) Extends internal data with a new parametrized metric.voidSets parameters from an XML file.voidfromString(String parameterString) Sets parameters from a string representation.protected String[]generate(Molecule m, MolecularDescriptor cd) Calls the correspondingMolecularDescriptorGeneratorand generates the descriptor for the given molecule.Color[]Gets the coloring of atoms as defined in the XML configuration file.int[]Gets the individual atom colors by pharmcophore point type.String[]Gets the name of atom sets (pharmacophore point type set), as defined in the configuration file/string.float[]getCustomFuzzyIncrements(int fa, int fb) Gets fuzzy increments for the fuzzy smoothing with a user-defined custom distribution (fuzzy smoothing vector).Gets the default XML configuration string.static StringGets the default configuration of the standardizer.float[][]Gets the precalculated fuzzy exponent used in the Fuzzy Bipolar Autocorrelogram (FBPA) metric.floatfloatGets the fuzzy smoothing factor used in the construction of fuzzy fingerprints.float[][]Gets fuzzy increments for the fuzzy smoothing with a normal distribution.booleanintGets the miximum distance of pharmacophore points that is considered.intGets the minimum distance of pharmacophore points that is considered.intGets the number of histograms bars, that is that number of distance values disguished.intThe number of pharmacophore features (aka types, properties) used in the fingerprints.protected intgetNumberOfWeights(int parametrizedMetricIndex) Gets the number of weight factors used by the specified metric.chemaxon.pharmacophore.PSymbolsGets the pharmacophore type symbols used in the current configuration.intGets the resolution of histograms.getSymbol(int i) Gets the symbol associated with the specified Pharmacophore.intgetSymbolIndex(String symbol) Gets the index associated with the specified Pharmacophore symbol.protected booleanimportNodes(org.dom4j.Document doc, boolean merge) Imports nodes from the specifiedDocumentinto the current (main)Document.protected voidinit()Initializes the object.protected voidCreates and initializes aPFGeneratorinstance.protected voidInitializes those data members that depend on the XML configuration but are not directly taken from it.booleanGets whether the fuzzy fingerprints are used or not.booleanGets if fuzzy smmoothing is based on normal distribution.booleanprotected voidprocessDocument(boolean all) Searches the DOM tree for relevant nodes and sets internal variables to some these nodes for the sake of easier information processing.protected voidProcesses allParametrizedMetricnodes in the DOM tree.protected voidreadMetricWeights(org.dom4j.Element parametrizedMetric, int metricIndex) protected voidreadValues(boolean all) Picks attribute values from the document tree that are relevant to the actualMDParameterssub-class.voidsetCurrentParametrizedMetric(int metricIndex) Selects a metric to be used.voidsetFuzzinessFactor(float alpha) Sets the value of the fuzziness factor, used in fuzzy bipolar pharmacophore autocorrelogram (FBPA) based convolution product in non-parametrized (generic) FBPA metric.voidsetFuzzyCutOff(float fco) voidsetFuzzyLowerBound(int flb) voidsetFuzzySmoothingFactor(float fsf) Sets the value of the fuzzy smoothing factor used in the generation of fuzzy fingerprints.voidsetIgnoreRotatableBonds(boolean irb) voidsetParameters(File parametersFile) Sets parameters from an XML file representation overwriting all previous settings with the new ones.voidsetParameters(String parametersString) Sets parameters from an XML string representation overwriting all previous parameters settings with the new ones.voidsetPMAPTagName(String tagName) Sets the name of the pharmacophore map tag to be considered in the input SDfile.voidsetSymmetricalFuzzy(boolean sf) voidsetUsePMAP(String pmapTagName) Pharmacophore map data in imported Molecule-s should be used.voidsetWeights(float[] featureWeights, float[] distanceWeights) Sets the cell-wise weight factors for the current parametrized metric.toString()Returns the XML configuration in a string.inttripletIndex(int f1, int f2, int d) Calculates the index of a feature pair and distance triplet in the linearised representation of histograms.Methods inherited from class chemaxon.descriptors.MDParametersaddParameters, addParameters, addParametrizedMetric, addParametrizedMetricNode, addParametrizedMetricsNode, checkDocumentVersion, getAsymmetryFactor, getCellSize, getCurrentMetricIndex, getData, getDecForm, getDescriptorTypeName, getInternalMetricIndex, getInternalSize, getLength, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getScaleFactor, getScalingHypothesis, getScreeningConfigurationString, getThreshold, getThreshold, getTverskyAlpha, getTverskyBeta, getWeights, isAsymmetric, isCellwiseWeights, isNormalized, isScaled, isStandardizationMandatory, isWeighted, readFromXmlFile, readFromXmlString, setAsymmetryFactor, setCellSize, setCellwiseWeights, setCreateStatistics, setLength, setNormalized, setOutputPrecision, setScaleFactor, setScalingHypothesis, setThreshold, setWeights, standardize, toString, writeMetricParameter
- 
Field Details- 
DEFAULT_RESOLUTIONpublic static final int DEFAULT_RESOLUTIONdefault values- See Also:
 
- 
DEFAULT_FUZZINESS_FACTORpublic static final float DEFAULT_FUZZINESS_FACTOR- See Also:
 
- 
DEFAULT_FUZZY_CUTOFFpublic static final float DEFAULT_FUZZY_CUTOFF- See Also:
 
- 
DEFAULT_FUZZY_LOWER_BOUNDpublic static final int DEFAULT_FUZZY_LOWER_BOUND- See Also:
 
- 
DEFAULT_XML_CONFIG- See Also:
 
- 
fuzzinessFactorsfuzziness factors of parametrized metrics
- 
fuzzyExpprotected float[][] fuzzyExpfuzzi exponent for the FBPA metric, calculated from the fuzziness factor
- 
colDecprotected chemaxon.pharmacophore.ColorDecoder colDecatom set colors
- 
pptNamesPharmacophore point type names. These are similar to the above coloring scheme, though instead of colors, this array contains the IDs of pharmacophore point types as defined in the XML configuration. Tha names of combined types (e.g. d - (Donor Minus) are obtained by concatenating the corresponding IDs.
- 
gFuzzyIncrementsprotected float[][] gFuzzyIncrementsFuzzy smoothing values for gaussian smoothing. The first index is the number of rotatable bonds while the second is the distance value. For the sake of efficiency, distances from 0 to maxDist() are stored.
- 
svFuzzyIncrementsprotected float[][][] svFuzzyIncrementsFuzzy smoothing values for smoothing with user defined smoothing vector. The first and the second indexes are the pharmacophore point type indexes the third is the distance value.
- 
compressedDataprotected byte[][] compressedDataBuffer for compressed data, used inMolecularDescriptor.toData( final int[] ). Element 'i' is either null or is an array of 'i' bytes.
- 
xyzpublic float[] xyzThecalculateXYZ()methods (in PharmacophoreFingerprint sub-classes) calculate three numbers (denoted by x,y and z), but methods in java cannot have output parameters. We could (1) pass an array of three elements, but in that case the array was either a data member of PharmacophoreFingerprint, which has to be avoided in order to keep the size of a descriptor as small as possible; or alternatively (2) the array could be allocated in the caller ofcalculateXYZ()each time, which clearly had time and storage overhead. Keeping a preallocated instance in parameters is efficient though apparently not nice in terms of object oriented principles.
- 
asymmetricXYZSumpublic float asymmetricXYZSumStores last calculatred asymmetric Tanimoto sum.
 
- 
- 
Constructor Details- 
PFParameterspublic PFParameters()Creates an empty object. UsesetConfig( String paramString )to initialize it properly.
- 
PFParametersCreates a new object based on a given configuration file.- Parameters:
- configFile- XML configuration file
- Throws:
- MDParametersException- missing or bad XML configuration
 
- 
PFParametersCreates a new object based on a given configuration string.- Parameters:
- XMLconfig- XML configuration string
- Throws:
- MDParametersException- missing or bad XML configuration
 
 
- 
- 
Method Details- 
fromStringSets parameters from a string representation. This method processes an XML format, but derived classes may overload this and define their own format.- Overrides:
- fromStringin class- MDParameters
- Parameters:
- parameterString- parameters in string
- Throws:
- MDParametersException- when the parameter string is not well-formed
 
- 
fromFileSets parameters from an XML file. Derived classes may overload this and define their own format (even other than XML).- Overrides:
- fromFilein class- MDParameters
- Parameters:
- parameterFile- initialized configuration file
- Throws:
- MDParametersException- failed to process parameter file
 
- 
toStringReturns the XML configuration in a string.- Overrides:
- toStringin class- MDParameters
- Returns:
- configuration string in XML format
 
- 
setParametersSets parameters from an XML string representation overwriting all previous parameters settings with the new ones.- Overrides:
- setParametersin class- MDParameters
- Parameters:
- parametersString- parameters in string
- Throws:
- MDParametersException- when the parameter string is not well-formed
 
- 
setParametersSets parameters from an XML file representation overwriting all previous settings with the new ones.- Overrides:
- setParametersin class- MDParameters
- Parameters:
- parametersFile- parameter configuration file
- Throws:
- MDParametersException- when the parameter string is not well-formed
 
- 
initprotected void init()Initializes the object. Only those fundamental data members are set that do not depend on the XML configuration.
- 
initGeneratorCreates and initializes aPFGeneratorinstance. The generator is stored in theMDParametersin order to spare memory space: thePFParameterobject is shared among multiple instances ofPharmacophoreFingerprint, thus they refer to the same generator object too via theparametersfield.- Throws:
- MDParametersException
 
- 
initParametersprotected void initParameters()Initializes those data members that depend on the XML configuration but are not directly taken from it.- Overrides:
- initParametersin class- MDParameters
 
- 
generateCalls the correspondingMolecularDescriptorGeneratorand generates the descriptor for the given molecule. Note, that it is the responsibility of subclasses to initialize the generator upfront any call to this function.- Parameters:
- m- a molecular structure
- cd- the chemical 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
 
- 
setCurrentParametrizedMetricpublic void setCurrentParametrizedMetric(int metricIndex) Selects a metric to be used. When a metric is selected all properties and related parameters can be retrieved with the getter methods of this class.- Overrides:
- setCurrentParametrizedMetricin class- MDParameters
- Parameters:
- metricIndex- index of a parametrized metric to be used
 
- 
setFuzzySmoothingFactorpublic void setFuzzySmoothingFactor(float fsf) Sets the value of the fuzzy smoothing factor used in the generation of fuzzy fingerprints. The smoothing process fits a Guassian curve to all values to be put into histogram bins, and this value is the standard deviation of the corresponding normal distribution.- Parameters:
- fsf- the fuzzy smoothing factor
 
- 
setFuzzyCutOffpublic void setFuzzyCutOff(float fco) 
- 
setFuzzyLowerBoundpublic void setFuzzyLowerBound(int flb) 
- 
setSymmetricalFuzzypublic void setSymmetricalFuzzy(boolean sf) 
- 
setIgnoreRotatableBondspublic void setIgnoreRotatableBonds(boolean irb) 
- 
setFuzzinessFactorpublic void setFuzzinessFactor(float alpha) Sets the value of the fuzziness factor, used in fuzzy bipolar pharmacophore autocorrelogram (FBPA) based convolution product in non-parametrized (generic) FBPA metric.- Parameters:
- alpha- fuzziness factor used in the convolution product
 
- 
setUsePMAPPharmacophore map data in imported Molecule-s should be used. The generator will not generate PMAP data, but will use the exsiting one.- Parameters:
- pmapTagName- name of the SDfile tag storing the PMAP data
 
- 
setPMAPTagNameSets the name of the pharmacophore map tag to be considered in the input SDfile.- Parameters:
- tagName- name of the SDfile tag that stores pharmacophore map
 
- 
setWeightspublic void setWeights(float[] featureWeights, float[] distanceWeights) Sets the cell-wise weight factors for the current parametrized metric.- Parameters:
- featureWeights- weights for each pharmacophore type
- distanceWeights- weights for each point pair distance
 
- 
getNumberOfFeaturespublic int getNumberOfFeatures()The number of pharmacophore features (aka types, properties) used in the fingerprints.- Returns:
- number of pharmacophore features
 
- 
getPSymbolspublic chemaxon.pharmacophore.PSymbols getPSymbols()Gets the pharmacophore type symbols used in the current configuration.- Returns:
- pharmacophore symbols
 
- 
getSymbolGets the symbol associated with the specified Pharmacophore.- Parameters:
- i- index of the pharmacophore property (feature)
- Returns:
- the symbol string of the feature
 
- 
getSymbolIndexGets the index associated with the specified Pharmacophore symbol.- Parameters:
- symbol- pharmacophore property (feature) symbol
- Returns:
- the index of the feature, -1 if not found
- Throws:
- IllegalArgumentException
 
- 
getMinDistpublic int getMinDist()Gets the minimum distance of pharmacophore points that is considered.- Returns:
- value of minimal distance
 
- 
getMaxDistpublic int getMaxDist()Gets the miximum distance of pharmacophore points that is considered.- Returns:
- value of miximal distance
 
- 
getResolutionpublic int getResolution()Gets the resolution of histograms. THe resolution is the width of a histogram bin, that is the distance values considered to be indistinguishable.- Returns:
- value of the current resolution
 
- 
getNDistspublic int getNDists()Gets the number of histograms bars, that is that number of distance values disguished.- Returns:
- hte number of ditance values in one histogram
 
- 
getNumberOfWeightsGets the number of weight factors used by the specified metric. This method can be applied to the dissimilarity metrics provided by theMolecularDescriptorclass or its derived classes, but not to parametrized metric.- Overrides:
- getNumberOfWeightsin class- MDParameters
- Parameters:
- parametrizedMetricIndex- parametrized metric index
- Returns:
- number of weights the metric uses
- Throws:
- IllegalArgumentException- if the given parameter is not a valid metric index
 
- 
isFuzzyFingerprintpublic boolean isFuzzyFingerprint()Gets whether the fuzzy fingerprints are used or not.- Returns:
- fuzzy flag
 
- 
isGaussianSmoothingpublic boolean isGaussianSmoothing()Gets if fuzzy smmoothing is based on normal distribution.- Returns:
- true if smoothing has gaussian
 
- 
getFuzzySmoothingFactorpublic float getFuzzySmoothingFactor()Gets the fuzzy smoothing factor used in the construction of fuzzy fingerprints.- Returns:
- the fuzzy smoothing factor
 
- 
isSymmetricalFuzzypublic boolean isSymmetricalFuzzy()
- 
getIgnoreRotatableBondspublic boolean getIgnoreRotatableBonds()
- 
getFuzzyLowerBoundpublic float getFuzzyLowerBound()
- 
getDefaultStandardizerConfigurationGets the default configuration of the standardizer. This method is called if no standardizer configuration is set in the parameters configuration. The default standardization forPharmacophoreFingerprintincludes aromatization and the removal of small disjoint fragments (largest component is kept only).- Returns:
- standardizer confiuration XML string
- Since:
- JChem 2.3
 
- 
getDefaultDocumentFrameGets the default XML configuration string. This is needed when the PharmacophoreFingerprint XML configuration is not specified.- Overrides:
- getDefaultDocumentFramein class- MDParameters
- Returns:
- default XML configuration string of the PFParameters class
- Since:
- JChem 2.3
 
- 
getGaussianFuzzyIncrementspublic float[][] getGaussianFuzzyIncrements()Gets fuzzy increments for the fuzzy smoothing with a normal distribution. The first index of the raturned array is the number of rotatable bonds, while the second is the distance of the two pharmacophoric points considered. These values represent a normal distribution with a standard deviation equal to the product of the number of rotatable bonds plus one and the fuzzy smoothing factor. Therefore, the more rotatable bonds are found between the two pharmacophoric point, the larger the deviation of the normal distribution is (the wider and flatter the Gaussian curve is). Note, that the normal distribution is standard (its peek is in zero), and that only the right hand side of the curve is returned (the left is a mirror image).- Returns:
- fuzzy increments
 
- 
getCustomFuzzyIncrementspublic float[] getCustomFuzzyIncrements(int fa, int fb) Gets fuzzy increments for the fuzzy smoothing with a user-defined custom distribution (fuzzy smoothing vector).- Parameters:
- fa- pharmacophore point type of the first component of the pair
- fb- pharmacophore point type of the second component of the pair
- Returns:
- fuzzy increments
 
- 
getFuzzyExponentspublic float[][] getFuzzyExponents()Gets the precalculated fuzzy exponent used in the Fuzzy Bipolar Autocorrelogram (FBPA) metric.- Returns:
- fuzzy exponents
 
- 
getAtomSetColorsGets the coloring of atoms as defined in the XML configuration file.- Returns:
- array of colors of different pharmacophore point types
 
- 
getAtomSetNamesGets the name of atom sets (pharmacophore point type set), as defined in the configuration file/string.- Returns:
- names of pharmacophore point types
 
- 
getAtomSetIndexesGets the individual atom colors by pharmcophore point type. This method is implemented in this class because it calls the pharmacophore fingerprint generator.- Parameters:
- m- a molecule to assign pharmacophore point colors to
- Returns:
- array of color indexes indexed by atom indexes
 
- 
processDocumentDescription copied from class:MDParametersSearches the DOM tree for relevant nodes and sets internal variables to some these nodes for the sake of easier information processing.- Overrides:
- processDocumentin class- MDParameters
- Parameters:
- all- process the complete document or only the- ScreeningConfigurationtag
- Throws:
- MDParametersException
 
- 
readValuesDescription copied from class:MDParametersPicks attribute values from the document tree that are relevant to the actualMDParameterssub-class.- Overrides:
- readValuesin class- MDParameters
- Parameters:
- all- process the complete document or only the- ScreeningConfigurationtag
- Throws:
- MDParametersException
 
- 
readMetricParametersDescription copied from class:MDParametersProcesses allParametrizedMetricnodes in the DOM tree. Reads parameterized metric names and associated parameter setting and stores them in data member for faster and easier access in getter methods.- Overrides:
- readMetricParametersin class- MDParameters
- Throws:
- MDParametersException- if one of the nodes is not well-formed
 
- 
readMetricWeightsprotected void readMetricWeights(org.dom4j.Element parametrizedMetric, int metricIndex) throws MDParametersException - Overrides:
- readMetricWeightsin class- MDParameters
- Throws:
- MDParametersException
 
- 
appendParametrizedMetricDescription copied from class:MDParametersExtends internal data with a new parametrized metric. Neither the DOM tree nor the XML document is modified.- Overrides:
- appendParametrizedMetricin class- MDParameters
- Parameters:
- name- name of the parametrized metric
- metric- dissimilarity metric name (as defined in its implementor class
 
- 
importNodesprotected boolean importNodes(org.dom4j.Document doc, boolean merge) Description copied from class:MDParametersImports nodes from the specifiedDocumentinto the current (main)Document. New nodes can either merged into the existing ones without removing them, or new nodes may overwrite exisiting nodes.- Overrides:
- importNodesin class- MDParameters
- Parameters:
- doc- import nodes from this document
- merge- merge (add new) or overwrite (replace with new) existing nodes
 
- 
tripletIndexpublic int tripletIndex(int f1, int f2, int d) Calculates the index of a feature pair and distance triplet in the linearised representation of histograms. Features are ordered as described above.- Parameters:
- f1- index of the first feature
- f2- index of the other feature
- d- distance value
- Returns:
- the index of the triplet
 
 
-