# Bioisostere TK

> Fragment-based bioisostere replacement and molecular scaffold hopping toolkit for finding alternative molecular fragments with similar properties

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

## Core API - Function Quick Reference

### Database Building & Management

**OEDBBuilder()**
  Use for: Building BROOD fragment databases from molecule collections
  Example: `builder = OEDBBuilder(); builder.Build(ofs, ifs)`
  See: [OEDBBuilder](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEDBBuilder.html)

**OEDBReader(filename: str)**
  Use for: Reading existing BROOD fragment databases
  Example: `reader = OEDBReader("fragments.brood")`
  See: [OEDBReader](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEDBReader.html)

**OEDBWriter(filename: str)**
  Use for: Writing fragment databases to disk
  Example: `writer = OEDBWriter("output.brood")`
  See: [OEDBWriter](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEDBWriter.html)

**OECPDDatabase()**
  Use for: Managing external compound databases for fragment source tracking
  Example: `cpddb = OECPDDatabase(); cpddb.AddMol(mol)`
  See: [OECPDDatabase](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OECPDDatabase.html)

### Query Creation & Fragment Selection

**OECreateBroodQuery(mol: OEMolBase, atomexpr: OEAtomBase) -> OEBroodQuery**
  Use for: Creating a query fragment from a molecule by selecting atoms
  Example: `query = OECreateBroodQuery(mol, OEAtomIsInRing())`
  See: [OECreateBroodQuery](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereFunctions/OECreateBroodQuery.html)

**OEBroodQuery()**
  Use for: Representing a fragment query for bioisostere searching
  Example: `query = OEBroodQuery(); query.SetMol(fragment)`
  See: [OEBroodQuery](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodQuery.html)

**OEReadBroodQuery(ifs: oemolistream) -> OEBroodQuery**
  Use for: Reading a saved query from file
  Example: `query = OEReadBroodQuery(ifs)`
  See: [OEReadBroodQuery](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereFunctions/OEReadBroodQuery.html)

**OEWriteBroodQuery(ofs: oemolostream, query: OEBroodQuery) -> bool**
  Use for: Saving a query to file for reuse
  Example: `OEWriteBroodQuery(ofs, query)`
  See: [OEWriteBroodQuery](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereFunctions/OEWriteBroodQuery.html)

### Fragment Searching & Scoring

**OEHitlistBuilder(reader: OEDBReader, query: OEBroodQuery)**
  Use for: Searching database for bioisosteric replacements
  Example: `hitlist = OEHitlistBuilder(reader, query); hitlist.Build()`
  See: [OEHitlistBuilder](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEHitlistBuilder.html)

**OEBroodHit()**
  Use for: Representing a single bioisostere hit result
  Example: `for hit in hitlist.GetHits(): score = hit.GetScore()`
  See: [OEBroodHit](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodHit.html)

**OEBroodScore()**
  Use for: Accessing detailed scoring information for a hit
  Example: `score = hit.GetScore(); shape_tani = score.GetShapeTanimoto()`
  See: [OEBroodScore](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodScore.html)

**OEBroodScoreOptions()**
  Use for: Configuring scoring parameters for hit evaluation
  Example: `opts = OEBroodScoreOptions(); opts.SetShapeWeight(0.5)`
  See: [OEBroodScoreOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodScoreOptions.html)

### Fragment Overlay & Alignment

**OEBroodOverlay(query: OEBroodQuery, hit: OEBroodHit)**
  Use for: Overlaying query and hit fragments in 3D space
  Example: `overlay = OEBroodOverlay(query, hit); overlay.Overlay()`
  See: [OEBroodOverlay](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodOverlay.html)

**OEFragOverlay()**
  Use for: Low-level fragment overlay operations
  Example: `foverlay = OEFragOverlay(); foverlay.Overlay(qfrag, hfrag)`
  See: [OEBroodOverlay](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEFragOverlay.html)

### Molecule Building & Replacement

