Class PFGenerator
- java.lang.Object
-
- chemaxon.descriptors.MDGenerator
-
- chemaxon.descriptors.PFGenerator
-
@PublicAPI public class PFGenerator extends MDGenerator
ThePFGenerator
class generates 2-dimensional pharmacophore fingerprints for molecular graphs.Basic concepts
The pharmacophore fingerprint is based on and created from atom centre based pharmacophoric point types that are identified and assigned by thePMapper
class. All possible point pairs are recorded in the fingerprint and are represented in a histogram. Bins of such histogram are associated with topological distances (that is, length of shortest path) between pharmacophore point pairs. (SeePharmacophoreFingerprint
class for an elaborate description.)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 consequtive call to thegenerate()
method.
In most cases the generator is not intended to be used directly. When molecules are taken from files or databases the correspondingMolecularDescriptor
s can be generated by the appropriateMDReader
object. Example of the direct use of the class within an application:PMapper m = new PMapper( "pharmacophore_config.xml" ); PFGenerator gen = new PFGenerator( m ); gen.setUsePMAP( false ); // do not use existing PMAP tag in molecules PharmacophoreFingerprint pfp = new PharmacophoreFingerprint(); pfp.setParameters(new PFParameters()); String[] newTags = null; Molecule mol = getFirstMoleculeFromSomewhere(); while ( mol != null ) { gen.generate( mol, p ); doSomethingWith( p ); mol = getNextMoleculeFromSomewhere(); }
- Since:
- JChem 2.0
- See Also:
PharmacophoreFingerprint
,PMapper
-
-
Field Summary
-
Fields inherited from class chemaxon.descriptors.MDGenerator
createStatistics, density, freqCount, maxNonEmptyId, maxNonEmptyPercent, minNonEmptyId, minNonEmptyPercent, molCount, sumNonEmptyPercent
-
-
Constructor Summary
Constructors Constructor Description PFGenerator(PMapper pmapper)
Creates a new instance of PFGenerator which can be used to generate fingerprints for an arbitrary number of molecules.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
calcFreqCount(MolecularDescriptor d)
Calculate and store infreqCount[]
absolute frequency counts per cells.String[]
generate(Molecule m, MolecularDescriptor d)
Generates the pharmacophore fingerprint of the given molecule.String
getPMap(Molecule m, PSymbols pSym)
Gets pharmacophore map of the input molecule.String
getPMAPTagName()
Gets the name of the SDfile tag (Molecule property) which stores the pharmacophore map data.void
setPMAPTagName(String tagName)
Sets the name of the SDfile tag (Molecule property) which stores the pharmacophore map data.void
setUsePMAP(boolean use)
Omit or use pharmacophore map data optionally available in molecular structure.-
Methods inherited from class chemaxon.descriptors.MDGenerator
getAverageNonZeroRatio, getBrightestMolId, getDarkestMolId, getDensityCounts, getFrequencyCounts, getMaximumBitRatio, getMinimumBitRatio, getMoleculeCount, setCreateStatistics, updateStatistics
-
-
-
-
Constructor Detail
-
PFGenerator
public PFGenerator(PMapper pmapper)
Creates a new instance of PFGenerator which can be used to generate fingerprints for an arbitrary number of molecules.- Parameters:
pmapper
- assign pharmacophore type labels to atoms
-
-
Method Detail
-
setUsePMAP
public void setUsePMAP(boolean use)
Omit or use pharmacophore map data optionally available in molecular structure. If not to be used, the pharmacophore point map is generated, even in the case when the input molecule has already been assigned this data to.- Parameters:
use
- indicates whether or not existing pmap data should be used
-
setPMAPTagName
public void setPMAPTagName(String tagName)
Sets the name of the SDfile tag (Molecule property) which stores the pharmacophore map data.- Parameters:
tagName
- name of the SDfile tag (Molecule property)
-
getPMAPTagName
public String getPMAPTagName()
Gets the name of the SDfile tag (Molecule property) which stores the pharmacophore map data.- Returns:
- name of the SDfile tag (Molecule property)
-
generate
public String[] generate(Molecule m, MolecularDescriptor d) throws MDGeneratorException
Generates the pharmacophore fingerprint of the given molecule. New instance of the PFp object is not allocated, the provided MolecularDescriptor is updated (and it has to be allocated and initialized by the client of this class).- Specified by:
generate
in classMDGenerator
- Parameters:
m
- molecule for which the fingerprint is createdd
- the 2d pharmacophore fingerprint generated- Returns:
- names of tags (properties) set (added) (eg. "PMAP")
- Throws:
MDGeneratorException
- when perception or mapping cannot be completed for any reason
-
getPMap
public String getPMap(Molecule m, PSymbols pSym) throws MDGeneratorException
Gets pharmacophore map of the input molecule. If the map is not yet calculated and stored as a property in the molecule, this method generates then returns it. The input molecule has to be standardized.- Parameters:
m
- a moleculepSym
- pharmacophore type symbols- Returns:
- pharmacophore point map of the input molecule
- Throws:
MDGeneratorException
- when perception or mapping cannot be completed for any reason- Since:
- JChem 2.2
-
calcFreqCount
protected int calcFreqCount(MolecularDescriptor d)
Calculate and store infreqCount[]
absolute frequency counts per cells. Also gets number of non-zero cells in the descriptor.- Overrides:
calcFreqCount
in classMDGenerator
- Parameters:
d
- descriptor in which non-zero cells should be counted- Returns:
- number of non-zero cells
-
-