Trees | Indices | Help |
|
---|
|
|
|||
MolIdentifierException | |||
BadMoleculeException |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
MOL_KEY_VERSION = '1'
|
|||
ERROR_DICT = dict(BAD_MOLECULE= 1, ALIAS_CONVERSION_FAILED= 2,
|
|||
INCHI_COMPUTATION_ERROR = ERROR_DICT ['INCHI_COMPUTATION_ERROR']
|
|||
RDKIT_CONVERSION_ERROR = ERROR_DICT ['RDKIT_CONVERSION_ERROR']
|
|||
INCHI_READWRITE_ERROR = ERROR_DICT ['INCHI_READWRITE_ERROR']
|
|||
NULL_MOL = ERROR_DICT ['NULL_MOL']
|
|||
BAD_SET = pyAvalonTools.StruChkResult.bad_set | INCHI_COMPUTAT
|
|||
GET_STEREO_RE = re.compile(r'^InChI=1S(.*?)/(t.*?)/m\d/s1(.*$)')
|
|||
NULL_SMILES_RE = re.compile(r'^\s*$|^\s*NO_STRUCTURE\s*$', re.
|
|||
PATTERN_NULL_MOL = r'^([\s0]+[1-9]+[\s]+V[\w]*)'
|
|||
CHIRAL_POS = 12
|
|||
T_NULL_MOL = NULL_MOL, ''
|
|||
stereo_code_dict = {}
|
|||
__initCalled = False
|
|||
InchiResult = namedtuple('InchiResult', ['error', 'inchi', 'fi
|
|||
MolKeyResult = namedtuple('MolKeyResult', ['mol_key', 'error',
|
Imports: pyAvalonTools, InchiInfo, RDConfig, Chem, namedtuple, logging, os, re, uuid, base64, hashlib, tempfile
|
look at atom count position (line 4, characters 0:3) Return True if the count is >0, False if 0. Throw BadMoleculeException if there are no characters at the required position or if they cannot be converted to a positive integer |
read the chiral flag (line 4, characters 12:15) and set it to 0. Return True if it was 1, False if 0. Throw BadMoleculeException if there are no characters at the required position or if they where not 0 or 1 |
>>> from rdkit.Chem.MolKey import MolKey >>> from rdkit.Avalon import pyAvalonTools >>> res = MolKey.GetInchiForCTAB(pyAvalonTools.Generate2DCoords('c1cn[nH]c1C(Cl)Br',True)) >>> res.inchi 'InChI=1/C4H4BrClN2/c5-4(6)3-1-2-7-8-3/h1-2,4H,(H,7,8)/t4?/f/h8H' >>> res = MolKey.GetInchiForCTAB(pyAvalonTools.Generate2DCoords('c1c[nH]nc1C(Cl)Br',True)) >>> res.inchi 'InChI=1/C4H4BrClN2/c5-4(6)3-1-2-7-8-3/h1-2,4H,(H,7,8)/t4?/f/h7H' >>> |
Compute the molecule key based on the inchi string, stereo category as well as extra structure information |
>>> from rdkit.Chem.MolKey import MolKey >>> from rdkit.Avalon import pyAvalonTools >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1ccccc1C(F)Cl',True)) >>> res.mol_key '1|L7676nfGsSIU33wkx//NCg==' >>> res.stereo_code 'R_ONE' >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1ccccc1[C@H](F)Cl',True)) >>> res.mol_key '1|Aj38EIxf13RuPDQG2A0UMw==' >>> res.stereo_code 'S_ABS' >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1ccccc1[C@@H](F)Cl',True)) >>> res.mol_key '1|9ypfMrhxn1w0ncRooN5HXw==' >>> res.stereo_code 'S_ABS' >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1cccc(C(Br)Cl)c1[C@@H](F)Cl',True)) >>> res.mol_key '1|c96jMSlbn7O9GW5d5uB9Mw==' >>> res.stereo_code 'S_PART' >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1cccc([C@H](Br)Cl)c1[C@@H](F)Cl',True)) >>> res.mol_key '1|+B+GCEardrJteE8xzYdGLA==' >>> res.stereo_code 'S_ABS' >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1cccc(C(Br)Cl)c1C(F)Cl',True)) >>> res.mol_key '1|5H9R3LvclagMXHp3Clrc/g==' >>> res.stereo_code 'S_UNKN' >>> res=MolKey.GetKeyForCTAB(pyAvalonTools.Generate2DCoords('c1cccc(C(Br)Cl)c1C(F)Cl',True),stereo_info='S_REL') >>> res.mol_key '1|cqKWVsUEY6QNpGCbDaDTYA==' >>> res.stereo_code 'S_REL' >>> res.inchi 'InChI=1/C8H6BrCl2F/c9-7(10)5-3-1-2-4-6(5)8(11)12/h1-4,7-8H/t7?,8?' |
|
ERROR_DICT
|
BAD_SET
|
NULL_SMILES_RE
|
InchiResult
|
MolKeyResult
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Feb 1 16:13:01 2018 | http://epydoc.sourceforge.net |