DataStructs.cDataStructs

Package DataStructs :: Module cDataStructs |
[hide private]
[frames] | no frames]

# Module cDataStructs

    Module containing an assortment of functionality for basic data structures.

    At the moment the data structures defined are:
      Bit Vector classes (for storing signatures, fingerprints and the like:
        - ExplicitBitVect: class for relatively small (10s of thousands of bits) or
                           dense bit vectors.
        - SparseBitVect:   class for large, sparse bit vectors
      DiscreteValueVect:   class for storing vectors of integers
      SparseIntVect:       class for storing sparse vectors of integers

Classes | [hide private]
| DiscreteValueVect A container class for storing unsigned integer values within a particular range.
| ExplicitBitVect A class to store explicit bit vectors.
| IntSparseIntVect A container class for storing integer values within a particular range.
| LongSparseIntVect A container class for storing integer values within a particular range.
| SparseBitVect A class to store sparse bit vectors.

Functions | [hide private]
AllBitSimilarity(...) C++ signature:... | source code
AllProbeBitsMatch(...) C++ signature: AllProbeBitsMatch(SparseBitVect, std::string) -> bool Returns True if all bits in the first argument match all bits in the vector defined by the pickle in the second argument. | source code
AsymmetricSimilarity(...) C++ signature:... | source code
BitVectToText(...) C++ signature: BitVectToText(SparseBitVect) -> std::string Returns a string of zeros and ones representing the bit vector. | source code
BraunBlanquetSimilarity(...) C++ signature:... | source code
BulkAllBitSimilarity(...) C++ signature:... | source code
BulkAsymmetricSimilarity(...) C++ signature:... | source code
BulkBraunBlanquetSimilarity(...) C++ signature:... | source code
BulkCosineSimilarity(...) C++ signature:... | source code
BulkDiceSimilarity(...) C++ signature:... | source code
BulkKulczynskiSimilarity(...) C++ signature:... | source code
BulkMcConnaugheySimilarity(...) C++ signature:... | source code
BulkOnBitSimilarity(...) C++ signature:... | source code
BulkRusselSimilarity(...) C++ signature:... | source code
BulkSokalSimilarity(...) C++ signature:... | source code
BulkTanimotoSimilarity(...) C++ signature:... | source code
ComputeL1Norm(...) Compute the distance between two discrete vector values... | source code
ConvertToExplicit(...) Converts a SparseBitVector to an ExplicitBitVector and returns the ExplicitBitVector... | source code
CosineSimilarity(...) C++ signature:... | source code
CreateFromBitString(...) Creates an ExplicitBitVect from a bit string (string of 0s and 1s). | source code
DiceSimilarity(...) C++ signature:... | source code
FoldFingerprint(...) C++ signature:... | source code
InitFromDaylightString(...) C++ signature: InitFromDaylightString(SparseBitVect {lvalue}, std::string) -> void* Fill a BitVect using an ASCII (Daylight) encoding of a fingerprint. | source code
KulczynskiSimilarity(...) C++ signature:... | source code
McConnaugheySimilarity(...) C++ signature:... | source code
NumBitsInCommon(...) C++ signature:... | source code
OffBitProjSimilarity(...) C++ signature:... | source code
OffBitsInCommon(...) C++ signature:... | source code
OnBitProjSimilarity(...) C++ signature:... | source code
OnBitSimilarity(...) C++ signature:... | source code
OnBitsInCommon(...) C++ signature:... | source code
RusselSimilarity(...) C++ signature:... | source code
SokalSimilarity(...) C++ signature:... | source code
TanimotoSimilarity(...) C++ signature:... | source code

Function Details | [hide private]

### AllBitSimilarity(...) | source code
    C++ signature:
        AllBitSimilarity(SparseBitVect v1, SparseBitVect v2) -> double

    (B(bv1) - B(bv1^bv2)) / B(bv1)
    C++ signature:
        AllBitSimilarity(ExplicitBitVect v1, ExplicitBitVect v2) -> double

### AllProbeBitsMatch(...) | source code
    C++ signature:
        AllProbeBitsMatch(SparseBitVect, std::string) -> bool

    Returns True if all bits in the first argument match all bits in the
      vector defined by the pickle in the second argument.

    C++ signature:
        AllProbeBitsMatch(ExplicitBitVect, std::string) -> bool

### AsymmetricSimilarity(...) | source code
    C++ signature:
        AsymmetricSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2) / min(B(bv1),B(bv2))
    C++ signature:
        AsymmetricSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        AsymmetricSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2) / min(B(bv1),B(bv2))
    C++ signature:
        AsymmetricSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### BitVectToText(...) | source code
    C++ signature:
        BitVectToText(SparseBitVect) -> std::string

    Returns a string of zeros and ones representing the bit vector.
    C++ signature:
        BitVectToText(ExplicitBitVect) -> std::string

