syndirella 5.0.6a0
Synthetically Driven Elaborations
Requires Python: <3.11,>=3.10

<div align="center">
  <img src="logos/Full.png" alt="Syndirella Logo" width="400"/>
</div>

Syndirella (Synthesis Directed Elaborations) is a tool for generating and scoring synthetically practical elaborations of molecules designed from fragment screens. Starting from the retrosynthetic analysis of fragment merged molecules, superstructures of the original reactants are found by catalog search and filtered by selectivity issues. The elaborated final products are defined by reaction SMIRKS patterns and energy minimized in the protein with restraints to experimental data.

**Preprint:** [https://chemrxiv.org/engage/chemrxiv/article-details/68d4f08ff416303770403a44](https://chemrxiv.org/engage/chemrxiv/article-details/68d4f08ff416303770403a44)

## Documentation

**[Full Documentation](https://syndirella.readthedocs.io/)** - Complete user guide, API reference, and examples

[![Documentation Status](https://readthedocs.org/projects/syndirella/badge/?version=latest)](https://syndirella.readthedocs.io/en/latest/?badge=latest)

## Quick Start

### Installation

```bash
conda create -n syndirella python=3.10
conda activate syndirella
pip install syndirella
```

#### Troubleshooting:

**cgrtools fails to install:**
```bash
pip install "cython<3.2"
conda install -c conda-forge c-compiler cxx-compiler
pip install --no-build-isolation cgrtools
```

**'TypeError: 'AttributeFilledMock' object is not iterable' from PyRosetta dependency by Fragmenstein:**
```bash
pip install pyrosetta-installer
python -c 'import pyrosetta_installer; pyrosetta_installer.install_pyrosetta()'
```

**Note:** PyRosetta is available for academic and non-commercial use (see [PyRosetta License](https://github.com/RosettaCommons/rosetta/blob/main/LICENSE.PyRosetta.md)).

### Basic Usage

1. **Setup AiZynthFinder** (required for retrosynthesis):

   ⚠️ WARNING: This step downloads large model files (~750MB total) if run the first time. These are required to run AiZynthFinder. 

   Files will be downloaded to: `[syndirella_package_path]/aizynth/`

   ```bash
   syndirella setup-aizynth
   ```

2. **Run the pipeline**:
   ```bash
   syndirella run --input /absolute/path/to/input.csv --output /absolute/path/to/output_directory --templates /absolute/path/to/templates/ --hits_path /absolute/path/to/fragments.sdf
   ```
   
   **Note**: All paths must be absolute paths.

### Example Input

Create a CSV file with your fragment data. Hit names must match the exact names in your SDF file:

```csv
smiles,hit1,hit2,hit3,template,compound_set
O=C(NC1CC(C(F)(F)F)C1)c1cc2ccsc2[nH]1,A71EV2A-x0556_A_147_1_A71EV2A-x0526+A+147+1,A71EV2A-x0566_A_147_1_A71EV2A-x0526+A+147+1,,Ax0310a_apo-desolv,my_compound_set
CC(=O)Nc1cc(CC(=O)NCC(NC(=O)CCl)c2cccnc2)c(NC(C)=O)nn1,A71EV2A-x1346_A_250_1_A71EV2A-x0526+A+147+1,,,Ax1346a_apo-desolv,my_compound_set
```

**For complete examples and templates, see the [run_syndirella_example](examples/run_syndirella_example/) directory.**

### Output Files

The main output file to read is the **`structured_output.pkl.gz`** file, which contains:
- Complete synthesis routes with reaction details
- Placement information with energy values
- Structural quality metrics
- Product information and success flags

This file contains all the information needed to analyze and reproduce the elaborations.

## Requirements

- Python 3.10
- RDKit
- AiZynthFinder
- Fragmenstein
- Additional dependencies (see [pyproject.toml](pyproject.toml))

## Learn More

- **[Examples](examples/)** - Jupyter notebooks and sample data
- **[User Guide](https://syndirella.readthedocs.io/en/latest/user_guide_w_aizynth.html)** - Detailed usage instructions
- **[Reaction Constants](https://syndirella.readthedocs.io/en/latest/configuration.html)** - Advanced reaction settings and options

## License

This project is licensed under the MIT License.