# GraphSim TK

> Molecular similarity and fingerprint-based searching toolkit for virtual screening and compound clustering

## Links
- [Full Documentation](https://docs.eyesopen.com/toolkits/python/graphsimtk/index.html)
- [Theory](https://docs.eyesopen.com/toolkits/python/graphsimtk/theory.html)
- [Code Examples](https://docs.eyesopen.com/toolkits/python/graphsimtk/examples_summary.html)
- [API Reference](https://docs.eyesopen.com/toolkits/python/graphsimtk/api.html)

## Core API - Function Quick Reference

### Fingerprint Generation

```
OEMakeFP(fp: OEFingerPrint, mol: OEMolBase, fptype: int = OEFPType_Tree) -> bool
  Use for: Generate a fingerprint from a molecule using specified fingerprint type
  Example: OEMakeFP(fp, mol, OEFPType_Circular)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEMakeFP.html

OEMakeCircularFP(fp: OEFingerPrint, mol: OEMolBase, numbits: int = 4096, minradius: int = 0, maxradius: int = 5) -> bool
  Use for: Generate circular (ECFP-like) fingerprints with custom parameters
  Example: OEMakeCircularFP(fp, mol, 2048, 0, 3)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEMakeCircularFP.html

OEMakePathFP(fp: OEFingerPrint, mol: OEMolBase, numbits: int = 4096, minbonds: int = 0, maxbonds: int = 5) -> bool
  Use for: Generate path-based fingerprints encoding linear atom sequences
  Example: OEMakePathFP(fp, mol, 2048, 0, 7)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEMakePathFP.html

OEMakeTreeFP(fp: OEFingerPrint, mol: OEMolBase, numbits: int = 4096, minbonds: int = 0, maxbonds: int = 5) -> bool
  Use for: Generate tree-based fingerprints encoding branched atom patterns
  Example: OEMakeTreeFP(fp, mol, 4096, 0, 6)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEMakeTreeFP.html

OEMakeMACCS166FP(fp: OEFingerPrint, mol: OEMolBase) -> bool
  Use for: Generate MACCS 166-bit structural keys fingerprint
  Example: OEMakeMACCS166FP(fp, mol)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEMakeMACCS166FP.html

OEMakeLingoFP(fp: OEFingerPrint, mol: OEMolBase, q: int = 4) -> bool
  Use for: Generate LINGO fingerprints based on canonical SMILES substrings
  Example: OEMakeLingoFP(fp, mol, 4)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEMakeLingoFP.html
```

### Similarity Calculation

```
OETanimoto(fp1: OEFingerPrint, fp2: OEFingerPrint) -> float
  Use for: Calculate Tanimoto similarity coefficient between two fingerprints
  Example: sim = OETanimoto(query_fp, target_fp)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OETanimoto.html

OETversky(fp1: OEFingerPrint, fp2: OEFingerPrint, alpha: float, beta: float) -> float
  Use for: Calculate Tversky similarity with custom weighting (asymmetric similarity)
  Example: sim = OETversky(query_fp, target_fp, 0.95, 0.05)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OETversky.html

OEDice(fp1: OEFingerPrint, fp2: OEFingerPrint) -> float
  Use for: Calculate Dice similarity coefficient (Sørensen-Dice index)
  Example: sim = OEDice(fp1, fp2)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEDice.html

OECosine(fp1: OEFingerPrint, fp2: OEFingerPrint) -> float
  Use for: Calculate cosine similarity between fingerprints
  Example: sim = OECosine(fp1, fp2)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OECosine.html

OEEuclid(fp1: OEFingerPrint, fp2: OEFingerPrint) -> float
  Use for: Calculate Euclidean distance between fingerprints
  Example: dist = OEEuclid(fp1, fp2)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEEuclid.html
```

### Fingerprint Database Operations

```
OEFPDatabase(fptype: int = OEFPType_Tree, opts: OEFPDatabaseOptions = None) -> OEFPDatabase
  Use for: Create a fingerprint database for similarity searching
  Example: fpdb = OEFPDatabase(OEFPType_Circular)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimClasses/OEFPDatabase.html

OEFPDatabase.AddFP(mol: OEMolBase) -> bool
  Use for: Add a molecule's fingerprint to the database
  Example: fpdb.AddFP(mol)

OEFPDatabase.Search(query: OEMolBase, simfunc: OESimFuncBase, limit: int = 0) -> OESimSearchResult
  Use for: Search database for similar molecules using a similarity function
  Example: results = fpdb.Search(query_mol, OETanimotoSim(), 100)

OEFPDatabase.SortedSearch(query: OEMolBase, simfunc: OESimFuncBase, limit: int = 0) -> OESimSearchResult
  Use for: Search database and return results sorted by similarity score
  Example: results = fpdb.SortedSearch(query_mol, OETanimotoSim(), 50)
```

### Fast Fingerprint Database (GPU-Accelerated)

```
OECreateFastFPDatabaseFile(dbfname: str, molfname: str, opts: OECreateFastFPDatabaseOptions) -> bool
  Use for: Create a GPU-optimized fingerprint database file from molecules
  Example: OECreateFastFPDatabaseFile("db.fpbin", "mols.sdf", opts)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OECreateFastFPDatabaseFile.html

OEFastFPDatabase(dbfname: str, memtype: int = OEFastFPDatabaseMemoryType_Default) -> OEFastFPDatabase
  Use for: Open a fast fingerprint database for GPU-accelerated searching
  Example: fastdb = OEFastFPDatabase("db.fpbin")
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimClasses/OEFastFPDatabase.html

OEFastFPDatabase.Search(query: OEFingerPrint, simfunc: OESimFuncBase, limit: int) -> OESimSearchResult
  Use for: Perform GPU-accelerated similarity search
  Example: results = fastdb.Search(query_fp, OETanimotoSim(), 1000)
```

### Fingerprint Analysis

```
OEGetFPCoverage(fp: OEFingerPrint, mol: OEMolBase, atomset: OEAtomBondSet) -> bool
  Use for: Identify which atoms/bonds contribute to fingerprint bits
  Example: OEGetFPCoverage(fp, mol, atomset)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEGetFPCoverage.html

OEGetFPOverlap(fp1: OEFingerPrint, fp2: OEFingerPrint, mol1: OEMolBase, mol2: OEMolBase, atomset1: OEAtomBondSet, atomset2: OEAtomBondSet) -> bool
  Use for: Find overlapping structural features between two molecules
  Example: OEGetFPOverlap(fp1, fp2, mol1, mol2, set1, set2)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEGetFPOverlap.html

OEGetFPPatterns(patterns: OEFPPatternVec, fp: OEFingerPrint, mol: OEMolBase) -> bool
  Use for: Extract all structural patterns encoded in a fingerprint
  Example: OEGetFPPatterns(patterns, fp, mol)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEGetFPPatterns.html

OEGetBitCounts(fp: OEFingerPrint) -> list
  Use for: Get count of each bit set in the fingerprint
  Example: counts = OEGetBitCounts(fp)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEGetBitCounts.html
```

### Fingerprint Type Configuration

```
OEGetFPType(fptype_str: str) -> int
  Use for: Convert fingerprint type string to integer constant
  Example: fptype = OEGetFPType("Circular,numbits=2048")
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEGetFPType.html

OEConfigureFingerPrint(fp: OEFingerPrint, fptype_str: str) -> bool
  Use for: Configure fingerprint object from string specification
  Example: OEConfigureFingerPrint(fp, "Path,numbits=4096,maxbonds=7")
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEConfigureFingerPrint.html

OESetupFingerPrint(fp: OEFingerPrint, fptype: int) -> bool
  Use for: Initialize fingerprint with specified type constant
  Example: OESetupFingerPrint(fp, OEFPType_Tree)
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OESetupFingerPrint.html
```

### Utility Functions

```
OEIsSameFPType(fp1: OEFingerPrint, fp2: OEFingerPrint) -> bool
  Use for: Check if two fingerprints have the same type and parameters
  Example: if OEIsSameFPType(fp1, fp2): compare_fps()
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEIsSameFPType.html

OEGraphsimIsGPUReady() -> bool
  Use for: Check if GPU acceleration is available for fast fingerprint searches
  Example: if OEGraphsimIsGPUReady(): use_fast_db()
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEGraphsimIsGPUReady.html

OEIsFastFPDatabaseReady(dbfname: str) -> bool
  Use for: Verify that a fast fingerprint database file is valid and ready
  Example: if OEIsFastFPDatabaseReady("db.fpbin"): open_db()
  See: https://docs.eyesopen.com/toolkits/python/graphsimtk/OEGraphSimFunctions/OEIsFastFPDatabaseReady.html
```

## Common Patterns - Complete Working Examples

### Pattern: Basic Similarity Search with Fingerprint Database

```python
from openeye import oechem, oegraphsim

# Create fingerprint database
fpdb = oegraphsim.OEFPDatabase(oegraphsim.OEFPType_Tree)

# Add molecules from file to database
ifs = oechem.oemolistream("database.sdf")
for mol in ifs.GetOEMols():
    fpdb.AddFP(mol)

# Search with query molecule
query = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("query.sdf"), query)
results = fpdb.SortedSearch(query, oegraphsim.OETanimotoSim(), 100)

# Process results
for score in results.GetScores():
    print(f"Molecule {score.GetIdx()}: {score.GetScore():.3f}")
```
Use when: You need to find similar molecules in a database using standard CPU-based search

### Pattern: GPU-Accelerated Fast Fingerprint Search

```python
from openeye import oechem, oegraphsim

# Create fast fingerprint database file
opts = oegraphsim.OECreateFastFPDatabaseOptions()
opts.SetFPTypeBase(oegraphsim.OEGetFPType("Circular,numbits=2048"))
oegraphsim.OECreateFastFPDatabaseFile("fast.fpbin", "database.sdf", opts)

# Open database and search
fastdb = oegraphsim.OEFastFPDatabase("fast.fpbin")
query_fp = oegraphsim.OEFingerPrint()
oegraphsim.OEMakeFP(query_fp, query_mol, fastdb.GetFPTypeBase())
results = fastdb.Search(query_fp, oegraphsim.OETanimotoSim(), 1000)

# Retrieve hit molecules
for score in results.GetScores():
    mol = oechem.OEGraphMol()
    fastdb.GetMolecule(mol, score.GetIdx())
    print(f"{mol.GetTitle()}: {score.GetScore():.3f}")
```
Use when: You have large databases (>100K molecules) and need maximum search speed with GPU acceleration

### Pattern: Custom Fingerprint Type with Specific Parameters

```python
from openeye import oechem, oegraphsim

# Create circular fingerprint with custom parameters
fp = oegraphsim.OEFingerPrint()
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("molecule.sdf"), mol)

# Generate fingerprint: 2048 bits, radius 0-3
oegraphsim.OEMakeCircularFP(fp, mol, 2048, 0, 3)

# Alternative: configure from string
fp2 = oegraphsim.OEFingerPrint()
oegraphsim.OEConfigureFingerPrint(fp2, "Circular,numbits=2048,minradius=0,maxradius=3")
oegraphsim.OEMakeFP(fp2, mol)

# Calculate similarity
similarity = oegraphsim.OETanimoto(fp, fp2)
```
Use when: You need specific fingerprint parameters for your application (e.g., smaller radius for fragment-like molecules)

### Pattern: Tversky Asymmetric Similarity for Substructure Searching

```python
from openeye import oechem, oegraphsim

# Create fingerprints for query and target
query_fp = oegraphsim.OEFingerPrint()
target_fp = oegraphsim.OEFingerPrint()
oegraphsim.OEMakeFP(query_fp, query_mol, oegraphsim.OEFPType_Path)
oegraphsim.OEMakeFP(target_fp, target_mol, oegraphsim.OEFPType_Path)

# Tversky with alpha=0.95, beta=0.05 emphasizes query features
# Good for finding molecules containing the query substructure
tversky_sim = oegraphsim.OETversky(query_fp, target_fp, 0.95, 0.05)

# Use in database search
fpdb = oegraphsim.OEFPDatabase(oegraphsim.OEFPType_Path)
# ... add molecules ...
results = fpdb.Search(query_mol, oegraphsim.OETverskySim(0.95, 0.05), 100)
```
Use when: You want asymmetric similarity (e.g., finding molecules that contain query features, not just similar molecules)

### Pattern: Visualizing Fingerprint Coverage on Molecule

```python
from openeye import oechem, oegraphsim, oedepict

# Generate fingerprint and get coverage
fp = oegraphsim.OEFingerPrint()
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("mol.sdf"), mol)
oegraphsim.OEMakeFP(fp, mol, oegraphsim.OEFPType_Circular)

# Get atoms/bonds contributing to fingerprint
atomset = oechem.OEAtomBondSet()
oegraphsim.OEGetFPCoverage(fp, mol, atomset)

# Highlight covered atoms in depiction
oedepict.OEPrepareDepiction(mol)
oedepict.OERenderMolecule("coverage.png", mol, atomset)
```
Use when: You need to understand which parts of a molecule contribute to its fingerprint representation

### Pattern: Finding Common Substructures Between Two Molecules

```python
from openeye import oechem, oegraphsim, oedepict

# Create fingerprints for both molecules
fp1 = oegraphsim.OEFingerPrint()
fp2 = oegraphsim.OEFingerPrint()
oegraphsim.OEMakeFP(fp1, mol1, oegraphsim.OEFPType_Tree)
oegraphsim.OEMakeFP(fp2, mol2, oegraphsim.OEFPType_Tree)

# Get overlapping features
atomset1 = oechem.OEAtomBondSet()
atomset2 = oechem.OEAtomBondSet()
oegraphsim.OEGetFPOverlap(fp1, fp2, mol1, mol2, atomset1, atomset2)

# Visualize overlap on both molecules
oedepict.OERenderMolecule("mol1_overlap.png", mol1, atomset1)
oedepict.OERenderMolecule("mol2_overlap.png", mol2, atomset2)
```
Use when: You want to identify and visualize common structural features between two molecules

### Pattern: Extracting and Analyzing Fingerprint Patterns

```python
from openeye import oechem, oegraphsim

# Generate fingerprint
fp = oegraphsim.OEFingerPrint()
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("mol.sdf"), mol)
oegraphsim.OEMakeFP(fp, mol, oegraphsim.OEFPType_Path)

# Extract all patterns
patterns = oegraphsim.OEFPPatternVec()
oegraphsim.OEGetFPPatterns(patterns, fp, mol)

# Analyze patterns
for pattern in patterns:
    print(f"Pattern: {pattern.GetSMARTS()}")
    print(f"Bit index: {pattern.GetBitIdx()}")
    print(f"Atoms: {[a.GetIdx() for a in pattern.GetAtoms()]}")
```
Use when: You need to understand what structural patterns are encoded in a fingerprint

### Pattern: Comparing Multiple Similarity Measures

```python
from openeye import oechem, oegraphsim

# Create fingerprints
fp1 = oegraphsim.OEFingerPrint()
fp2 = oegraphsim.OEFingerPrint()
oegraphsim.OEMakeFP(fp1, mol1, oegraphsim.OEFPType_Circular)
oegraphsim.OEMakeFP(fp2, mol2, oegraphsim.OEFPType_Circular)

# Calculate different similarity measures
tanimoto = oegraphsim.OETanimoto(fp1, fp2)
dice = oegraphsim.OEDice(fp1, fp2)
cosine = oegraphsim.OECosine(fp1, fp2)
tversky = oegraphsim.OETversky(fp1, fp2, 0.5, 0.5)

print(f"Tanimoto: {tanimoto:.3f}, Dice: {dice:.3f}")
print(f"Cosine: {cosine:.3f}, Tversky: {tversky:.3f}")
```
Use when: You want to compare how different similarity metrics rank molecule pairs

### Pattern: Building Database with Custom Fingerprint Options

```python
from openeye import oechem, oegraphsim

# Configure database options
opts = oegraphsim.OEFPDatabaseOptions()
opts.SetFPTypeBase(oegraphsim.OEGetFPType("Path,numbits=4096,maxbonds=7"))
opts.SetTracer(oechem.OEConsoleErrorHandler())

# Create database with options
fpdb = oegraphsim.OEFPDatabase(opts)

# Add molecules
ifs = oechem.oemolistream("molecules.sdf")
for mol in ifs.GetOEMols():
    if not fpdb.AddFP(mol):
        print(f"Failed to add {mol.GetTitle()}")

# Save database to file
ofs = oechem.oeofstream("database.fpbin")
oegraphsim.OEWriteFPDatabase(ofs, fpdb)
```
Use when: You need to create a persistent fingerprint database with specific fingerprint parameters

### Pattern: MACCS Keys Fingerprint for Drug-like Molecules

```python
from openeye import oechem, oegraphsim

# Create MACCS 166-bit fingerprint
maccs_fp = oegraphsim.OEFingerPrint()
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("drug.sdf"), mol)
oegraphsim.OEMakeMACCS166FP(maccs_fp, mol)

# Build MACCS database for drug-like screening
fpdb = oegraphsim.OEFPDatabase(oegraphsim.OEFPType_MACCS166)
ifs = oechem.oemolistream("drugbank.sdf")
for drug in ifs.GetOEMols():
    fpdb.AddFP(drug)

# Search for similar drugs
results = fpdb.SortedSearch(query_mol, oegraphsim.OETanimotoSim(), 50)
```
Use when: You're working with drug-like molecules and want interpretable structural keys

### Pattern: LINGO Fingerprint for Fast Text-Based Similarity

```python
from openeye import oechem, oegraphsim

# Create LINGO fingerprint (based on SMILES substrings)
lingo_fp = oegraphsim.OEFingerPrint()
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("mol.sdf"), mol)
oegraphsim.OEMakeLingoFP(lingo_fp, mol, 4)  # q=4 (4-character substrings)

# LINGO is fast for large-scale screening
fpdb = oegraphsim.OEFPDatabase(oegraphsim.OEFPType_Lingo)
ifs = oechem.oemolistream("large_library.sdf")
for lib_mol in ifs.GetOEMols():
    fpdb.AddFP(lib_mol)

# Quick similarity search
results = fpdb.Search(query_mol, oegraphsim.OETanimotoSim(), 1000)
```
Use when: You need very fast similarity searching and can tolerate approximate results based on SMILES representation

### Pattern: Batch Processing with Result Filtering

```python
from openeye import oechem, oegraphsim

# Setup database
fpdb = oegraphsim.OEFPDatabase(oegraphsim.OEFPType_Circular)
ifs = oechem.oemolistream("database.sdf")
for mol in ifs.GetOEMols():
    fpdb.AddFP(mol)

# Process multiple queries
query_ifs = oechem.oemolistream("queries.sdf")
ofs = oechem.oemolostream("hits.sdf")

for query in query_ifs.GetOEMols():
    results = fpdb.SortedSearch(query, oegraphsim.OETanimotoSim(), 0)
    for score in results.GetScores():
        if score.GetScore() >= 0.7:  # Filter by similarity threshold
            hit_mol = oechem.OEGraphMol()
            fpdb.GetMolecule(hit_mol, score.GetIdx())
            oechem.OESetSDData(hit_mol, "Similarity", f"{score.GetScore():.3f}")
            oechem.OEWriteMolecule(ofs, hit_mol)
```
Use when: You need to process multiple queries and filter results by similarity threshold

## API Decision Guide

### Choosing Fingerprint Types

- **For general-purpose similarity**: use `OEFPType_Tree` or `OEFPType_Circular` (most common, good balance)
- **For substructure-aware similarity**: use `OEFPType_Path` (encodes linear paths through molecule)
- **For drug-like molecules with interpretable features**: use `OEFPType_MACCS166` (166 predefined structural keys)
- **For very fast approximate similarity**: use `OEFPType_Lingo` (SMILES-based, fastest but less accurate)
- **For fragment-based work**: use `OEMakeCircularFP` with small radius (0-2) and fewer bits

### Choosing Similarity Measures

- **For symmetric similarity (A vs B = B vs A)**: use `OETanimoto` (most common, range 0-1)
- **For asymmetric similarity (finding superstructures)**: use `OETversky` with alpha=0.95, beta=0.05
- **For asymmetric similarity (finding substructures)**: use `OETversky` with alpha=0.05, beta=0.95
- **For balanced similarity alternative**: use `OEDice` (similar to Tanimoto but different weighting)
- **For distance-based clustering**: use `OEEuclid` (returns distance, not similarity)

### Choosing Database Type

- **For databases < 100K molecules**: use `OEFPDatabase` (standard CPU-based, easy to use)
- **For databases > 100K molecules with GPU**: use `OEFastFPDatabase` (GPU-accelerated, 10-100x faster)
- **For in-memory searching**: use `OEFPDatabase` (keeps all data in RAM)
- **For disk-based searching**: use `OEFastFPDatabase` with `OEFastFPDatabaseMemoryType_Lazy` (memory-mapped)

### Choosing Search Method

- **For top-N similar molecules**: use `SortedSearch(query, simfunc, N)` (returns sorted results)
- **For all molecules above threshold**: use `Search(query, simfunc, 0)` then filter by score
- **For custom similarity function**: create class inheriting `OESimFuncBase` and override `operator()`

### Fingerprint Configuration

- **For quick setup with defaults**: use `OEMakeFP(fp, mol, OEFPType_Tree)`
- **For custom parameters via string**: use `OEConfigureFingerPrint(fp, "Circular,numbits=2048,maxradius=3")`
- **For programmatic parameter control**: use specific functions like `OEMakeCircularFP(fp, mol, 2048, 0, 3)`

### Analysis and Visualization

- **To see which atoms contribute to fingerprint**: use `OEGetFPCoverage(fp, mol, atomset)`
- **To find common features between molecules**: use `OEGetFPOverlap(fp1, fp2, mol1, mol2, set1, set2)`
- **To extract all encoded patterns**: use `OEGetFPPatterns(patterns, fp, mol)`

## Common Parameters & Types

**OEFingerPrint**: Represents a molecular fingerprint (bit vector or count vector)
  - Create with: `fp = oegraphsim.OEFingerPrint()`
  - Common in: All fingerprint generation and similarity functions
  - Gotcha: Must be initialized with correct type before use; check compatibility with `OEIsSameFPType()`

**OEFPType constants**: Integer constants specifying fingerprint algorithm
  - Values: `OEFPType_Tree`, `OEFPType_Circular`, `OEFPType_Path`, `OEFPType_MACCS166`, `OEFPType_Lingo`
  - Common in: `OEMakeFP()`, `OEFPDatabase()`, fingerprint configuration
  - Typical usage: `oegraphsim.OEFPType_Circular` for ECFP-like fingerprints

**OESimFuncBase**: Base class for similarity/distance functions
  - Create with: `sim = oegraphsim.OETanimotoSim()` or `sim = oegraphsim.OETverskySim(alpha, beta)`
  - Common in: Database search methods (`Search()`, `SortedSearch()`)
  - Built-in implementations: `OETanimotoSim`, `OETverskySim`, `OEDiceSim`, `OECosineSim`, `OEEuclidSim`

**OEFP