---
title: Workflow Recipes
description: >-
  Step-by-step drug discovery tutorials combining multiple CLI commands into
  complete workflows.
tags:
  - recipes
  - tutorials
  - drug-discovery
  - workflow
  - docking
  - admet
---

These recipes chain multiple CLI commands into complete, end-to-end drug discovery workflows — from structure prediction and docking to library screening. Reach for them when you want a worked, copy-and-adapt example rather than piecing commands together yourself, and when you're ready to turn a workflow into a reproducible script or CI/CD pipeline. Every step runs on the same backend and job history as the rest of the CLI, so intermediate results carry forward across commands. For the full command set, see the [CLI overview](/docs/cli).

  intermediate

## Workflow Recipes

Step-by-step drug discovery tutorials combining multiple CLI commands into complete workflows.

---

## Recipe 1: Structure-Based Drug Discovery

Start from a protein sequence, predict its structure, prepare it for docking, find binding sites, dock a ligand, and evaluate drug-likeness.

```
Sequence → ESMFold → ProteinPrep → Sites → DiffDock → ADMET
```

#### Predict protein structure

```bash
ivybloom run esmfold protein_sequence=MKLVFFAEDVGSNKGAIIGLMVGGVVIA --follow
```

Output:
```
Job submitted: job_fold_001
Status: pending → running → completed (2m 15s)
pLDDT: 87.3 (Good confidence)
```

Download the predicted structure:
```bash
ivybloom jobs download job_fold_001 --output ./structures/
```

#### Prepare the structure for docking

```bash
ivybloom proteinprep run ./structures/predicted_structure.pdb \
  --ph 7.4 \
  --detect-sites \
  --wait
```

Output:
```
Quality check: PASSED (no missing atoms, no clashes)
Hydrogens added: 1,234
Binding sites detected: 3
```

#### Identify binding sites

```bash
ivybloom proteinprep sites ./structures/predicted_structure.pdb \
  --method p2rank \
  --top-n 3
```

Output:
```
Site 1: Score 0.92, Center (12.3, 45.6, 78.9), Volume 823 Å³
Site 2: Score 0.78, Center (34.5, 67.8, 12.3), Volume 615 Å³
Site 3: Score 0.61, Center (56.7, 89.0, 34.5), Volume 498 Å³
```

#### Dock a ligand

```bash
ivybloom run diffdock \
  receptor=./structures/prepared.pdb \
  ligand="CC(=O)Oc1ccccc1C(=O)O" \
  --follow
```

#### Evaluate drug-likeness

```bash
ivybloom run admet smiles='CC(=O)Oc1ccccc1C(=O)O' --follow
```

Output:
```
Absorption: High intestinal absorption (94%)
Distribution: BBB penetrant
Metabolism: Low CYP inhibition
Excretion: t½ = 3.2h
Toxicity: Low risk (ProTox class IV)
```

---

## Recipe 2: Ligand-Based Lead Optimization

Generate new molecular candidates based on a lead compound, evaluate their properties, and dock the best ones.

```
Lead SMILES → GenMol → ADMET Filter → Dock Top Hits
```

#### Generate candidate molecules

```bash
ivybloom orchestrate "Generate 50 molecules similar to aspirin (CC(=O)Oc1ccccc1C(=O)O) with improved solubility" --sync
```

Or via direct tool submission:
```bash
ivybloom run genmol \
  seed_smiles="CC(=O)Oc1ccccc1C(=O)O" \
  num_molecules=50 \
  --follow
```

#### Screen with ADMET

Create a batch file `admet-screen.yaml`:
```yaml
name: "Lead Optimization ADMET"
tool: admet
jobs:
  - name: "candidate-1"
    parameters: { smiles: "GENERATED_SMILES_1" }
  - name: "candidate-2"
    parameters: { smiles: "GENERATED_SMILES_2" }
options:
  parallel: 8
  stop_on_error: false
```

```bash
ivybloom batch submit admet-screen.yaml --wait
ivybloom batch collect BATCH_ID --format csv --output admet-results.csv
```

#### Dock top candidates

Filter the ADMET results for drug-like compounds, then dock them:

