|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.descriptors.MDParameters
chemaxon.descriptors.PFParameters
public class 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).)
| Field Summary | |
|---|---|
float |
asymmetricXYZSum
Stores last calculatred asymmetric Tanimoto sum. |
protected chemaxon.pharmacophore.ColorDecoder |
colDec
atom set colors |
protected byte[][] |
compressedData
Buffer for compressed data, used in MolecularDescriptor.toData(
final int[] ). |
static float |
DEFAULT_FUZZINESS_FACTOR
|
static float |
DEFAULT_FUZZY_CUTOFF
|
static int |
DEFAULT_FUZZY_LOWER_BOUND
|
static int |
DEFAULT_RESOLUTION
default values |
static java.lang.String |
DEFAULT_XML_CONFIG
|
protected java.util.ArrayList |
fuzzinessFactors
fuzziness factors of parametrized metrics |
protected float[][] |
fuzzyExp
fuzzi exponent for the FBPA metric, calculated from the fuzziness factor |
protected float[][] |
gFuzzyIncrements
Fuzzy smoothing values for gaussian smoothing. |
protected java.lang.String[] |
pptNames
Pharmacophore point type names. |
protected float[][][] |
svFuzzyIncrements
Fuzzy smoothing values for smoothing with user defined smoothing vector. |
float[] |
xyz
The calculateXYZ() methods (in PharmacophoreFingerprint sub-classes) calculate
three numbers
(denoted by x,y and z), but methods in java cannot have output parameters. |
| Constructor Summary | |
|---|---|
PFParameters()
Creates an empty object. |
|
PFParameters(java.io.File configFile)
Creates a new object based on a given configuration file. |
|
PFParameters(java.lang.String XMLconfig)
Creates a new object based on a given configuration string. |
|
| Method Summary | |
|---|---|
protected int |
appendParametrizedMetric(java.lang.String name,
java.lang.String metric)
Extends internal data with a new parametrized metric. |
void |
fromFile(java.io.File parameterFile)
Sets parameters from an XML file. |
void |
fromString(java.lang.String parameterString)
Sets parameters from a string representation. |
protected java.lang.String[] |
generate(Molecule m,
MolecularDescriptor cd)
Calls the corresponding MolecularDescriptorGenerator and
generates the descriptor for the given molecule. |
java.awt.Color[] |
getAtomSetColors()
Gets the coloring of atoms as defined in the XML configuration file. |
int[] |
getAtomSetIndexes(Molecule m,
PharmacophoreFingerprint pfp)
Gets the individual atom colors by pharmcophore point type. |
java.lang.String[] |
getAtomSetNames()
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). |
java.lang.String |
getDefaultDocumentFrame()
Gets the default XML configuration string. |
static java.lang.String |
getDefaultStandardizerConfiguration()
Gets the default configuration of the standardizer. |
float[][] |
getFuzzyExponents()
Gets the precalculated fuzzy exponent used in the Fuzzy Bipolar Autocorrelogram (FBPA) metric. |
float |
getFuzzyLowerBound()
|
float |
getFuzzySmoothingFactor()
Gets the fuzzy smoothing factor used in the construction of fuzzy fingerprints. |
float[][] |
getGaussianFuzzyIncrements()
Gets fuzzy increments for the fuzzy smoothing with a normal distribution. |
boolean |
getIgnoreRotatableBonds()
|
int |
getMaxDist()
Gets the miximum distance of pharmacophore points that is considered. |
int |
getMinDist()
Gets the minimum distance of pharmacophore points that is considered. |
int |
getNDists()
Gets the number of histograms bars, that is that number of distance values disguished. |
int |
getNumberOfFeatures()
The number of pharmacophore features (aka types, properties) used in the fingerprints. |
protected int |
getNumberOfWeights(int parametrizedMetricIndex)
Gets the number of weight factors used by the specified metric. |
PSymbols |
getPSymbols()
Gets the pharmacophore type symbols used in the current configuration. |
int |
getResolution()
Gets the resolution of histograms. |
java.lang.String |
getSymbol(int i)
Gets the symbol associated with the specified Pharmacophore. |
int |
getSymbolIndex(java.lang.String symbol)
Gets the index associated with the specified Pharmacophore symbol. |
protected boolean |
importNodes(org.dom4j.Document doc,
boolean merge)
Imports nodes from the specified Document into the current
(main) Document. |
protected void |
init()
Initializes the object. |
protected void |
initGenerator()
Creates and initializes a PFGenerator instance. |
protected void |
initParameters()
Initializes those data members that depend on the XML configuration but are not directly taken from it. |
boolean |
isFuzzyFingerprint()
Gets whether the fuzzy fingerprints are used or not. |
boolean |
isGaussianSmoothing()
Gets if fuzzy smmoothing is based on normal distribution. |
boolean |
isSymmetricalFuzzy()
|
protected void |
processDocument(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 void |
readMetricParameters()
Processes all ParametrizedMetric nodes in the DOM tree. |
protected void |
readMetricWeights(org.dom4j.Element parametrizedMetric,
int metricIndex)
|
protected void |
readValues(boolean all)
Picks attribute values from the document tree that are relevant to the actual MDParameters sub-class. |
void |
setCurrentParametrizedMetric(int metricIndex)
Selects a metric to be used. |
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. |
void |
setFuzzyCutOff(float fco)
|
void |
setFuzzyLowerBound(int flb)
|
void |
setFuzzySmoothingFactor(float fsf)
Sets the value of the fuzzy smoothing factor used in the generation of fuzzy fingerprints. |
void |
setIgnoreRotatableBonds(boolean irb)
|
void |
setParameters(java.io.File parametersFile)
Sets parameters from an XML file representation overwriting all previous settings with the new ones. |
void |
setParameters(java.lang.String parametersString)
Sets parameters from an XML string representation overwriting all previous parameters settings with the new ones. |
void |
setPMAPTagName(java.lang.String tagName)
Sets the name of the pharmacophore map tag to be considered in the input SDfile. |
void |
setSymmetricalFuzzy(boolean sf)
|
void |
setUsePMAP(java.lang.String pmapTagName)
Pharmacophore map data in imported Molecule-s should be used. |
void |
setWeights(float[] featureWeights,
float[] distanceWeights)
Sets the cell-wise weight factors for the current parametrized metric. |
java.lang.String |
toString()
Returns the XML configuration in a string. |
int |
tripletIndex(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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_RESOLUTION
public static final float DEFAULT_FUZZINESS_FACTOR
public static final float DEFAULT_FUZZY_CUTOFF
public static final int DEFAULT_FUZZY_LOWER_BOUND
public static final java.lang.String DEFAULT_XML_CONFIG
protected java.util.ArrayList fuzzinessFactors
protected float[][] fuzzyExp
protected chemaxon.pharmacophore.ColorDecoder colDec
protected java.lang.String[] pptNames
protected float[][] gFuzzyIncrements
protected float[][][] svFuzzyIncrements
protected byte[][] compressedData
MolecularDescriptor.toData(
final int[] ).
Element 'i' is either null or is an array of 'i' bytes.
public float[] xyz
calculateXYZ() 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 of calculateXYZ()
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.
public float asymmetricXYZSum
| Constructor Detail |
|---|
public PFParameters()
setConfig( String paramString )
to initialize it properly.
public PFParameters(java.io.File configFile)
throws MDParametersException
configFile - XML configuration file
MDParametersException - missing or bad XML configuration
public PFParameters(java.lang.String XMLconfig)
throws MDParametersException
XMLconfig - XML configuration string
MDParametersException - missing or bad XML configuration| Method Detail |
|---|
public void fromString(java.lang.String parameterString)
throws MDParametersException
fromString in class MDParametersparameterString - parameters in string
MDParametersException - when the parameter string is not well-formed
public void fromFile(java.io.File parameterFile)
throws MDParametersException
fromFile in class MDParametersparameterFile - initialized configuration file
MDParametersException - failed to process parameter filepublic java.lang.String toString()
toString in class MDParameters
public void setParameters(java.lang.String parametersString)
throws MDParametersException
setParameters in class MDParametersparametersString - parameters in string
MDParametersException - when the parameter string is not
well-formed
public void setParameters(java.io.File parametersFile)
throws MDParametersException
setParameters in class MDParametersparametersFile - parameter configuration file
MDParametersException - when the parameter string is not
well-formedprotected void init()
protected void initGenerator()
throws MDParametersException
PFGenerator instance. The
generator is stored in the MDParameters in order to spare
memory space: the PFParameter object is shared among
multiple instances of PharmacophoreFingerprint, thus they refer to the same
generator object too via the parameters field.
MDParametersExceptionprotected void initParameters()
initParameters in class MDParameters
protected java.lang.String[] generate(Molecule m,
MolecularDescriptor cd)
throws MDGeneratorException
MolecularDescriptorGenerator and
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.
m - a molecular structurecd - the chemical descriptor generated for the given molecule,
an output parameter
MDGeneratorException - when failed to generate descriptorpublic void setCurrentParametrizedMetric(int metricIndex)
setCurrentParametrizedMetric in class MDParametersmetricIndex - ndex of a parametrized metric to be usedpublic void setFuzzySmoothingFactor(float fsf)
fsf - the fuzzy smoothing factorpublic void setFuzzyCutOff(float fco)
public void setFuzzyLowerBound(int flb)
public void setSymmetricalFuzzy(boolean sf)
public void setIgnoreRotatableBonds(boolean irb)
public void setFuzzinessFactor(float alpha)
alpha - fuzziness factor used in the convolution productpublic void setUsePMAP(java.lang.String pmapTagName)
pmapTagName - name of the SDfile tag storing the PMAP datapublic void setPMAPTagName(java.lang.String tagName)
tagName - name of the SDfile tag that stores pharmacophore map
public void setWeights(float[] featureWeights,
float[] distanceWeights)
featureWeights - weights for each pharmacophore typedistanceWeights - weights for each point pair distancepublic int getNumberOfFeatures()
public PSymbols getPSymbols()
public java.lang.String getSymbol(int i)
i - index of the pharmacophore property (feature)
public int getSymbolIndex(java.lang.String symbol)
throws java.lang.IllegalArgumentException
symbol - pharmacophore property (feature) symbol
java.lang.IllegalArgumentExceptionpublic int getMinDist()
public int getMaxDist()
public int getResolution()
public int getNDists()
protected int getNumberOfWeights(int parametrizedMetricIndex)
throws java.lang.IllegalArgumentException
MolecularDescriptor class or its derived classes, but not
to parametrized metric.
getNumberOfWeights in class MDParametersparametrizedMetricIndex - parametrized metric index
java.lang.IllegalArgumentException - if the given parameter is not a
valid metric indexpublic boolean isFuzzyFingerprint()
public boolean isGaussianSmoothing()
public float getFuzzySmoothingFactor()
public boolean isSymmetricalFuzzy()
public boolean getIgnoreRotatableBonds()
public float getFuzzyLowerBound()
public static java.lang.String getDefaultStandardizerConfiguration()
PharmacophoreFingerprint
includes aromatization and the removal of small disjoint fragments
(largest component is kept only).
public java.lang.String getDefaultDocumentFrame()
getDefaultDocumentFrame in class MDParameterspublic float[][] getGaussianFuzzyIncrements()
public float[] getCustomFuzzyIncrements(int fa,
int fb)
fa - pharmacophore point type of the first component of the pairfb - pharmacophore point type of the second component of the pair
public float[][] getFuzzyExponents()
public java.awt.Color[] getAtomSetColors()
public java.lang.String[] getAtomSetNames()
public int[] getAtomSetIndexes(Molecule m,
PharmacophoreFingerprint pfp)
m - a molecule to assign pharmacophore point colors to
protected void processDocument(boolean all)
throws MDParametersException
MDParameters
processDocument in class MDParametersall - process the complete document or only the
ScreeningConfiguration tag
MDParametersException
protected void readValues(boolean all)
throws MDParametersException
MDParametersMDParameters sub-class.
readValues in class MDParametersall - process the complete document or only the
ScreeningConfiguration tag
MDParametersException
protected void readMetricParameters()
throws MDParametersException
MDParametersParametrizedMetric nodes 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.
readMetricParameters in class MDParametersMDParametersException - if one of the nodes is not well-formed
protected void readMetricWeights(org.dom4j.Element parametrizedMetric,
int metricIndex)
throws MDParametersException
readMetricWeights in class MDParametersMDParametersException
protected int appendParametrizedMetric(java.lang.String name,
java.lang.String metric)
MDParameters
appendParametrizedMetric in class MDParametersname - name of the parametrized metricmetric - dissimilarity metric name (as defined in its implementor
class
protected boolean importNodes(org.dom4j.Document doc,
boolean merge)
MDParametersDocument into the current
(main) Document. New nodes can either merged into the
existing ones without removing them, or new nodes may overwrite
exisiting nodes.
importNodes in class MDParametersdoc - import nodes from this documentmerge - merge (add new) or overwrite (replace with new) existing
nodes
public int tripletIndex(int f1,
int f2,
int d)
f1 - index of the first featuref2 - index of the other featured - distance value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||