### BraunBlanquetSimilarity(...) | source code
    C++ signature:
        BraunBlanquetSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2) / max(B(bv1),B(bv2))
    C++ signature:
        BraunBlanquetSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        BraunBlanquetSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2) / max(B(bv1),B(bv2))
    C++ signature:
        BraunBlanquetSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### BulkAllBitSimilarity(...) | source code
    C++ signature:
        BulkAllBitSimilarity(ExplicitBitVect v1, boost::python::list v2, bool returnDistance=0) -> boost::python::list

    (B(bv1) - B(bv1^bv2)) / B(bv1)
    C++ signature:
        BulkAllBitSimilarity(ExplicitBitVect v1, boost::python::list v2, bool returnDistance=0) -> boost::python::list

### BulkAsymmetricSimilarity(...) | source code
    C++ signature:
        BulkAsymmetricSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / min(B(bv1),B(bv2))
    C++ signature:
        BulkAsymmetricSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkBraunBlanquetSimilarity(...) | source code
    C++ signature:
        BulkBraunBlanquetSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / max(B(bv1),B(bv2))
    C++ signature:
        BulkBraunBlanquetSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkCosineSimilarity(...) | source code
    C++ signature:
        BulkCosineSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / sqrt(B(bv1) * B(bv2))
    C++ signature:
        BulkCosineSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkDiceSimilarity(...) | source code
    C++ signature:
        BulkDiceSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    2*B(bv1&bv2) / (B(bv1) + B(bv2))
    C++ signature:
        BulkDiceSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    return the Dice similarities between one vector and a sequence of others
    C++ signature:
        BulkDiceSimilarity(RDKit::SparseIntVect<int> v1, boost::python::list v2, bool returnDistance=False) -> boost::python::list

    return the Dice similarities between one vector and a sequence of others
    C++ signature:
        BulkDiceSimilarity(RDKit::SparseIntVect<long long> v1, boost::python::list v2, bool returnDistance=False) -> boost::python::list

