Package org.openscience.cdk.fingerprint
Class FingerprinterTool
- java.lang.Object
-
- org.openscience.cdk.fingerprint.FingerprinterTool
-
-
Constructor Summary
Constructors Constructor Description FingerprinterTool()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<Integer>
differences(BitSet s, BitSet t)
List all differences between the two bit vectors.static boolean
isSubset(BitSet bs1, BitSet bs2)
Checks whether all the positive bits in BitSet bs2 occur in BitSet bs1.static List<Integer>
listDifferences(BitSet bs1, BitSet bs2)
This lists all bits set in bs2 and not in bs2 (other way round not considered) in a list and to logger.static IBitFingerprint
makeBitFingerprint(Map<String,Integer> features)
Convert a mapping of features and their counts to a 1024-bit binary fingerprint.static IBitFingerprint
makeBitFingerprint(Map<String,Integer> features, int len)
Convert a mapping of features and their counts to a binary fingerprint.static IBitFingerprint
makeBitFingerprint(Map<String,Integer> features, int len, int bits)
Convert a mapping of features and their counts to a binary fingerprint.static ICountFingerprint
makeCountFingerprint(Map<String,Integer> features)
Wrap a mapping of features and their counts to a continuous (count based) fingerprint.
-
-
-
Method Detail
-
isSubset
public static boolean isSubset(BitSet bs1, BitSet bs2)
Checks whether all the positive bits in BitSet bs2 occur in BitSet bs1. If so, the molecular structure from which bs2 was generated is a possible substructure of bs1.Example:
Molecule mol = MoleculeFactory.makeIndole(); BitSet bs = Fingerprinter.getBitFingerprint(mol); Molecule frag1 = MoleculeFactory.makePyrrole(); BitSet bs1 = Fingerprinter.getBitFingerprint(frag1); if (Fingerprinter.isSubset(bs, bs1)) { System.out.println("Pyrrole is subset of Indole."); }
- Parameters:
bs1
- The reference BitSetbs2
- The BitSet which is compared with bs1- Returns:
- True, if bs2 is a subset of bs1
- Keywords:
- substructure search
-
listDifferences
public static List<Integer> listDifferences(BitSet bs1, BitSet bs2)
This lists all bits set in bs2 and not in bs2 (other way round not considered) in a list and to logger. See.differences(java.util.BitSet, java.util.BitSet)
for a method to list all differences, including those missing present in bs2 but not bs1.- Parameters:
bs1
- First bitsetbs2
- Second bitset- Returns:
- An arrayList of Integers
- See Also:
differences(java.util.BitSet, java.util.BitSet)
-
differences
public static Set<Integer> differences(BitSet s, BitSet t)
List all differences between the two bit vectors. UnlikelistDifferences(java.util.BitSet, java.util.BitSet)
which only list those which are set in s but not in t.- Parameters:
s
- a bit vectort
- another bit vector- Returns:
- all differences between s and t
-
makeBitFingerprint
public static IBitFingerprint makeBitFingerprint(Map<String,Integer> features)
Convert a mapping of features and their counts to a 1024-bit binary fingerprint. A single bit is set for each pattern.- Parameters:
features
- features to include- Returns:
- the continuous fingerprint
- See Also:
makeBitFingerprint(java.util.Map, int, int)
-
makeBitFingerprint
public static IBitFingerprint makeBitFingerprint(Map<String,Integer> features, int len)
Convert a mapping of features and their counts to a binary fingerprint. A single bit is set for each pattern.- Parameters:
features
- features to includelen
- fingerprint length- Returns:
- the continuous fingerprint
- See Also:
makeBitFingerprint(java.util.Map, int, int)
-
makeBitFingerprint
public static IBitFingerprint makeBitFingerprint(Map<String,Integer> features, int len, int bits)
Convert a mapping of features and their counts to a binary fingerprint. Each feature can set 1-n hashes, the amount is modified by thebits
operand.- Parameters:
features
- features to includelen
- fingerprint lengthbits
- number of bits to set for each pattern- Returns:
- the continuous fingerprint
-
makeCountFingerprint
public static ICountFingerprint makeCountFingerprint(Map<String,Integer> features)
Wrap a mapping of features and their counts to a continuous (count based) fingerprint.- Parameters:
features
- features to include- Returns:
- the continuous fingerprint
-
-