|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.descriptors.MolecularDescriptor
chemaxon.descriptors.PharmacophoreFingerprint
public class PharmacophoreFingerprint
The PharmacophoreFingerprint class implements 2D pharmacophoric fingerprints.
Such fingerprints (which are chemical descriptors) are constructed from
sequences of histograms, each of these histograms have the same
number of bars. (Each of these bars represent a descriptor cell.)
The number of histograms is determined by the number
of pharmacophore types (also often referred as features, properties).
If the number of distinct pharmacophore features (for instance
H-donor, H-acceptor, charge etc.) is n then the number of
histograms is n*(n+1)/2.
Pharmacophoric point types can be customized by the user of the software, and
are specified in an external configuration file, see user documentation for
details.
The total number of bars (or bins) in one histogram (that is, the number of
cells in the descriptor) is determined by two distance values: the
minimal and maximal distances of pharmacophoric point pairs (atom pairs).
Since fingerprints handled by this class are two-dimensional, distances are
considered as topological distances (that is, the distance of
two atoms in the same molecule is equal to the number of edges in the
shortest path connecting the two nodes corresponding to the two atoms in
the chemical graph of the molecule). (This implies that chemical graphs
should be connected.) Atom pairs closer to each other than minimal distance
are regarded as being minimal distance apart (and similarly for distance
greater than the maximal distance).
Thus the number of bars in one historgram is equal to: maximal distance -
minimal distance + 1 .
The above described three configuration parameters (minimal and maximal
distance, and the number of pharmacophore types) have substantial influence
on the size of the pharmacophoric fingerprints. When this class is
instantiated these params have to be provided in a
PFParameters object.
Beside fingerprint size, two further circumstances determine the internal
logical structure of fingerprints: the order of the histograms in the
fingerprint, and the order of histogram bars in one histogram. Histograms
are ordered by pharmacophore type symbols, that is, if H-bond acceptor is
denoted by a, and H-donor property by d (and there are no
more features specified), then the order of histograms is: a-a, a-d, d-d
(and according to the above introduced formula, the number of histograms
is 2*(2+1)/2 = 3.
Histogram bars are ordered from left to right by distance valued (from minimal
to maximal distance).
This fingerprint structure results in a unique (well-defined, unambiguous)
representation that enables the canonical numbering (indexing) of individual
bins. This is vital in
accessing cells efficiently. Otherwise, if only symbolic keys (in contrast to
integer index numbers) could be used (for example ('a','d',3) ) a dramatic
loss of efficiency in retrieving information from fingerprints would be
experienced. Therefore it is crucial to introduce distinct symbols for
different pharmacophore types in the XML configuration file and also to
use the same symbols when fingerprints are generated and when they are used
in dissimilarity calculations. Otherwise, the interpretation (meaning) of
the fingerprints could be significantly different.
Three main groups of operations (methods) can be distinguished:
| Field Summary | |
|---|---|
protected float[] |
fp
storage for the fingerprint |
| Fields inherited from class chemaxon.descriptors.MolecularDescriptor |
|---|
params |
| Constructor Summary | |
|---|---|
PharmacophoreFingerprint()
Creates a new, empty instance of PharmacophoreFingerprint without allocating internal storage. |
|
PharmacophoreFingerprint(PFParameters params)
Creates a new instance of PharmacophoreFingerprint according to the parameters given. |
|
PharmacophoreFingerprint(PharmacophoreFingerprint pfp)
Copy constructor. |
|
PharmacophoreFingerprint(java.lang.String params)
Creates a new instance of PharmacophoreFingerprint according to the parameters given. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the fingerprint: sets all bins to store zero value. |
PharmacophoreFingerprint |
clone()
Creates a new instance with identical internal state. |
protected byte[] |
decompress(byte[] data)
Uncompresses input byte array and stores the uncompressed array in params.data. |
void |
fromData(byte[] dbRepr)
Builds a PharmacophoreFingerprint from an external data
format, created by a previous call to toData(). |
void |
fromFloatArray(float[] descr)
Builds a molecular descriptor from its float array representation. |
void |
fromString(java.lang.String pfp)
Builds a fingerprint from its string representation created by toString(). |
java.lang.String[] |
generate(Molecule m)
Creates the PharmacophoreFingerprint descriptor from the given Molecule. |
float |
get(int bin)
Gets the content of the specified hitogram bin. |
float |
get(int feature1,
int feature2,
float dist)
|
float |
get(int fa,
int fb,
int dist)
Gets the histogram bar height of two features ('fa'-'fb') corresponding to the given ditance 'dist'. |
float |
getAsymmetricEuclidean(PharmacophoreFingerprint f)
|
float |
getAsymmetricFBPA(PharmacophoreFingerprint f)
Calculates the asymmetric FBPA convolution product based distance of the fingerprint from an other (given as parameter). |
java.awt.Color[] |
getAtomSetColors()
Determines the coloring of atoms. |
int[] |
getAtomSetIndexes(Molecule m)
Gets the individual atom colors by pharmcophore point type. |
java.lang.String[] |
getAtomSetNames()
|
float[] |
getDefaultDissimilarityMetricThresholds()
Gets the default dissimilarity threshold values for all dissimilarity metrics defined. |
float |
getDissimilarity(MolecularDescriptor fp2)
Calculates the dissimilarity between two pharmacophore fingerprints using the default distance measure. |
float |
getDissimilarity(MolecularDescriptor fp2,
int metricIndex)
Calculates the dissimilarity between two pharmacophore fingerprints using the specified parametrized distance metric. |
java.lang.String[] |
getDissimilarityMetrics()
Gets the dissimilarity metric names. |
float |
getEuclidean(PharmacophoreFingerprint f)
Calculates the Euclidean distance. |
float |
getLowerBound(MolecularDescriptor fp2)
Calculates the lower bound estimate of the dissimilarity from the given fingerprint. |
float |
getMaxDist()
|
float |
getMinDist()
|
java.lang.String |
getName()
Gets the name of the PharmacophoreFingerprint object. |
int |
getNumberOfFeatures()
|
java.lang.String |
getParametersClassName()
Gets the name of the parameters class corresponding to the descriptor. |
float |
getResolution()
|
float |
getScaledTanimoto(PharmacophoreFingerprint f,
PharmacophoreFingerprint hypothesis)
Calculates the scaled Tanimoto metric (adapted to hystograms). |
java.lang.String |
getShortName()
Gets the short name of the descriptor. |
java.lang.String |
getSymbol(int feature)
|
float |
getSymmetricFBPA(PharmacophoreFingerprint f)
Calculates the symmetric FBPA convolution product based distasnce of the fingerprint from an other (given as parameter). |
float |
getTanimoto(PharmacophoreFingerprint f)
Calculates the Tanimoto metric (adapted to hystograms) |
float |
getTversky(PharmacophoreFingerprint f)
Calculates the Tversky !! |
float |
getWeightedAsymmetricEuclidean(PharmacophoreFingerprint f)
Calculates the weighted asymmetric Euclidean distance. |
float |
getWeightedEuclidean(PharmacophoreFingerprint f)
Calculates the weighted Euclidean distance. |
void |
inc(int bin)
Increments the content of the specified hitogram bin by one. |
void |
inc(int fa,
int fb,
int dist)
Increments the histogram corresponding to two features ('fa'-'fb') and a distance, 'dist'. |
void |
inc(int fa,
int fb,
int dist,
float[] incr)
The fuzzy version of inc( int fa, int fb, int dist ) |
void |
inc(int fa,
int fb,
int dist,
int nrRotBonds)
The fuzzy version of inc( int fa, int fb, int dist ) |
int |
index(int fa,
int fb,
int dist)
Calculates the index of the bin specified by the arguments. |
boolean |
isLicensed()
Returns information about the licensing of the product. |
boolean |
isSubsetOf(PharmacophoreFingerprint d)
Checks if this fingerprint is a subset of another fingerprint that is passed as method parameter. |
void |
put(int bin,
float newValue)
Stores the given value in the specified hitogram bin. |
void |
put(int bin,
int newValue)
Stores the given value in the specified hitogram bin. |
void |
setLicenseEnvironment(java.lang.String env)
Sets the license environment. |
void |
setParameters(MDParameters parameters)
Sets parameters, allocates internal storage if needed and cleans the descriptor. |
void |
setParameters(java.lang.String parameters)
Sets the parameters of an already created PharmacophoreFingerprint object. |
byte[] |
toData()
Converts a PharmacophoreFingerprint object into a byte array. |
java.lang.String |
toDecimalString()
Converts the fingerprint into a string of decial numbers. |
float[] |
toFloatArray()
Creates the float array representation of a MolecularDescriptor
object. |
java.lang.String |
toHistogramString(java.lang.String sep,
boolean nonZeroOnly)
Creates the string representation of the fingerprint. |
java.lang.String |
toString()
Converts the fingerprint into a readable string. |
java.lang.String |
toString(java.lang.String sep,
boolean nonZeroOnly)
Creates the string representation of the pharmacophore fingerprint. |
| Methods inherited from class chemaxon.descriptors.MolecularDescriptor |
|---|
generate, getDefaultMetricIndex, getDefaultThreshold, getDissimilarityMetricIndex, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, getNumberOfWeights, getParameters, getThreshold, getThreshold, main, needsConfig, newInstance, newInstance, newInstanceFromXML, setScreeningConfiguration, toBinaryString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected float[] fp
| Constructor Detail |
|---|
public PharmacophoreFingerprint()
public PharmacophoreFingerprint(PFParameters params)
params - parameters used in fingerprint generation and handlingpublic PharmacophoreFingerprint(java.lang.String params)
params - parameter settingspublic PharmacophoreFingerprint(PharmacophoreFingerprint pfp)
PFParameters
object.
pfp - fingerprint to be copied| Method Detail |
|---|
public PharmacophoreFingerprint clone()
clone in class MolecularDescriptorpublic boolean isLicensed()
isLicensed in interface chemaxon.license.Licensablepublic void setLicenseEnvironment(java.lang.String env)
setLicenseEnvironment in interface chemaxon.license.Licensablepublic java.lang.String getName()
getName in class MolecularDescriptorpublic java.lang.String getShortName()
getShortName in class MolecularDescriptorpublic java.lang.String getParametersClassName()
getParametersClassName in class MolecularDescriptorpublic void setParameters(MDParameters parameters)
setParameters in class MolecularDescriptorparameters - fingerprint parameters
public void setParameters(java.lang.String parameters)
throws MDParametersException
PharmacophoreFingerprint object.
setParameters in class MolecularDescriptorparameters - parameter settings for the descriptor
MDParametersException - any XML errorpublic byte[] toData()
PharmacophoreFingerprint object into a byte array.
This format can be reffered to as an "external representation" since
it servers as the data format for storing fingerprints in databases.
fromData() method to build the pharmacophore
fingerprint from this "external" representation.
toData in class MolecularDescriptorpublic void fromData(byte[] dbRepr)
PharmacophoreFingerprint from an external data
format, created by a previous call to toData().
fromData in class MolecularDescriptordbRepr - "external" representation of PharmacophoreFingerprintprotected byte[] decompress(byte[] data)
compress( final byte[] ). Checks
header (first byte) and decompresses only if the value of the first byte
is ZERO_SEQUENCE_COMPRESSION_CODE. Otherwise null is returned.
data - compressed data
public java.lang.String[] generate(Molecule m)
throws MDGeneratorException
MDParameters class.
generate in class MolecularDescriptorMDGeneratorException - when failed to generate descriptor
public final void inc(int fa,
int fb,
int dist)
PSymbols class) have to be provided for the sake of
efficiency.
Distance values are normalized in this method to fall within the
minimum and maximum distance range, as specified by the previously
given parameters.
fa - feature index of one of the featuresfb - feature index of the other paharmacophore featuredist - distance value of the two features
public final void inc(int fa,
int fb,
int dist,
int nrRotBonds)
inc( int fa, int fb, int dist ). The
contents of all bins in the (fa,fb) histogram are incremented with the
appropriate value depending on the distance and the number of rotatable
bonds, and also the fuzzy smoothig factor.
- Parameters:
fa - feature index of one of the featuresfb - feature index of the other paharmacophore featuredist - distance value of the two featuresnrRotBonds - number of rotatable bonds on the path connecting
the two pharmacophoric points
public final void inc(int fa,
int fb,
int dist,
float[] incr)
inc( int fa, int fb, int dist ). The
contents of all bins in the (fa,fb) histogram are incremented with the
appropriate value depending on the user defined fuzzy smoothing vector.
- Parameters:
fa - feature index of one of the featuresfb - feature index of the other paharmacophore featuredist - distance value of the two featuresincr - distant dependent fuzzy increments
public final void inc(int bin)
bin - index of the bin to be incremented by one
public final void put(int bin,
int newValue)
bin - index of the bin to be incremented by onenewValue - value to be stored in the given bin
public final void put(int bin,
float newValue)
bin - index of the bin to be incremented by onenewValue - value to be stored in the given bin
public final float get(int fa,
int fb,
int dist)
fa - feature index of one of the featuresfb - feature index of the other paharmacophore featuredist - distance value of the two features
public final float get(int bin)
PharmacophoreFingerprint class for the meaning
of the bin index.
bin - index of the bin qeuried
public final void clear()
public final java.lang.String toString()
setPMAPTagName( String tagName )).
See toHistogramString( String sep, boolean nonZeroOnly ) for
detailed format description.
toString in class MolecularDescriptor
public final void fromString(java.lang.String pfp)
throws java.text.ParseException
toString().
fromString in class MolecularDescriptorpfp - pharmacophore fingerprint string
java.text.ParseException
public final java.lang.String toString(java.lang.String sep,
boolean nonZeroOnly)
toString:
<feature symbol> ' ' <feature symbol> @ <distance>
'=' <value> <sep> ... .
Note, that such text representation cannot be converted into pharmacophore
fingerprint data.
sep - separator character printed between two binsnonZeroOnly - bins containing zero values are not printed
public final java.lang.String toHistogramString(java.lang.String sep,
boolean nonZeroOnly)
<feature symbol> ' ' <feature symbol> '=' '|'
b1 b2 ... bn '|' <separator>,
where bi denotes the value stored in bin
i.
sep - separator string to be printed between histogramsnonZeroOnly - all or non-zero value containing histogram are printed
public final java.lang.String toDecimalString()
toDecimalString in class MolecularDescriptorpublic float[] toFloatArray()
MolecularDescriptor
object. This array contains all values of the descriptor
(including all zeros) in the elements of the array.
toFloatArray in class MolecularDescriptorpublic void fromFloatArray(float[] descr)
fromFloatArray in class MolecularDescriptordescr - descriptor represented in a float array
(e.g. generated by toFloatArray())public java.awt.Color[] getAtomSetColors()
setParameters() as that may change the
coloring scheme to be applied.
getAtomSetColors in class MolecularDescriptorpublic java.lang.String[] getAtomSetNames()
getAtomSetNames in class MolecularDescriptorpublic int[] getAtomSetIndexes(Molecule m)
getAtomSetIndexes in class MolecularDescriptorm - a molecule to assign pharmacophore point colors to
public java.lang.String[] getDissimilarityMetrics()
getDissimilarityMetrics in class MolecularDescriptorpublic float[] getDefaultDissimilarityMetricThresholds()
getDefaultDissimilarityMetricThresholds in class MolecularDescriptorpublic final float getEuclidean(PharmacophoreFingerprint f)
f - another fingerprint from which the distance is measured
public final float getAsymmetricEuclidean(PharmacophoreFingerprint f)
public final float getWeightedEuclidean(PharmacophoreFingerprint f)
f - a fingerprint from which the distance is measured
public final float getWeightedAsymmetricEuclidean(PharmacophoreFingerprint f)
f - a fingerprint from which the distance is measured
public final float getSymmetricFBPA(PharmacophoreFingerprint f)
f - distance of this is taken from f
public final float getAsymmetricFBPA(PharmacophoreFingerprint f)
f - the reference fingerprint
(denoted by M))
public final float getTanimoto(PharmacophoreFingerprint f)
f - the distance from f is calculated
public float getTversky(PharmacophoreFingerprint f)
f - the distance from f is calculated
public final float getScaledTanimoto(PharmacophoreFingerprint f,
PharmacophoreFingerprint hypothesis)
f - the distance is measured from f
public int index(int fa,
int fb,
int dist)
fa - index of the first pharmacophore point typefb - index of the second (other) pharmacophore point typedist - distance of the pharmacophore points
public float getDissimilarity(MolecularDescriptor fp2)
getDissimilarity in class MolecularDescriptorfp2 - the other pharmacophore fingerprint
public float getDissimilarity(MolecularDescriptor fp2,
int metricIndex)
getDissimilarity in class MolecularDescriptorfp2 - the pharmacohore fingerprint from which the distance
is measuredmetricIndex - index of the parametrized metric to be used
MDParameters,
PFParameterspublic float getLowerBound(MolecularDescriptor fp2)
Diffable see
remarks at getDissimilarity( final Object fp2 )
for further explanation.
In the case of PharmacophoreFingerprint a good estimate for the minimum distance
cannot be obtained efficiently (that is, significantly faster than
calculating the proper distance) therefore 0 is returned. This trivial
distance bound estimation will lead to calling getDistance.
getLowerBound in class MolecularDescriptorfp2 - pharmacophore fingerprint from which distance is measured
public boolean isSubsetOf(PharmacophoreFingerprint d)
d - a descriptor which is supposed to be a superset
public float getMaxDist()
public float getMinDist()
public float getResolution()
public int getNumberOfFeatures()
public java.lang.String getSymbol(int feature)
public float get(int feature1,
int feature2,
float dist)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||