@TestClass(value="org.openscience.cdk.fingerprint.FingerprinterToolTest") public class FingerprinterTool extends Object
| Constructor and Description |
|---|
FingerprinterTool() |
| Modifier and Type | Method and 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.
|
@TestMethod(value="testIsSubset_BitSet_BitSet") public static boolean isSubset(BitSet bs1, BitSet bs2)
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.");
}
bs1 - The reference BitSetbs2 - The BitSet which is compared with bs1@TestMethod(value="testListDifferences_BitSet_BitSet") public static List<Integer> listDifferences(BitSet bs1, BitSet bs2)
differences(java.util.BitSet, java.util.BitSet) for a method to list all differences,
including those missing present in bs2 but not bs1.bs1 - First bitsetbs2 - Second bitsetdifferences(java.util.BitSet, java.util.BitSet)@TestMethod(value="testDifferences,testDifferences_Scenario") public static Set<Integer> differences(BitSet s, BitSet t)
listDifferences(java.util.BitSet, java.util.BitSet) which only list
those which are set in s but not in t.s - a bit vectort - another bit vector