moleculekit.smallmol.tools.molvstautomer module

### STEFAN: Taken from MolVS commit: https://github.com/mcs07/MolVS/commit/701c2d6f508fa8faf563eb257f25e30952653f4a ### on date: 13/12/2017

molvs.tautomer

This module contains tools for enumerating tautomers and determining a canonical tautomer.

copyright

Copyright 2016 by Matt Swain.

license

MIT, see LICENSE file for more details.

moleculekit.smallmol.tools.molvstautomer.MAX_TAUTOMERS = 1000

The default value for the maximum number of tautomers to enumerate, a limit to prevent combinatorial explosion.

moleculekit.smallmol.tools.molvstautomer.TAUTOMER_SCORES = (TautomerScore('benzoquinone', '[#6]1([#6]=[#6][#6]([#6]=[#6]1)=,:[N,S,O])=,:[N,S,O]', 25), TautomerScore('oxim', '[#6]=[N][OH]', 4), TautomerScore('C=O', '[#6]=,:[#8]', 2), TautomerScore('N=O', '[#7]=,:[#8]', 2), TautomerScore('P=O', '[#15]=,:[#8]', 2), TautomerScore('C=hetero', '[#6]=[!#1;!#6]', 1), TautomerScore('methyl', '[CX4H3]', 1), TautomerScore('guanidine terminal=N', '[#7][#6](=[NR0])[#7H0]', 1), TautomerScore('guanidine endocyclic=N', '[#7;R][#6;R]([N])=[#7;R]', 2), TautomerScore('aci-nitro', '[#6]=[N+]([O-])[OH]', -4))

The default list of TautomerScores.

moleculekit.smallmol.tools.molvstautomer.TAUTOMER_TRANSFORMS = (TautomerTransform('1,3 (thio)keto/enol f', '[CX4!H0]-[C]=[O,S,Se,Te;X1]', [], []), TautomerTransform('1,3 (thio)keto/enol r', '[O,S,Se,Te;X2!H0]-[C]=[C]', [], []), TautomerTransform('1,5 (thio)keto/enol f', '[CX4,NX3;!H0]-[C]=[C][CH0]=[O,S,Se,Te;X1]', [], []), TautomerTransform('1,5 (thio)keto/enol r', '[O,S,Se,Te;X2!H0]-[CH0]=[C]-[C]=[C,N]', [], []), TautomerTransform('aliphatic imine f', '[CX4!H0]-[C]=[NX2]', [], []), TautomerTransform('aliphatic imine r', '[NX3!H0]-[C]=[CX3]', [], []), TautomerTransform('special imine f', '[N!H0]-[C]=[CX3R0]', [], []), TautomerTransform('special imine r', '[CX4!H0]-[c]=[n]', [], []), TautomerTransform('1,3 aromatic heteroatom H shift f', '[#7!H0]-[#6R1]=[O,#7X2]', [], []), TautomerTransform('1,3 aromatic heteroatom H shift r', '[O,#7;!H0]-[#6R1]=[#7X2]', [], []), TautomerTransform('1,3 heteroatom H shift', '[#7,S,O,Se,Te;!H0]-[#7X2,#6,#15]=[#7,#16,#8,Se,Te]', [], []), TautomerTransform('1,5 aromatic heteroatom H shift', '[#7,#16,#8;!H0]-[#6,#7]=[#6]-[#6,#7]=[#7,#16,#8;H0]', [], []), TautomerTransform('1,5 aromatic heteroatom H shift f', '[#7,#16,#8,Se,Te;!H0]-[#6,nX2]=[#6,nX2]-[#6,#7X2]=[#7X2,S,O,Se,Te]', [], []), TautomerTransform('1,5 aromatic heteroatom H shift r', '[#7,S,O,Se,Te;!H0]-[#6,#7X2]=[#6,nX2]-[#6,nX2]=[#7,#16,#8,Se,Te]', [], []), TautomerTransform('1,7 aromatic heteroatom H shift f', '[#7,#8,#16,Se,Te;!H0]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#6]-[#6,#7X2]=[#7X2,S,O,Se,Te,CX3]', [], []), TautomerTransform('1,7 aromatic heteroatom H shift r', '[#7,S,O,Se,Te,CX4;!H0]-[#6,#7X2]=[#6]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[NX2,S,O,Se,Te]', [], []), TautomerTransform('1,9 aromatic heteroatom H shift f', '[#7,O;!H0]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#7,O]', [], []), TautomerTransform('1,11 aromatic heteroatom H shift f', '[#7,O;!H0]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#7X2,O]', [], []), TautomerTransform('furanone f', '[O,S,N;!H0]-[#6r5]=[#6X3r5;$([#6]([#6r5])=[#6r5])]', [], []), TautomerTransform('furanone r', '[#6r5!H0;$([#6]([#6r5])[#6r5])]-[#6r5]=[O,S,N]', [], []), TautomerTransform('keten/ynol f', '[C!H0]=[C]=[O,S,Se,Te;X1]', [rdkit.Chem.rdchem.BondType.TRIPLE, rdkit.Chem.rdchem.BondType.SINGLE], []), TautomerTransform('keten/ynol r', '[O,S,Se,Te;!H0X2]-[C]#[C]', [rdkit.Chem.rdchem.BondType.DOUBLE, rdkit.Chem.rdchem.BondType.DOUBLE], []), TautomerTransform('ionic nitro/aci-nitro f', '[C!H0]-[N+;$([N][O-])]=[O]', [], []), TautomerTransform('ionic nitro/aci-nitro r', '[O!H0]-[N+;$([N][O-])]=[C]', [], []), TautomerTransform('oxim/nitroso f', '[O!H0]-[N]=[C]', [], []), TautomerTransform('oxim/nitroso r', '[C!H0]-[N]=[O]', [], []), TautomerTransform('oxim/nitroso via phenol f', '[O!H0]-[N]=[C]-[C]=[C]-[C]=[OH0]', [], []), TautomerTransform('oxim/nitroso via phenol r', '[O!H0]-[c]=[c]-[c]=[c]-[N]=[OH0]', [], []), TautomerTransform('cyano/iso-cyanic acid f', '[O!H0]-[C]#[N]', [rdkit.Chem.rdchem.BondType.DOUBLE, rdkit.Chem.rdchem.BondType.DOUBLE], []), TautomerTransform('cyano/iso-cyanic acid r', '[N!H0]=[C]=[O]', [rdkit.Chem.rdchem.BondType.TRIPLE, rdkit.Chem.rdchem.BondType.SINGLE], []), TautomerTransform('isocyanide f', '[C-0!H0]#[N+0]', [rdkit.Chem.rdchem.BondType.TRIPLE], [-1, 1]), TautomerTransform('isocyanide r', '[N+!H0]#[C-]', [rdkit.Chem.rdchem.BondType.TRIPLE], [-1, 1]), TautomerTransform('phosphonic acid f', '[OH]-[PH0]', [rdkit.Chem.rdchem.BondType.DOUBLE], []), TautomerTransform('phosphonic acid r', '[PH]=[O]', [rdkit.Chem.rdchem.BondType.SINGLE], []))

