@TestClass(value="org.openscience.cdk.fingerprint.HybridizationFingerprinterTest") public class HybridizationFingerprinter extends Object implements IFingerprinter
IAtomContainer
. Fingerprints are
one-dimensional bit arrays, where bits are set according to a the occurrence
of a particular structural feature (See for example the Daylight inc. theory
manual for more information). Fingerprints allow for a fast screening step to
exclude candidates for a substructure search in a database. They are also a
means for determining the similarity of chemical structures.
A fingerprint is generated for an AtomContainer with this code:
Molecule molecule = new Molecule(); IFingerprinter fingerprinter = new HybridizationFingerprinter(); BitSet fingerprint = fingerprinter.getFingerprint(molecule); fingerprint.size(); // returns 1024 by default fingerprint.length(); // returns the highest set bit
The FingerPrinter assumes that hydrogens are explicitly given!
Furthermore, if pseudo atoms or atoms with malformed symbols are present,
their atomic number is taken as one more than the last element currently
supported in PeriodicTable
.
Unlike the Fingerprinter
, this fingerprinter does not take into
account aromaticity. Instead, it takes into account SP2
IAtomType.Hybridization
.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SEARCH_DEPTH
The default search depth used to create the fingerprints.
|
static int |
DEFAULT_SIZE
The default length of created fingerprints.
|
Constructor and Description |
---|
HybridizationFingerprinter()
Creates a fingerprint generator of length
DEFAULT_SIZE
and with a search depth of DEFAULT_SEARCH_DEPTH . |
HybridizationFingerprinter(int size) |
HybridizationFingerprinter(int size,
int searchDepth)
Constructs a fingerprint generator that creates fingerprints of
the given size, using a generation algorithm with the given search
depth.
|
Modifier and Type | Method and Description |
---|---|
BitSet |
getFingerprint(IAtomContainer container)
Generates a fingerprint of the default size for the given AtomContainer.
|
Map<String,Integer> |
getRawFingerprint(IAtomContainer container) |
int |
getSearchDepth() |
int |
getSize()
Returns the size of the fingerprints calculated.
|
public static final int DEFAULT_SIZE
public static final int DEFAULT_SEARCH_DEPTH
public HybridizationFingerprinter()
DEFAULT_SIZE
and with a search depth of DEFAULT_SEARCH_DEPTH
.public HybridizationFingerprinter(int size)
public HybridizationFingerprinter(int size, int searchDepth)
size
- The desired size of the fingerprintsearchDepth
- The desired depth of search@TestMethod(value="testGetFingerprint_IAtomContainer") public BitSet getFingerprint(IAtomContainer container) throws CDKException
getFingerprint
in interface IFingerprinter
container
- The IAtomContainer
for which a fingerprint is
generated.CDKException
- TODO@TestMethod(value="testGetSearchDepth") public int getSearchDepth()
@TestMethod(value="testGetSize") public int getSize()
IFingerprinter
getSize
in interface IFingerprinter
public Map<String,Integer> getRawFingerprint(IAtomContainer container)