@PublicAPI public abstract class MDGenerator extends java.lang.Object
MolecularDescriptor
generators.
Its main purpose is two-fold: (1) defines an interface for all generator
classes (that is, what methods should be implemented), (2) implements
function for gather statistical data on descriptor generated and retrieval
functions for these statistics.Modifier and Type | Field and Description |
---|---|
protected boolean |
createStatistics
indicates if statistical data has to be gathered during generation
|
protected int[] |
density |
protected int[] |
freqCount |
protected int |
maxNonEmptyId |
protected float |
maxNonEmptyPercent |
protected int |
minNonEmptyId |
protected float |
minNonEmptyPercent |
protected int |
molCount
variables to collect statistical data in
|
protected float |
sumNonEmptyPercent |
Constructor and Description |
---|
MDGenerator()
Created an object.
|
Modifier and Type | Method and Description |
---|---|
protected int |
calcFreqCount(MolecularDescriptor d)
Calculate and store in
freqCount[] absolute frequency
counts per cells. |
abstract java.lang.String[] |
generate(Molecule m,
MolecularDescriptor d)
Generates the molecular descriptor for the given molecule.
|
float |
getAverageNonZeroRatio()
Gets the average percentage of cells that have non-zero value taken all
descriptors generated since the initialization of the generator into
account.
|
int |
getBrightestMolId()
Gets the id of that molecule which had the maximum number of non-zero
cells among all descriptors generated since the initialization of the
generator object.
|
int |
getDarkestMolId()
Gets the id of that molecule which had the minimum number of non-zero
cells among all descriptors generated since the initialization of the
generator object.
|
int[] |
getDensityCounts()
Gets the array of bit density.
|
int[] |
getFrequencyCounts()
Gets the absolute frequence count array for all descriptors generated.
|
float |
getMaximumBitRatio()
Gets the maximum percentage of non-zero cells in descriptors generated.
|
float |
getMinimumBitRatio()
Gets the minimum percentage of non-zero cells in descriptors generated.
|
int |
getMoleculeCount()
Gets the number of molecules processed (that is, the number of
descriptors generated) since the initialization of the object.
|
void |
setCreateStatistics(boolean createStatistics)
Toggles the create statistics flag.
|
protected void |
updateStatistics(MolecularDescriptor d)
Updates statistics gathered on fingerprints generated.
|
protected boolean createStatistics
protected int molCount
protected float minNonEmptyPercent
protected int minNonEmptyId
protected float maxNonEmptyPercent
protected int maxNonEmptyId
protected float sumNonEmptyPercent
protected int[] freqCount
protected int[] density
public abstract java.lang.String[] generate(Molecule m, MolecularDescriptor d) throws MDGeneratorException
m
- molecule for which the descriptor is createdd
- the generated descriptorMDGeneratorException
- in the case of any failures to generate
the descriptorpublic void setCreateStatistics(boolean createStatistics)
createStatistics
- new value for the create statistics flagprotected void updateStatistics(MolecularDescriptor d)
d
- newly generated MolecularDescriptor
protected int calcFreqCount(MolecularDescriptor d)
freqCount[]
absolute frequency
counts per cells. Also gets number of non-zero cells in the descriptor.d
- descriptor in which non-zero cells should be countedpublic int getMoleculeCount()
public float getAverageNonZeroRatio()
public float getMaximumBitRatio()
public int getBrightestMolId()
public float getMinimumBitRatio()
public int getDarkestMolId()
public int[] getDensityCounts()
i
returns the number of descriptors in which the
ratio non-zero cells is between 10 * i
and 10 * i + 10
.public int[] getFrequencyCounts()