chemaxon.descriptors
Class ECFPGenerator

java.lang.Object
  extended by chemaxon.descriptors.MDGenerator
      extended by chemaxon.descriptors.ECFPGenerator
All Implemented Interfaces:
chemaxon.license.Licensable

public class ECFPGenerator
extends MDGenerator
implements chemaxon.license.Licensable

The ECFPGenerator class generates ECFP fingerprints of molecular graphs.

Basic concepts
A binary string (series of 0 and 1) is constructed based on the local neighborhoods of the atoms. The length of the series is a predefined constant parameter. One further parameter specifies the diameter of the neighborhood considered for each atom.

Typical usage
For the sake of optimal memory usage, one instance of this class can generate fingerprints for a series of molecular graphs by the consecutive call to the generate() method.
In most cases, the generator is not intended to be used directly. When molecules are taken from files or databases, the corresponding MolecularDescriptors can be generated by the appropriate MDReader object. Alternatively, MolecularDescriptor.generate(final Molecule) is the simplest way to obtain a descriptor corresponding to a molecular structure.

Example of the direct use of the class within an application:

    ECFPGenerator gen = new ECFPGenerator();
    ECFP fp = new ECFP(new ECFPParameters());
    Molecule mol = getFirstMoleculeFromSomewhere();
    while (mol != null) {
        gen.generate(mol, fp);
        doSomethingWith(fp);
        mol = getNextMoleculeFromSomewhere();
    }
 

Since:
JChem 5.4
Author:
Peter Kovacs (pkovacs84)

Field Summary
 
Fields inherited from class chemaxon.descriptors.MDGenerator
createStatistics, density, freqCount, maxNonEmptyId, maxNonEmptyPercent, minNonEmptyId, minNonEmptyPercent, molCount, sumNonEmptyPercent
 
Constructor Summary
ECFPGenerator()
          Creates a new instance of ECFPGenerator, which can be used to generate ECFP fingerprints for an arbitrary number of molecules.
 
Method Summary
protected  int calcFreqCount(MolecularDescriptor d)
          Updates statistics gathered on fingerprints generated and get the number of non-zero cells.
 java.lang.String[] generate(Molecule mol, MolecularDescriptor descr)
          Generates the ECFP fingerprint for the given molecule.
 boolean isLicensed()
          Returns information about the licensing of the product.
 void setLicenseEnvironment(java.lang.String env)
          Sets the license environment.
 
Methods inherited from class chemaxon.descriptors.MDGenerator
getAverageNonZeroRatio, getBrightestMolId, getDarkestMolId, getDensityCounts, getFrequencyCounts, getMaximumBitRatio, getMinimumBitRatio, getMoleculeCount, setCreateStatistics, updateStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECFPGenerator

public ECFPGenerator()
Creates a new instance of ECFPGenerator, which can be used to generate ECFP fingerprints for an arbitrary number of molecules.

Method Detail

isLicensed

public boolean isLicensed()
Returns information about the licensing of the product.

Specified by:
isLicensed in interface chemaxon.license.Licensable
Returns:
true if the product is correctly licensed

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Sets the license environment.

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable

generate

public java.lang.String[] generate(Molecule mol,
                                   MolecularDescriptor descr)
                            throws MDGeneratorException
Generates the ECFP fingerprint for the given molecule. New instance of the ECFP object is not allocated, the ECFP provided as a method parameter is updated (and it has to be allocated and initialized by the client of this class).

Specified by:
generate in class MDGenerator
Parameters:
mol - molecule for which the fingerprint is created
descr - the ECFP fingerprint object
Returns:
names of tags (properties) set (added) during fingerprint generation, it is always null in the case of ECFP
Throws:
MDGeneratorException - in the case of any failures to generate the descriptor

calcFreqCount

protected int calcFreqCount(MolecularDescriptor d)
Updates statistics gathered on fingerprints generated and get the number of non-zero cells.

Overrides:
calcFreqCount in class MDGenerator
Parameters:
d - newly generated ECFP
Returns:
brightness of the fingerprint