Package rdkit :: Package Chem :: Module inchi
[hide private]
[frames] | no frames]

Module inchi

source code

Classes [hide private]
  InchiReadWriteError
Functions [hide private]
 
MolFromInchi(inchi, sanitize=True, removeHs=True, logLevel=None, treatWarningAsError=False)
Construct a molecule from a InChI string
source code
 
MolToInchiAndAuxInfo(mol, options='', logLevel=None, treatWarningAsError=False)
Returns the standard InChI string and InChI auxInfo for a molecule
source code
 
MolToInchi(mol, options='', logLevel=None, treatWarningAsError=False)
Returns the standard InChI string for a molecule
source code
 
InchiToInchiKey(inchi)
Return the InChI key for the given InChI string.
source code
Variables [hide private]
  INCHI_AVAILABLE = True
  logger = RDLogger.logger()
  logLevelToLogFunctionLookup = {10: <bound method logger.debug ...
  __package__ = 'rdkit.Chem'

Imports: rdinchi, logging, RDLogger


Function Details [hide private]

MolFromInchi(inchi, sanitize=True, removeHs=True, logLevel=None, treatWarningAsError=False)

source code 
Construct a molecule from a InChI string

Keyword arguments:
sanitize -- set to True to enable sanitization of the molecule. Default is
True
removeHs -- set to True to remove Hydrogens from a molecule. This only
makes sense when sanitization is enabled
logLevel -- the log level used for logging logs and messages from InChI
API. set to None to diable the logging completely
treatWarningAsError -- set to True to raise an exception in case of a
molecule that generates warning in calling InChI API. The resultant
molecule  and error message are part of the excpetion

Returns:
a rdkit.Chem.rdchem.Mol instance

MolToInchiAndAuxInfo(mol, options='', logLevel=None, treatWarningAsError=False)

source code 
Returns the standard InChI string and InChI auxInfo for a molecule

Keyword arguments:
logLevel -- the log level used for logging logs and messages from InChI
API. set to None to diable the logging completely
treatWarningAsError -- set to True to raise an exception in case of a
molecule that generates warning in calling InChI API. The resultant InChI
string and AuxInfo string as well as the error message are encoded in the
exception.

Returns:
a tuple of the standard InChI string and the auxInfo string returned by
InChI API, in that order, for the input molecule

MolToInchi(mol, options='', logLevel=None, treatWarningAsError=False)

source code 
Returns the standard InChI string for a molecule

Keyword arguments:
logLevel -- the log level used for logging logs and messages from InChI
API. set to None to diable the logging completely
treatWarningAsError -- set to True to raise an exception in case of a
molecule that generates warning in calling InChI API. The resultant InChI
string and AuxInfo string as well as the error message are encoded in the
exception.

Returns:
the standard InChI string returned by InChI API for the input molecule

InchiToInchiKey(inchi)

source code 
Return the InChI key for the given InChI string. Return None on error


Variables Details [hide private]

logLevelToLogFunctionLookup

Value:
{10: <bound method logger.debug of <rdkit.RDLogger.logger object at 0x\
2898210>>,
 20: <bound method logger.info of <rdkit.RDLogger.logger object at 0x2\
898210>>,
 30: <bound method logger.warning of <rdkit.RDLogger.logger object at \
0x2898210>>,
 40: <bound method logger.error of <rdkit.RDLogger.logger object at 0x\
2898210>>,
...