The default list of TautomerTransforms.

class moleculekit.smallmol.tools.molvstautomer.TautomerEnumerator(transforms=TautomerTransform('1,3 (thio)keto/enol f', '[CX4!H0]-[C]=[O,S,Se,Te;X1]', [], []), TautomerTransform('1,3 (thio)keto/enol r', '[O,S,Se,Te;X2!H0]-[C]=[C]', [], []), TautomerTransform('1,5 (thio)keto/enol f', '[CX4,NX3;!H0]-[C]=[C][CH0]=[O,S,Se,Te;X1]', [], []), TautomerTransform('1,5 (thio)keto/enol r', '[O,S,Se,Te;X2!H0]-[CH0]=[C]-[C]=[C,N]', [], []), TautomerTransform('aliphatic imine f', '[CX4!H0]-[C]=[NX2]', [], []), TautomerTransform('aliphatic imine r', '[NX3!H0]-[C]=[CX3]', [], []), TautomerTransform('special imine f', '[N!H0]-[C]=[CX3R0]', [], []), TautomerTransform('special imine r', '[CX4!H0]-[c]=[n]', [], []), TautomerTransform('1,3 aromatic heteroatom H shift f', '[#7!H0]-[#6R1]=[O,#7X2]', [], []), TautomerTransform('1,3 aromatic heteroatom H shift r', '[O,#7;!H0]-[#6R1]=[#7X2]', [], []), TautomerTransform('1,3 heteroatom H shift', '[#7,S,O,Se,Te;!H0]-[#7X2,#6,#15]=[#7,#16,#8,Se,Te]', [], []), TautomerTransform('1,5 aromatic heteroatom H shift', '[#7,#16,#8;!H0]-[#6,#7]=[#6]-[#6,#7]=[#7,#16,#8;H0]', [], []), TautomerTransform('1,5 aromatic heteroatom H shift f', '[#7,#16,#8,Se,Te;!H0]-[#6,nX2]=[#6,nX2]-[#6,#7X2]=[#7X2,S,O,Se,Te]', [], []), TautomerTransform('1,5 aromatic heteroatom H shift r', '[#7,S,O,Se,Te;!H0]-[#6,#7X2]=[#6,nX2]-[#6,nX2]=[#7,#16,#8,Se,Te]', [], []), TautomerTransform('1,7 aromatic heteroatom H shift f', '[#7,#8,#16,Se,Te;!H0]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#6]-[#6,#7X2]=[#7X2,S,O,Se,Te,CX3]', [], []), TautomerTransform('1,7 aromatic heteroatom H shift r', '[#7,S,O,Se,Te,CX4;!H0]-[#6,#7X2]=[#6]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[NX2,S,O,Se,Te]', [], []), TautomerTransform('1,9 aromatic heteroatom H shift f', '[#7,O;!H0]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#6,#7X2]-[#6,#7X2]=[#7,O]', [], []), TautomerTransform('1,11 aromatic heteroatom H shift f', '[#7,O;!H0]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#6,nX2]-[#6,nX2]=[#7X2,O]', [], []), TautomerTransform('furanone f', '[O,S,N;!H0]-[#6r5]=[#6X3r5;$([#6]([#6r5])=[#6r5])]', [], []), TautomerTransform('furanone r', '[#6r5!H0;$([#6]([#6r5])[#6r5])]-[#6r5]=[O,S,N]', [], []), TautomerTransform('keten/ynol f', '[C!H0]=[C]=[O,S,Se,Te;X1]', [rdkit.Chem.rdchem.BondType.TRIPLE, rdkit.Chem.rdchem.BondType.SINGLE], []), TautomerTransform('keten/ynol r', '[O,S,Se,Te;!H0X2]-[C]#[C]', [rdkit.Chem.rdchem.BondType.DOUBLE, rdkit.Chem.rdchem.BondType.DOUBLE], []), TautomerTransform('ionic nitro/aci-nitro f', '[C!H0]-[N+;$([N][O-])]=[O]', [], []), TautomerTransform('ionic nitro/aci-nitro r', '[O!H0]-[N+;$([N][O-])]=[C]', [], []), TautomerTransform('oxim/nitroso f', '[O!H0]-[N]=[C]', [], []), TautomerTransform('oxim/nitroso r', '[C!H0]-[N]=[O]', [], []), TautomerTransform('oxim/nitroso via phenol f', '[O!H0]-[N]=[C]-[C]=[C]-[C]=[OH0]', [], []), TautomerTransform('oxim/nitroso via phenol r', '[O!H0]-[c]=[c]-[c]=[c]-[N]=[OH0]', [], []), TautomerTransform('cyano/iso-cyanic acid f', '[O!H0]-[C]#[N]', [rdkit.Chem.rdchem.BondType.DOUBLE, rdkit.Chem.rdchem.BondType.DOUBLE], []), TautomerTransform('cyano/iso-cyanic acid r', '[N!H0]=[C]=[O]', [rdkit.Chem.rdchem.BondType.TRIPLE, rdkit.Chem.rdchem.BondType.SINGLE], []), TautomerTransform('isocyanide f', '[C-0!H0]#[N+0]', [rdkit.Chem.rdchem.BondType.TRIPLE], [- 1, 1]), TautomerTransform('isocyanide r', '[N+!H0]#[C-]', [rdkit.Chem.rdchem.BondType.TRIPLE], [- 1, 1]), TautomerTransform('phosphonic acid f', '[OH]-[PH0]', [rdkit.Chem.rdchem.BondType.DOUBLE], []), TautomerTransform('phosphonic acid r', '[PH]=[O]', [rdkit.Chem.rdchem.BondType.SINGLE], []), max_tautomers=1000)