**OEBroodMolBuilder(mol: OEMolBase, query: OEBroodQuery)**
  Use for: Replacing query fragment with hit fragment in parent molecule
  Example: `builder = OEBroodMolBuilder(mol, query); newmol = builder.Build(hit)`
  See: [OEBroodMolBuilder](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodMolBuilder.html)

### Configuration & Options

**OEBroodBuildOptions()**
  Use for: Configuring database building parameters
  Example: `opts = OEBroodBuildOptions(); opts.SetBuildType(OEBroodBuildType_Default)`
  See: [OEBroodBuildOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodBuildOptions.html)

**OEBroodHitlistOptions()**
  Use for: Configuring hitlist generation parameters
  Example: `opts = OEBroodHitlistOptions(); opts.SetMaxHits(100)`
  See: [OEBroodHitlistOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodHitlistOptions.html)

**OEBroodGeneralOptions()**
  Use for: Setting general BROOD search parameters
  Example: `opts = OEBroodGeneralOptions(); opts.SetNumProcessors(4)`
  See: [OEBroodGeneralOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodGeneralOptions.html)

**OEFragmentOptions()**
  Use for: Controlling fragment generation and filtering
  Example: `opts = OEFragmentOptions(); opts.SetMinAtoms(3)`
  See: [OEFragmentOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEFragmentOptions.html)

**OEDBScreenOptions()**
  Use for: Setting database screening parameters
  Example: `opts = OEDBScreenOptions(); opts.SetShapeCutoff(0.5)`
  See: [OEDBScreenOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEDBScreenOptions.html)

### Fragment Preparation & Processing

**OEBroodFragPrep()**
  Use for: Preparing fragments for database building
  Example: `prep = OEBroodFragPrep(); prep.Prep(mol)`
  See: [OEBroodFragPrep](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodFragPrep.html)

**OEGenerateConformers(mol: OEMolBase) -> bool**
  Use for: Generating conformers for fragment molecules
  Example: `OEGenerateConformers(fragment)`
  See: [OEGenerateConformers](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereFunctions/OEGenerateConformers.html)

**OEFragConfReader(filename: str)**
  Use for: Reading fragment conformer databases
  Example: `reader = OEFragConfReader("frags.oeb")`
  See: [OEFragConfReader](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEFragConfReader.html)

### Filtering & Database Management

**OEBroodDBFilter()**
  Use for: Filtering database entries during search
  Example: `filter = OEBroodDBFilter(); filter.SetMinHeavyAtoms(5)`
  See: [OEBroodDBFilter](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEBroodDBFilter.html)

**OEGetDBIndices(reader: OEDBReader) -> list**
  Use for: Getting indices of fragments in database
  Example: `indices = OEGetDBIndices(reader)`
  See: [OEGetDBIndices](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereFunctions/OEGetDBIndices.html)

### Property Calculation

**OEMolPropertyOptions()**
  Use for: Configuring molecular property calculations
  Example: `opts = OEMolPropertyOptions(); opts.SetCalcLogP(True)`
  See: [OEMolPropertyOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEMolPropertyOptions.html)

**OEIntrinsicPropOptions()**
  Use for: Setting intrinsic property calculation options
  Example: `opts = OEIntrinsicPropOptions()`
  See: [OEIntrinsicPropOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEIntrinsicPropOptions.html)

**OEExtrinsicPropOptions()**
  Use for: Setting extrinsic property calculation options
  Example: `opts = OEExtrinsicPropOptions()`
  See: [OEExtrinsicPropOptions](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereClasses/OEExtrinsicPropOptions.html)

### Status & Diagnostics