### BulkKulczynskiSimilarity(...) | source code
    C++ signature:
        BulkKulczynskiSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2)*(B(bv1) + B(bv2)) / (2 * B(bv1) * B(bv2))
    C++ signature:
        BulkKulczynskiSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkMcConnaugheySimilarity(...) | source code
    C++ signature:
        BulkMcConnaugheySimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    (B(bv1&bv2) * (B(bv1)+B(bv2)) - B(bv1)*B(bv2)) / (B(bv1) * B(bv2))
    C++ signature:
        BulkMcConnaugheySimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkOnBitSimilarity(...) | source code
    C++ signature:
        BulkOnBitSimilarity(ExplicitBitVect v1, boost::python::list v2, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / B(bv1|bv2)
    C++ signature:
        BulkOnBitSimilarity(ExplicitBitVect v1, boost::python::list v2, bool returnDistance=0) -> boost::python::list

### BulkRusselSimilarity(...) | source code
    C++ signature:
        BulkRusselSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / B(bv1)
    C++ signature:
        BulkRusselSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkSokalSimilarity(...) | source code
    C++ signature:
        BulkSokalSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / (2*B(bv1) + 2*B(bv2) - 3*B(bv1&bv2))
    C++ signature:
        BulkSokalSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### BulkTanimotoSimilarity(...) | source code
    C++ signature:
        BulkTanimotoSimilarity(SparseBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

    B(bv1&bv2) / (B(bv1) + B(bv2) - B(bv1&bv2))
    C++ signature:
        BulkTanimotoSimilarity(ExplicitBitVect bv1, boost::python::list bvList, bool returnDistance=0) -> boost::python::list

### ComputeL1Norm(...) | source code
    Compute the distance between two discrete vector values

    C++ signature:
        ComputeL1Norm(RDKit::DiscreteValueVect, RDKit::DiscreteValueVect) -> unsigned int

### ConvertToExplicit(...) | source code
    Converts a SparseBitVector to an ExplicitBitVector and returns the ExplicitBitVector
    C++ signature:
        ConvertToExplicit(SparseBitVect const*) -> ExplicitBitVect*

### CosineSimilarity(...) | source code
    C++ signature:
        CosineSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2) / sqrt(B(bv1) * B(bv2))
    C++ signature:
        CosineSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        CosineSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2) / sqrt(B(bv1) * B(bv2))
    C++ signature:
        CosineSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### CreateFromBitString(...) | source code
    Creates an ExplicitBitVect from a bit string (string of 0s and 1s).
    C++ signature:
        CreateFromBitString(std::string) -> ExplicitBitVect*

### DiceSimilarity(...) | source code
    C++ signature:
        DiceSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    2*B(bv1&bv2) / (B(bv1) + B(bv2))
    C++ signature:
        DiceSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        DiceSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    2*B(bv1&bv2) / (B(bv1) + B(bv2))
    C++ signature:
        DiceSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    return the Dice similarity between two vectors
    C++ signature:
        DiceSimilarity(RDKit::SparseIntVect<int> siv1, RDKit::SparseIntVect<int> siv2, bool returnDistance=False, double bounds=0.0) -> double

    return the Dice similarity between two vectors
    C++ signature:
        DiceSimilarity(RDKit::SparseIntVect<long long> siv1, RDKit::SparseIntVect<long long> siv2, bool returnDistance=False, double bounds=0.0) -> double

### FoldFingerprint(...) | source code
    C++ signature:
        FoldFingerprint(SparseBitVect bv, int foldFactor) -> SparseBitVect*
    C++ signature:
        FoldFingerprint(SparseBitVect bv) -> SparseBitVect*
    C++ signature:
        FoldFingerprint(ExplicitBitVect bv, int foldFactor) -> ExplicitBitVect*

    Returns a folded version of the bit vector

    C++ signature:
        FoldFingerprint(ExplicitBitVect bv) -> ExplicitBitVect*

### InitFromDaylightString(...) | source code
    C++ signature:
        InitFromDaylightString(SparseBitVect {lvalue}, std::string) -> void*

    Fill a BitVect using an ASCII (Daylight) encoding of a fingerprint.

       **Arguments**
         - bv: either a _SparseBitVect_ or an _ExplicitBitVect_
         - txt: a string with the Daylight encoding (this is the text that
                the Daylight tools put in the FP field of a TDT)

    C++ signature:
        InitFromDaylightString(ExplicitBitVect {lvalue}, std::string) -> void*