Bases: object

__call__(mol)

Calling a TautomerEnumerator instance like a function is the same as calling its enumerate(mol) method.

enumerate(mol)

Enumerate all possible tautomers and return them as a list.

Parameters

mol (Mol) – The input molecule.

Returns

A list of all possible tautomers of the molecule.

Return type

list of Mol

class moleculekit.smallmol.tools.molvstautomer.TautomerScore(name, smarts, score)

Bases: object

A substructure defined by SMARTS and its score contribution to determine the canonical tautomer.

property smarts
class moleculekit.smallmol.tools.molvstautomer.TautomerTransform(name, smarts, bonds=(), charges=(), radicals=())

Bases: object

Rules to transform one tautomer to another.

Each TautomerTransform is defined by a SMARTS pattern where the transform involves moving a hydrogen from the first atom in the pattern to the last atom in the pattern. By default, alternating single and double bonds along the pattern are swapped accordingly to account for the hydrogen movement. If necessary, the transform can instead define custom resulting bond orders and also resulting atom charges.

BONDMAP = {'#': rdkit.Chem.rdchem.BondType.TRIPLE, '-': rdkit.Chem.rdchem.BondType.SINGLE, ':': rdkit.Chem.rdchem.BondType.AROMATIC, '=': rdkit.Chem.rdchem.BondType.DOUBLE}
CHARGEMAP = {'+': 1, '-': -1, '0': 0}
property tautomer
moleculekit.smallmol.tools.molvstautomer.memoized_property(fget)
moleculekit.smallmol.tools.molvstautomer.pairwise(iterable)

Utility function to iterate in a pairwise fashion.