**OEGetBroodStatus(code: int) -> str**
  Use for: Getting human-readable status messages
  Example: `msg = OEGetBroodStatus(status_code)`
  See: [OEGetBroodStatus](https://docs.eyesopen.com/toolkits/python/bioisosteretk/OEBioisostereFunctions/OEGetBroodStatus.html)

## Common Patterns - Complete Working Examples

### Pattern: Building a Fragment Database from Molecules

```python
from openeye import oechem, oebioisostere

# Open input molecule file and output database
ifs = oechem.oemolistream("compounds.sdf")
ofs = oechem.oeofstream("fragments.brood")

# Configure database building options
opts = oebioisostere.OEBroodBuildOptions()
opts.SetBuildType(oebioisostere.OEBroodBuildType_Default)

# Build the fragment database
builder = oebioisostere.OEDBBuilder(opts)
if not builder.Build(ofs, ifs):
    oechem.OEThrow.Fatal("Failed to build database")
```
Use when: Creating a new fragment database from a collection of molecules for bioisostere searching

### Pattern: Creating a Query Fragment from a Molecule

```python
from openeye import oechem, oebioisostere

# Read the parent molecule
ifs = oechem.oemolistream("molecule.sdf")
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(ifs, mol)

# Select atoms for the query fragment (e.g., a ring system)
atomexpr = oechem.OEAtomIsInRing()
query = oebioisostere.OECreateBroodQuery(mol, atomexpr)

# Save query for reuse
ofs = oechem.oemolostream("query.brood")
oebioisostere.OEWriteBroodQuery(ofs, query)
```
Use when: Defining which part of a molecule to replace with bioisosteres

### Pattern: Searching for Bioisosteric Replacements

```python
from openeye import oechem, oebioisostere

# Load database and query
reader = oebioisostere.OEDBReader("fragments.brood")
ifs = oechem.oemolistream("query.brood")
query = oebioisostere.OEReadBroodQuery(ifs)

# Configure search options
opts = oebioisostere.OEBroodHitlistOptions()
opts.SetMaxHits(100)

# Search for bioisosteres
hitlist = oebioisostere.OEHitlistBuilder(reader, query, opts)
hitlist.Build()

# Process hits
for hit in hitlist.GetHits():
    score = hit.GetScore()
    print(f"Shape Tanimoto: {score.GetShapeTanimoto():.3f}")
```
Use when: Finding alternative fragments that could replace your query fragment

### Pattern: Replacing Fragment in Parent Molecule

```python
from openeye import oechem, oebioisostere

# Load parent molecule and create query
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("parent.sdf"), mol)
query = oebioisostere.OECreateBroodQuery(mol, oechem.OEAtomIsInRing())

# Search for replacements
reader = oebioisostere.OEDBReader("fragments.brood")
hitlist = oebioisostere.OEHitlistBuilder(reader, query)
hitlist.Build()

# Build new molecules with replacements
builder = oebioisostere.OEBroodMolBuilder(mol, query)
for hit in hitlist.GetHits():
    newmol = oechem.OEGraphMol()
    if builder.Build(newmol, hit):
        oechem.OEWriteMolecule(oechem.oemolostream("output.sdf"), newmol)
```
Use when: Generating new molecules by replacing a fragment with bioisosteres

### Pattern: Overlaying Query and Hit Fragments

```python
from openeye import oechem, oebioisostere

# Get query and hit
query = oebioisostere.OEReadBroodQuery(oechem.oemolistream("query.brood"))
reader = oebioisostere.OEDBReader("fragments.brood")
hitlist = oebioisostere.OEHitlistBuilder(reader, query)
hitlist.Build()
hit = hitlist.GetHits()[0]

# Create overlay
overlay = oebioisostere.OEBroodOverlay(query, hit)
overlay.Overlay()

# Get overlaid molecules
qmol = oechem.OEGraphMol()
hmol = oechem.OEGraphMol()
overlay.GetQueryMol(qmol)
overlay.GetHitMol(hmol)

# Write overlaid structures
oechem.OEWriteMolecule(oechem.oemolostream("overlay.oeb"), qmol)
oechem.OEWriteMolecule(oechem.oemolostream("overlay.oeb"), hmol)
```
Use when: Visualizing how a hit fragment aligns with the query fragment in 3D

### Pattern: Filtering Hits by Score Thresholds

```python
from openeye import oechem, oebioisostere

# Setup search with score filtering
reader = oebioisostere.OEDBReader("fragments.brood")
query = oebioisostere.OEReadBroodQuery(oechem.oemolistream("query.brood"))

opts = oebioisostere.OEBroodHitlistOptions()
score_opts = oebioisostere.OEBroodScoreOptions()
score_opts.SetShapeWeight(0.5)
score_opts.SetColorWeight(0.5)
opts.SetScoreOptions(score_opts)

# Build hitlist and filter
hitlist = oebioisostere.OEHitlistBuilder(reader, query, opts)
hitlist.Build()

for hit in hitlist.GetHits():
    score = hit.GetScore()
    if score.GetShapeTanimoto() > 0.7 and score.GetColorTanimoto() > 0.5:
        print(f"Good hit: Shape={score.GetShapeTanimoto():.3f}, Color={score.GetColorTanimoto():.3f}")
```
Use when: Filtering bioisostere hits based on shape and chemical feature similarity

### Pattern: Building Database with External Compound Tracking

```python
from openeye import oechem, oebioisostere

# Create compound database for tracking source molecules
cpddb = oebioisostere.OECPDDatabase()
ifs = oechem.oemolistream("compounds.sdf")
for mol in ifs.GetOEGraphMols():
    cpddb.AddMol(mol)

# Build fragment database with compound tracking
opts = oebioisostere.OEBroodBuildOptions()
opts.SetCPDDatabase(cpddb)

builder = oebioisostere.OEDBBuilder(opts)
ofs = oechem.oeofstream("fragments.brood")
builder.Build(ofs, ifs)

# Later, retrieve source compound for a hit
# hit.GetCPDIdx() returns index into cpddb
```
Use when: Tracking which parent molecules fragments came from in the database

### Pattern: Customizing Fragment Generation

```python
from openeye import oechem, oebioisostere

# Configure fragment generation options
frag_opts = oebioisostere.OEFragmentOptions()
frag_opts.SetMinAtoms(3)
frag_opts.SetMaxAtoms(15)
frag_opts.SetMinHeavyAtoms(3)

# Configure database building with fragment options
build_opts = oebioisostere.OEBroodBuildOptions()
build_opts.SetFragmentOptions(frag_opts)

# Build database with custom fragmentation
builder = oebioisostere.OEDBBuilder(build_opts)
ifs = oechem.oemolistream("compounds.sdf")
ofs = oechem.oeofstream("fragments.brood")
builder.Build(ofs, ifs)
```
Use when: Controlling the size and properties of fragments extracted from molecules

### Pattern: Preparing Fragments with Conformer Generation

```python
from openeye import oechem, oebioisostere

# Read fragment molecule
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("fragment.sdf"), mol)

# Prepare fragment (standardize, protonate, etc.)
prep = oebioisostere.OEBroodFragPrep()
prep.Prep(mol)

# Generate conformers for the fragment
oebioisostere.OEGenerateConformers(mol)

# Write prepared fragment with conformers
ofs = oechem.oemolostream("prepared_fragment.oeb")
oechem.OEWriteMolecule(ofs, mol)
```
Use when: Preparing fragment molecules before adding to database or using as queries

### Pattern: Screening Database with Shape Cutoff

```python
from openeye import oechem, oebioisostere

# Configure screening options
screen_opts = oebioisostere.OEDBScreenOptions()
screen_opts.SetShapeCutoff(0.5)
screen_opts.SetColorCutoff(0.3)

# Setup hitlist with screening
reader = oebioisostere.OEDBReader("fragments.brood")
query = oebioisostere.OEReadBroodQuery(oechem.oemolistream("query.brood"))

hitlist_opts = oebioisostere.OEBroodHitlistOptions()
hitlist_opts.SetScreenOptions(screen_opts)

# Build filtered hitlist
hitlist = oebioisostere.OEHitlistBuilder(reader, query, hitlist_opts)
hitlist.Build()

print(f"Found {hitlist.NumHits()} hits passing cutoffs")
```
Use when: Pre-filtering database hits to only return fragments above similarity thresholds

### Pattern: Bridging Two Molecules with Fragment Linker

```python
from openeye import oechem, oebioisostere

# Load two molecules to bridge
mol1 = oechem.OEGraphMol()
mol2 = oechem.OEGraphMol()
oechem.OEReadMolecule(oechem.oemolistream("mol1.sdf"), mol1)
oechem.OEReadMolecule(oechem.oemolistream("mol2.sdf"), mol2)

# Create bridging query from attachment points
# Select atoms that will be connection points
atom1 = mol1.GetAtom(oechem.OEHasAtomIdx(5))
atom2 = mol2.GetAtom(oechem.OEHasAtomIdx(3))

# Search for linker fragments
reader = oebioisostere.OEDBReader("fragments.brood")
# Query creation for bridging requires special setup
# See documentation for OECreateBroodQuery bridging mode
```
Use when: Finding fragments that can link two separate molecular pieces

### Pattern: Calculating Molecular Properties for Hits

```python
from openeye import oechem, oebioisostere

# Configure property calculation
prop_opts = oebioisostere.OEMolPropertyOptions()
prop_opts.SetCalcLogP(True)
prop_opts.SetCalcPSA(True)

# Search and calculate properties
reader = oebioisostere.OEDBReader("fragments.brood")
query = oebioisostere.OEReadBroodQuery(oechem.oemolistream("query.brood"))
hitlist = oebioisostere.OEHitlistBuilder(reader, query)
hitlist.Build()

# Get properties for each hit
for hit in hitlist.GetHits():
    mol = oechem.OEGraphMol()
    hit.GetMol(mol)
    # Properties are stored as SD data on molecule
    logp = oechem.OEGetSDData(mol, "LogP")
    psa = oechem.OEGetSDData(mol, "PSA")
    print(f"LogP: {logp}, PSA: {psa}")
```
Use when: Evaluating physicochemical properties of bioisostere replacements

### Pattern: Reading and Processing Database Packets

```python
from openeye import oechem, oebioisostere

# Open database for low-level access
reader = oebioisostere.OEDBReader("fragments.brood")

# Get database indices
indices = oebioisostere.OEGetDBIndices(reader)

# Read individual packets
for idx in indices[:10]:  # First 10 fragments
    packet = oebioisostere.OEBroodDBPacket()
    if reader.Read(packet, idx):
        mol = oechem.OEGraphMol()
        packet.GetMol(mol)
        print(f"Fragment {idx}: {mol.NumAtoms()} atoms")
```
Use when: Directly accessing database contents for custom processing or analysis

## API Decision Guide

### Database Operations
- **Building new database**: use `OEDBBuilder` with `OEBroodBuildOptions` to control fragmentation
- **Reading existing database**: use `OEDBReader` for searching, `OEDBWriter` for creating
- **Tracking source compounds**: use `OECPDDatabase` when you need to know which molecules fragments came from
- **Low-level database access**: use `OEGetDBIndices` and `OEBroodDBPacket` for direct packet reading

### Query Creation
- **From molecule selection**: use `OECreateBroodQuery(mol, atomexpr)` to select fragment by atom expression
- **From file**: use `OEReadBroodQuery` to load saved query
- **Manual construction**: use `OEBroodQuery()` constructor and `SetMol()` for custom queries
- **Bridging mode**: use special `OECreateBroodQuery` setup for linking two molecules (see bridging examples)

### Searching & Scoring
- **Basic search**: use `OEHitlistBuilder(reader, query)` with default options
- **Filtered search**: use `OEBroodHitlistOptions` with `OEDBScreenOptions` to set cutoffs
- **Custom scoring**: use `OEBroodScoreOptions` to adjust shape/color weights
- **Score access**: use `hit.GetScore()` to get `OEBroodScore` object with detailed metrics

### Fragment Replacement
- **Replace in parent molecule**: use `OEBroodMolBuilder(mol, query)` then `Build(newmol, hit)`
- **3D overlay only**: use `OEBroodOverlay(query, hit)` for visualization without replacement
- **Low-level overlay**: use `OEFragOverlay` for custom overlay operations

### Fragment Preparation
- **Standardize fragments**: use `OEBroodFragPrep` before database building
- **Generate conformers**: use `OEGenerateConformers` for multi-conformer fragments
- **Read conformer databases**: use `OEFragConfReader` for pre-generated conformer libraries

### Filtering & Options
- **Fragment size control**: use `OEFragmentOptions` with `SetMinAtoms/SetMaxAtoms`
- **Hit count limits**: use `OEBroodHitlistOptions.SetMaxHits()`
- **Shape/color cutoffs**: use `OEDBScreenOptions.SetShapeCutoff/SetColorCutoff`
- **Database filtering**: use `OEBroodDBFilter` for property-based filtering during search

### Property Calculation
- **Standard properties**: use `OEMolPropertyOptions` for LogP, PSA, etc.
- **Intrinsic properties**: use `OEIntrinsicPropOptions` for fragment-specific properties
- **Extrinsic properties**: use `OEExtrinsicPropOptions` for context-dependent properties

## Common Parameters & Types

**OEBroodQuery**: Represents a fragment query for bioisostere searching
  - Create with: `OECreateBroodQuery(mol, atomexpr)` or `OEReadBroodQuery(ifs)`
  - Common in: `OEHitlistBuilder`, `OEBroodOverlay`, `OEBroodMolBuilder`
  - Gotcha: Must have 3D coordinates; query fragment should be chemically reasonable

**OEBroodHit**: A single bioisostere search result
  - Create with: Returned by `hitlist.GetHits()` iterator
  - Common in: `OEBroodMolBuilder.Build()`, `OEBroodOverlay` constructor
  - Access: `hit.GetScore()` for scoring, `hit.GetMol()` for structure, `hit.GetCPDIdx()` for source

**OEDBReader**: Database reader for fragment databases
  - Create with: `OEDBReader("filename.brood")`
  - Common in: `OEHitlistBuilder` constructor, `OEGetDBIndices()`
  - Gotcha: Database must be built with compatible BROOD version

**OEBroodScore**: Detailed scoring information for a hit
  - Create with: Returned by `hit.GetScore()`
  - Methods: `GetShapeTanimoto()`, `GetColorTanimoto()`, `GetTanimotoCombo()`
  - Typical values: Tanimoto scores range 0.0-1.0; >0.7 is good similarity

**OEAtomBase/OEAtomBondSet**: Atom selection for query creation
  - Create with: Atom predicates like `OEAtomIsInRing()`, `OEIsHeavy()`, or manual selection
  - Common in: `OECreateBroodQuery(mol, atomexpr)`
  - Gotcha: Selected atoms must form a connected fragment

**OEBroodBuildOptions**: Configuration for database building
  - Create with: `OEBroodBuildOptions()` then set parameters
  - Key methods: `SetBuildType()`, `SetFragmentOptions()`, `SetCPDDatabase()`
  - Common in: `OEDBBuilder` constructor

**OEBroodHitlistOptions**: Configuration for search behavior
  - Create with: `OEBroodHitlistOptions()` then set parameters
  - Key methods: `SetMaxHits()`, `SetScoreOptions()`, `SetScreenOptions()`
  - Common in: `OEHitlistBuilder` constructor
  - Typical values: MaxHits 50-500 depending on use case

**OEFragmentOptions**: Controls fragment generation from molecules
  - Create with: `OEFragmentOptions()` then set size limits
  - Key methods: `SetMinAtoms()`, `SetMaxAtoms()`, `SetMinHeavyAtoms()`
  - Common in: `OEBroodBuildOptions.SetFragmentOptions()`
  - Typical values