### KulczynskiSimilarity(...) | source code
    C++ signature:
        KulczynskiSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2)*(B(bv1) + B(bv2)) / (2 * B(bv1) * B(bv2))
    C++ signature:
        KulczynskiSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        KulczynskiSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2)*(B(bv1) + B(bv2)) / (2 * B(bv1) * B(bv2))
    C++ signature:
        KulczynskiSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### McConnaugheySimilarity(...) | source code
    C++ signature:
        McConnaugheySimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    (B(bv1&bv2) * (B(bv1)+B(bv2)) - B(bv1)*B(bv2)) / (B(bv1) * B(bv2))
    C++ signature:
        McConnaugheySimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        McConnaugheySimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    (B(bv1&bv2) * (B(bv1)+B(bv2)) - B(bv1)*B(bv2)) / (B(bv1) * B(bv2))
    C++ signature:
        McConnaugheySimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### NumBitsInCommon(...) | source code
    C++ signature:
        NumBitsInCommon(SparseBitVect, SparseBitVect) -> int

    Returns the total number of bits in common between the two bit vectors

    C++ signature:
        NumBitsInCommon(ExplicitBitVect, ExplicitBitVect) -> int

### OffBitProjSimilarity(...) | source code
    C++ signature:
        OffBitProjSimilarity(SparseBitVect, SparseBitVect) -> std::vector<double, std::allocator<double> >
    C++ signature:
        OffBitProjSimilarity(ExplicitBitVect, ExplicitBitVect) -> std::vector<double, std::allocator<double> >

### OffBitsInCommon(...) | source code
    C++ signature:
        OffBitsInCommon(SparseBitVect, SparseBitVect) -> std::vector<int, std::allocator<int> >

    Returns the number of off bits in common between the two bit vectors

    C++ signature:
        OffBitsInCommon(ExplicitBitVect, ExplicitBitVect) -> std::vector<int, std::allocator<int> >

### OnBitProjSimilarity(...) | source code
    C++ signature:
        OnBitProjSimilarity(SparseBitVect, SparseBitVect) -> std::vector<double, std::allocator<double> >

    Returns a 2-tuple: (B(bv1&bv2) / B(bv1), B(bv1&bv2) / B(bv2))
    C++ signature:
        OnBitProjSimilarity(ExplicitBitVect, ExplicitBitVect) -> std::vector<double, std::allocator<double> >

### OnBitSimilarity(...) | source code
    C++ signature:
        OnBitSimilarity(SparseBitVect v1, SparseBitVect v2) -> double

    B(bv1&bv2) / B(bv1|bv2)
    C++ signature:
        OnBitSimilarity(ExplicitBitVect v1, ExplicitBitVect v2) -> double

### OnBitsInCommon(...) | source code
    C++ signature:
        OnBitsInCommon(SparseBitVect, SparseBitVect) -> std::vector<int, std::allocator<int> >

    Returns the number of on bits in common between the two bit vectors

    C++ signature:
        OnBitsInCommon(ExplicitBitVect, ExplicitBitVect) -> std::vector<int, std::allocator<int> >

### RusselSimilarity(...) | source code
    C++ signature:
        RusselSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2) / B(bv1)
    C++ signature:
        RusselSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        RusselSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2) / B(bv1)
    C++ signature:
        RusselSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### SokalSimilarity(...) | source code
    C++ signature:
        SokalSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2) / (2*B(bv1) + 2*B(bv2) - 3*B(bv1&bv2))
    C++ signature:
        SokalSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        SokalSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2) / (2*B(bv1) + 2*B(bv2) - 3*B(bv1&bv2))
    C++ signature:
        SokalSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double

### TanimotoSimilarity(...) | source code
    C++ signature:
        TanimotoSimilarity(SparseBitVect bv1, SparseBitVect bv2, bool returnDistance=0) -> double

    B(bv1&bv2) / (B(bv1) + B(bv2) - B(bv1&bv2))
    C++ signature:
        TanimotoSimilarity(ExplicitBitVect bv1, ExplicitBitVect bv2, bool returnDistance=0) -> double
    C++ signature:
        TanimotoSimilarity(SparseBitVect bv1, std::string pkl, bool returnDistance=0) -> double

    B(bv1&bv2) / (B(bv1) + B(bv2) - B(bv1&bv2))
    C++ signature:
        TanimotoSimilarity(ExplicitBitVect bv1, std::string pkl, bool returnDistance=0) -> double