Tautomers Tutorial
This tutorial demonstrates how to enumerate and rank tautomers using Auto3D.
CLI Quick Start (Recommended)
# Enable tautomer enumeration
auto3d run molecules.smi --k=1 --enumerate-tautomer --gpu
# With ANI2xt (designed for tautomers)
auto3d run molecules.smi --k=1 --enumerate-tautomer --engine=ANI2xt --gpu
# Configuration for tautomer analysis
cat > tautomer.yaml << EOF
enumerate_tautomer: true
tauto_engine: rdkit
optimizing_engine: ANI2xt
max_confs: 10
patience: 200
k: 1
EOF
auto3d run molecules.smi -c tautomer.yaml --gpu
Python API
The Jupyter Notebook can be downloaded here
[ ]:
import os, sys
root = os.path.dirname(os.path.dirname(os.path.abspath("__file__")))
import Auto3D
print(Auto3D.__version__)
from Auto3D import Auto3DOptions
from Auto3D.tautomer import get_stable_tautomers
from rdkit import Chem
from rdkit.Chem import Draw
1. Method
Low-energy tautomers are identified using the following steps:
Enumerate reasonable tautomers for each input SMILES;
Get top
kconformers for each tautomer;Group all conformers of all tautomers of the same SMILES together (shaded in yellow), select the top
tauto_kconformers as the final stable tautomer 3D structures for the input SMILES.
Please note the difference between two arguments: k and tauto_k (The difference between window and tauto_window are similar). The following figure demonstrate the difference between k and tauto_k.

“k” is used to select conformers in the blue area; “tauto_k” is used to select the conformers in the yellow area.
2. Example: Get Tautomers Using the Python Library Interface
Since the tautomers are ranked based on their conformer energies, the 1st step is to generate conformers for all tautomers.
The conformer generation step sets max_confs=10 and patience=200. Because here we care more about the relative stabilities of tautomers, 10 conformers from each tautomer would be a good representation whereas maintaining high efficiency. You need to set max_confs and patience to larger values to get more precise energy difference between tautomers.
get_stable_tautomer function directly accepts the arguments from the options function. In addition, get_stable_tautomer also needs either tatuo_k or tauto_window for tautomer selection. The tautomers are saved in the output SDF file. Internally, the get_stable_tautomer function calls the main function to get 3D conformers and then selecte stable tautomers.
[2]:
# Let's look at the molecule that we are going to investigate
# We want to know the relative stability of tautomers of this molecule
input_path = os.path.join(root, "example", "files", "sildnafil.smi")
mol = next(Chem.SmilesMolSupplier(input_path, titleLine=False))
mol.__sssAtoms = [8, 9, 10, 11, 12]
Draw.MolToImage(mol, size=(400, 300), highlightAtoms=[8, 10, 12])
# Note the highlighted atoms (N, N, O), this is where the proton transfer happens.
[2]:
[ ]:
# Get the 3D conformers for input SMILES
if __name__ == "__main__":
config = Auto3DOptions(
path=input_path, k=1, enumerate_tautomer=True, tauto_engine="rdkit",
optimizing_engine="ANI2xt", # ANI2xt is NNP designed for tautomers
max_confs=10, patience=200, use_gpu=False
)
tautomer_out = get_stable_tautomers(config, tauto_k=3)
The output of the get_stable_tautomers function is stored as an SDF file, you can visualize it with other softwares. Below we just load the conformers using rdkit and visualize them.
[4]:
# visualize the tautomers for sildnafil and their relative energies
tautomers = list(Chem.SDMolSupplier(tautomer_out))
ids = [mol.GetProp('ID') for mol in tautomers]
relative_es = [mol.GetProp('E_tautomer_relative(kcal/mol)') for mol in tautomers]
legends = [ids[i] + '\n' + relative_es[i][:5] for i in range(len(tautomers))]
Draw.MolsToGridImage(tautomers, legends=legends, subImgSize=(400, 300), highlightAtomLists=[[9, 10, 31] for _ in range(3)])
# the following is a projection of 3D tautomers into a 2D figure
[4]:
We can see the relative stability of the tautomers of sildnafil.
3. CLI Alternative
For command-line usage, Auto3D provides built-in tautomer support:
Using Configuration File
# Create tautomer configuration
cat > tautomer.yaml << EOF
enumerate_tautomer: true
tauto_engine: rdkit
optimizing_engine: ANI2xt
max_confs: 10
patience: 200
k: 1
use_gpu: true
EOF
# Run with configuration
auto3d run input.smi -c tautomer.yaml
Direct CLI Command
# Basic tautomer enumeration
auto3d run input.smi --k=1 --enumerate-tautomer --gpu
# With ANI2xt (recommended for tautomers)
auto3d run input.smi --k=1 --enumerate-tautomer --engine=ANI2xt --gpu
# Keep top 3 tautomers per molecule
auto3d run input.smi --k=3 --enumerate-tautomer --engine=ANI2xt --gpu
For advanced tautomer analysis with the Python API (e.g., to use tauto_k parameter), see the get_stable_tautomers function demonstrated above.