```bash
# Dock each hit against the target
ivybloom run diffdock \
  receptor=target.pdb \
  ligand="TOP_HIT_SMILES" \
  --follow
```

---

## Recipe 3: Target Validation

Validate a protein target by checking sequence conservation, predicting structure, and analyzing binding site druggability.

```
Sequence → BLAST → ESMFold → ProteinPrep → Quality → Sites
```

#### Check sequence conservation

```bash
ivybloom run blast \
  query_sequence=MKLVFFAEDVGSNKGAIIGLMVGGVVIA \
  database=nr \
  --follow
```

Review homologs and conservation scores to confirm the target is well-conserved across species.

#### Predict structure

```bash
ivybloom run esmfold \
  protein_sequence=MKLVFFAEDVGSNKGAIIGLMVGGVVIA \
  --follow
```

Check the pLDDT score — values above 70 indicate reliable structure prediction.

#### Quality check

```bash
ivybloom proteinprep quality ./predicted_structure.pdb
```

Verify no missing atoms, clashes, or unusual residues.

#### Detect druggable binding sites

```bash
ivybloom proteinprep sites ./predicted_structure.pdb \
  --method p2rank \
  --top-n 5 \
  --min-score 0.6
```

Sites with scores above 0.8 are considered highly druggable.

---

## Recipe 4: Compound Library Screening

Import a compound library, screen it through ADMET, and export the filtered hits.

```
CSV Import → Batch ADMET → Filter → Export Hits
```

#### Create and import the library

```bash
# Create a collection
ivybloom compounds create "Vendor Library" --description "2024 vendor catalog"

# Import compounds from CSV
ivybloom compounds import COLL_ID library.csv --skip-duplicates
```

Supported formats: CSV, SDF, SMILES. A CSV file needs a `smiles` column. The `ivybloom mcp` import tool also accepts `smiles_column` and `name_column` for non-standard headers.

#### Create the batch screen file

Export the library to a format suitable for batch processing:

```bash
ivybloom compounds export COLL_ID --format csv --output library-export.csv
```

Create `screen.yaml`:
```yaml
name: "Library ADMET Screen"
tool: admet
jobs:
  - name: "compound-001"
    parameters: { smiles: "CCO" }
  - name: "compound-002"
    parameters: { smiles: "CC(=O)Oc1ccccc1C(=O)O" }
options:
  parallel: 8
  stop_on_error: false
```

#### Run the batch screen

```bash
ivybloom batch submit screen.yaml --wait
```

Monitor progress:
```bash
ivybloom batch status BATCH_ID
```

#### Collect and export results

```bash
# Collect all results
ivybloom batch collect BATCH_ID --format csv --output admet-results.csv

# Create a new collection with hits
ivybloom compounds create "ADMET Hits" --description "Drug-like compounds from vendor screen"
```

---

## Running Recipes as Scripts

Any recipe can be converted into a shell script for automation:

```bash
#!/bin/bash
set -euo pipefail

export IVYBLOOM_API_KEY="${IVYBLOOM_API_KEY:?Set IVYBLOOM_API_KEY}"

# Fold → Prep → Dock pipeline
FOLD_RESULT=$(ivybloom run esmfold protein_sequence="$SEQUENCE" --agent --wait)
FOLD_JOB=$(echo "$FOLD_RESULT" | jq -r '.data.job_id')
ivybloom jobs download "$FOLD_JOB" --output ./structures/

ivybloom proteinprep run ./structures/predicted_structure.pdb \
  --ph 7.4 --detect-sites --wait

ivybloom run diffdock \
  receptor=./structures/prepared.pdb \
  ligand="$LIGAND_SMILES" \
  --agent --wait
```

See [Agent Mode](/docs/cli/agent-mode) for structured JSON output in scripts.

---

## Read next

- [Batch Processing](/docs/cli/batch) — Scale up recipes with parallel execution
- [Workflows](/docs/cli/workflows) — Automate multi-step pipelines
- [Compounds](/docs/cli/compounds) — Build and search molecular libraries
- [Protein Preparation](/docs/cli/proteinprep) — Structure preparation details
- [Orchestration](/docs/cli/orchestration) — Natural language for complex workflows
