Python¶
Indigo¶
-
class
indigo.Indigo¶ -
buildPkaModel(level, threshold, filename)¶ Builds pKa model into file
- Parameters
level (int) – max level
threshold (float) – threshold value
filename (str) – full path to the file
- Returns
1 if level > 0, 0 otherwise
- Return type
int
-
check(mol_str, check_flags='', props='')¶ Validates the given structure
- Parameters
mol_str (str) – input structure string
check_flags (str) – validation flags. Optional, defaults to “”.
props (str) – validation properties. Optional, defaults to “”.
- Returns
validation string
- Return type
str
-
checkStructure(structure, props='')¶ Runs validation for the given structure
- Parameters
structure (str) – structure object
props (str) – Parameters for validation. Optional, defaults to “”.
- Returns
validation results string
- Return type
str
-
clearTautomerRules()¶ Clears all tautomer rules
- Returns
1 if there are no errors
- Return type
int
-
commonBits(fingerprint1, fingerprint2)¶ Returns the number of common 1 bits for the given fingerprints
- Parameters
fingerprint1 (IndigoObject) – first fingerprint object
fingerprint2 (IndigoObject) – second fingerprint object
- Returns
number of common bits
- Return type
int
-
convertToArray(iterable)¶ Converts iterable object to array
- Parameters
iterable (IndigoObject) – iterable object
- Raises
IndigoException – if object is not iterable
- Returns
array of objects
- Return type
-
countReferences()¶ Returns the number of objects in pool
- Returns
number of objects
- Return type
int
-
createArray()¶ Creates array object
- Returns
array object
- Return type
-
createDecomposer(scaffold)¶ Creates deconvolution object for the given scaffold
- Parameters
scaffold (IndigoObject) – scaffold molecular structure
- Returns
deconvolution object
- Return type
-
createFileSaver(filename, format_)¶ Creates file saver object
- Parameters
filename (str) – full file path
format (str) – file format
- Returns
file saver object
- Return type
-
createMolecule()¶ Creates molecule object
- Returns
molecule object
- Return type
-
createQueryMolecule()¶ Creates query molecule object
- Returns
query molecule
- Return type
-
createQueryReaction()¶ Creates query reaction object
- Returns
query reaction object
- Return type
-
createReaction()¶ Creates reaction object
- Returns
reaction object
- Return type
-
createSaver(obj, format_)¶ Creates saver object
- Parameters
obj (IndigoObject) – output object
format (str) – format settings
- Returns
saver object
- Return type
-
dbgBreakpoint()¶
-
decomposeMolecules(scaffold, structures)¶ Creates deconvolution object for the given structures
- Parameters
scaffold (IndigoObject) – query molecule object
structures (IndigoObject) – array of molecule structures
- Returns
deconvolution object
- Return type
-
deserialize(arr: bytes) → indigo.indigo.indigo_object.IndigoObject¶ - Creates molecule or reaction object from binary serialized CMF
format
- Parameters
arr (bytes) – array of bytes
- Returns
molecule or reaction object
- Return type
-
exactMatch(item1, item2, flags='')¶ Creates match object for the given structures
- Parameters
item1 (IndigoObject) – first target structure (molecule or reaction)
item2 (IndigoObject) – second target structure (molecule or reaction)
flags (str) – exact match options. Optional, defaults to “”.
- Returns
match object
- Return type
-
extractCommonScaffold(structures, options='')¶ Extracts common scaffold for the given structures
- Parameters
structures (IndigoObject) – array object of molecule structures
options (str) – extraction options. Optional, defaults to “”.
- Returns
scaffold object
- Return type
-
getFragmentedMolecule(elem, options='')¶ Returns fragmented molecule for the given composition element
- Parameters
elem (IndigoObject) – composition element object
options (str) – Fragmentation options. Optional, defaults to “”.
- Returns
fragmented structure object
- Return type
-
getOption(option)¶ Returns option value by name
- Parameters
option (str) – option name
- Returns
option value
- Return type
str
-
getOptionBool(option)¶ Returns option boolean value by name
- Parameters
option (str) – option name
- Returns
option value
- Return type
bool
-
getOptionFloat(option)¶ Returns option float value by name
- Parameters
option (str) – option name
- Returns
option value
- Return type
float
-
getOptionInt(option)¶ Returns option integer value by name
- Parameters
option (str) – option name
- Returns
option value
- Return type
int
-
getOptionType(option)¶ Returns option value type by name
- Parameters
option (str) – option name
- Returns
option type string
- Return type
str
-
getSessionId() → int¶
-
iterateCDX(reader)¶ Creates CDX iterator from scanner object
- Parameters
reader (IndigoObject) – scanner object
- Returns
CDX iterator object
- Return type
-
iterateCDXFile(filename)¶ Returns iterator for CDX files
- Parameters
filename (str) – full file path
- Returns
CDX iterator object
- Return type
-
iterateCML(reader)¶ Creates CML iterator from scanner object
- Parameters
reader (IndigoObject) – scanner object
- Returns
CML iterator object
- Return type
-
iterateCMLFile(filename)¶ Returns iterator for CML files
- Parameters
filename (str) – full file path
- Returns
CML iterator object
- Return type
-
iterateRDF(reader)¶ Creates RDF iterator from scanner object
- Parameters
reader (IndigoObject) – scanner object
- Returns
RD iterator object
- Return type
-
iterateRDFile(filename)¶ Returns iterator for RDF files
- Parameters
filename (str) – full file path
- Returns
RD iterator object
- Return type
-
iterateSDF(reader)¶ Creates SDF iterator from scanner object
- Parameters
reader (IndigoObject) – scanner object
- Returns
SD iterator object
- Return type
-
iterateSDFile(filename)¶ Returns iterator for SDF files
- Parameters
filename (str) – full file path
- Returns
SD iterator object
- Return type
-
iterateSmiles(reader)¶ Creates smiles iterator from scanner object
- Parameters
reader (IndigoObject) – scanner object
- Returns
smiles iterator object
- Return type
-
iterateSmilesFile(filename)¶ Returns iterator for smiles files
- Parameters
filename (str) – full file path
- Returns
smiles iterator object
- Return type
-
iterateTautomers(molecule, params)¶ Iterates tautomers for the given molecule
- Parameters
molecule (IndigoObject) – molecule to find tautomers from
params (str) – tau iteration parameters. “INCHI” or “RSMARTS”. Defaults to “RSMARTS”
- Returns
molecule iterator object
- Return type
-
loadBuffer(buf)¶ Creates scanner object from buffer
- Parameters
buf (list) – array of bytes
- Returns
scanner object
- Return type
-
loadFasta(string, seq_type, library)¶ Loads molecule from DNA/RNA/PEPTIDE sequence string
- Parameters
string (str) – sequence string
seq_type (str) – sequence type (RNA/DNA/PEPTIDE)
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadFastaFromFile(filename, seq_type, library)¶ Loads query molecule from file in sequence format
- Parameters
filename (str) – full path to the file with sequence string
seq_type (str) – sequence type (RNA/DNA/PEPTIDE)
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadFingerprintFromBuffer(buffer)¶ Creates a fingerprint from the supplied binary data
- Parameters
buffer (list) – array of bytes
- Returns
fingerprint object
- Return type
-
loadFingerprintFromDescriptors(descriptors, size, density)¶ Packs a list of molecule descriptors into a fingerprint object
- Parameters
descriptors (list) – list of normalized numbers (roughly) between 0.0 and 1.0
size (int) – size of the fingerprint in bytes
density (float) – approximate density of ‘1’s vs ‘0’s in the fingerprint
- Returns
fingerprint object
- Return type
-
loadHelm(string, library)¶ Loads molecule from HELM string
- Parameters
string (str) – sequence string
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadHelmFromFile(filename, library)¶ Loads query molecule from file in HELM sequence format
- Parameters
filename (str) – full path to the file with sequence string
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadIdt(string, library)¶ Loads molecule from IDT string
- Parameters
string (str) – sequence string
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadIdtFromFile(filename, library)¶ Loads query molecule from file in IDT sequence format
- Parameters
filename (str) – full path to the file with sequence string
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadKetDocument(string)¶ Loads ket document from ket string
- Parameters
string (str) – ket
- Returns
loaded ket document
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadKetDocumentFromFile(filename)¶ Loads ket document from from file in ket format
- Parameters
string (str) – full path to the file with ket
- Returns
loaded ket document
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadMolecule(string)¶ Loads molecule from string. Format is automatically recognized.
- Parameters
string (str) – molecule format
- Returns
molecule object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadMoleculeFromBuffer(data)¶ Loads molecule from buffer. Automatically detects input format.
- Parameters
data (bytes) – input byte array
- Returns
loaded molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
Examples
with open (..), 'rb') as f: m = indigo.loadMoleculeFromBuffer(f.read())
-
loadMoleculeFromFile(filename)¶ Loads molecule from file. Automatically detects input format.
- Parameters
filename (str) – full path to a file
- Returns
loaded molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadMoleculeWithLib(string, library)¶ Loads molecule from string. Format is automatically recognized.
- Parameters
string (str) – molecule format
library (IndigoObject) – monomer library object
- Returns
molecule object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadMoleculeWithLibFromBuffer(data, library)¶ Loads molecule from buffer. Automatically detects input format.
- Parameters
data (bytes) – input byte array
library (IndigoObject) – monomer library object
- Returns
loaded molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
Examples
with open (..), 'rb') as f: m = indigo.loadMoleculeFromBuffer(f.read())
-
loadMoleculeWithLibFromFile(filename, library)¶ Loads molecule from file. Automatically detects input format.
- Parameters
filename (str) – full path to a file
library (IndigoObject) – monomer library object
- Returns
loaded molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadMonomerLibrary(string)¶ Loads monomer library from ket string
- Parameters
string (str) – ket
- Returns
loaded monomer library
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadMonomerLibraryFromFile(filename)¶ Loads monomer library from from file in ket format
- Parameters
string (str) – full path to the file with ket
- Returns
loaded monomer library
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryMolecule(string)¶ - Loads query molecule from string. Format will be automatically
recognized.
- Parameters
string (str) – molecule format
- Returns
query molecule object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryMoleculeFromFile(filename)¶ Loads query molecule from file. Automatically detects input format.
- Parameters
filename (str) – full path to a file
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryMoleculeWithLib(string, library)¶ - Loads query molecule from string. Format will be automatically
recognized.
- Parameters
string (str) – molecule format
library (IndigoObject) – monomer library object
- Returns
query molecule object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryMoleculeWithLibFromFile(filename, library)¶ Loads query molecule from file. Automatically detects input format.
- Parameters
filename (str) – full path to a file
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryReaction(string)¶ - Loads query reaction from string. Format will be automatically
recognized.
- Parameters
string (str) – reaction format
- Returns
query reaction object
- Return type
-
loadQueryReactionFromFile(filename)¶ Loads query reaction from file. Automatically detects input format.
- Parameters
filename (str) – full path to a file
- Returns
loaded query reaction object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryReactionFromFileWithLib(filename, library)¶ Loads query reaction from file. Automatically detects input format.
- Parameters
filename (str) – full path to a file
library (IndigoObject) – monomer library object
- Returns
loaded query reaction object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadQueryReactionWithLib(string, library)¶ - Loads query reaction from string. Format will be automatically
recognized.
- Parameters
string (str) – reaction format
library (IndigoObject) – monomer library object
- Returns
query reaction object
- Return type
-
loadReaction(string)¶ Loads reaction from string. Format will be automatically recognized.
- Parameters
string (str) – reaction format
- Returns
reaction object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadReactionFromFile(filename)¶ Loads reaction from file
- Parameters
filename (str) – full path to a file
- Returns
loaded reaction
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadReactionFromFileWithLib(filename, library)¶ Loads reaction from file
- Parameters
filename (str) – full path to a file
library (IndigoObject) – monomer library object
- Returns
loaded reaction
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadReactionSmarts(string)¶ Loads query reaction from string in SMARTS format
- Parameters
string (str) – smarts string
- Returns
loaded query reaction
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadReactionSmartsFromFile(filename)¶ Loads query reaction from file in SMARTS format
- Parameters
filename (str) – full path to the file with smarts strings
- Returns
loaded query reaction
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadReactionWithLib(string, library)¶ Loads reaction from string. Format will be automatically recognized.
- Parameters
string (str) – reaction format
library (IndigoObject) – monomer library object
- Returns
reaction object
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadSequence(string, seq_type, library)¶ Loads molecule from DNA/RNA/PEPTIDE sequence string
- Parameters
string (str) – sequence string
seq_type (str) – sequence type (RNA/DNA/PEPTIDE)
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadSequenceFromFile(filename, seq_type, library)¶ Loads query molecule from file in sequence format
- Parameters
filename (str) – full path to the file with sequence string
seq_type (str) – sequence type (RNA/DNA/PEPTIDE)
library (IndigoObject) – monomer library object
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadSmarts(string)¶ Loads query molecule from string in SMARTS format
- Parameters
string (str) – smarts string
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadSmartsFromFile(filename)¶ Loads query molecule from file in SMARTS format
- Parameters
filename (str) – full path to the file with smarts strings
- Returns
loaded query molecular structure
- Return type
- Raises
IndigoException – Exception if structure format is incorrect
-
loadString(string)¶ Creates scanner object from string
- Parameters
string (str) – string with information
- Returns
scanner object
- Return type
-
loadStructure(structure_str, parameter=None)¶ Loads structure from string
- Parameters
structure_str (str) – string with structure format
parameter (str) – parameters for loading. Optional, defaults to None.
- Returns
loaded object
- Return type
-
loadStructureFromBuffer(structure_data, parameter=None)¶ Loads structure object from buffer
- Parameters
structure_data (list) – array of bytes
parameter (str) – parameters for loading. Optional, defaults to None.
- Returns
loaded object
- Return type
-
loadStructureFromFile(filename, parameter=None)¶ Loads structure object from file
- Parameters
filename (str) – full path with structure information
parameter (str) – parameters to load. Optional, defaults to None.
- Returns
loaded object
- Return type
-
nameToStructure(name, params=None)¶ Converts a chemical name into a corresponding structure
- Parameters
name (str) – a name to parse
params (str) – a string (optional) containing parsing options or None if no options are changed
- Raises
IndigoException – if parsing fails or no structure is found
-
reactionProductEnumerate(replaced_action, monomers)¶ Creates reaction product enumeration iterator
- Parameters
replaced_action (IndigoObject) – query reaction for the enumeration
monomers (IndigoObject) – array of objects to enumerate
- Returns
result products iterator
- Return type
-
removeTautomerRule(index)¶ Removes tautomer rule
- Parameters
index (int) – tau rule index
- Returns
1 if there are no errors
- Return type
int
-
resetOptions()¶ Resets options to default state
-
rgroupComposition(molecule, options='')¶ Creates composition iterator
- Parameters
molecule (IndigoObject) – target molecule object
options (str) – rgroup composition options. Optional, defaults to “”.
- Returns
composition iterator
- Return type
-
setOption(option, value1, value2=None, value3=None)¶ Sets option value
- Parameters
option (str) – option name
value1 (int, str, bool, float) – option value
value2 (int, float) – option value for tuples. Optional, defaults to None.
value3 (float) – option value for triple. Optional, defaults to None.
- Raises
IndigoException – if option does not exist
-
setTautomerRule(index, beg, end)¶ Sets tautomer rules
- Parameters
index (int) – tau rule index
beg (str) – begin value
end (str) – end value
- Returns
1 if there are no errors
- Return type
int
-
similarity(item1, item2, metrics='')¶ Returns the similarity measure between two structures. Accepts two molecules, two reactions, or two fingerprints.
- Parameters
item1 (IndigoObject) – molecule, reaction or fingerprint object
item2 (IndigoObject) – molecule, reaction or fingerprint object
metrics (str) – “tanimoto”, “tversky”, “tversky <alpha> <beta>”, “euclid-sub” or “normalized-edit”. Optional, defaults to “tanimoto”.
- Returns
[description]
- Return type
float
-
substructureMatcher(target, mode='')¶ Creates substructure matcher
- Parameters
target (IndigoObject) – target molecule or reaction
mode (str) – substructure mode. Optional, defaults to “”.
- Returns
substructure matcher
- Return type
-
transform(reaction, monomers)¶ Transforms the given monomers by reaction
- Parameters
reaction (IndigoObject) – query reaction
monomers (IndigoObject) – array of objects to transform
- Returns
mapping object
- Return type
-
transformHELMtoSCSR(item)¶ Transforms HELM to SCSR object
- Parameters
item (IndigoObject) – object with HELM information
- Returns
molecule with SCSR object
- Return type
-
unserialize(arr: bytes) → indigo.indigo.indigo_object.IndigoObject¶ - [DEPRECATED] Creates molecule or reaction object from binary
serialized CMF format
- Parameters
arr (list) – array of bytes
- Returns
molecule or reaction object
- Return type
-
version()¶ Returns Indigo version
- Returns
version string
- Return type
str
-
versionInfo()¶ Returns Indigo version info
- Returns
version info string
- Return type
str
-
writeBuffer()¶ Creates buffer to write an object
- Returns
buffer object
- Return type
-
writeFile(filename)¶ Creates file writer object
- Parameters
filename (str) – full path to the file
- Returns
file writer object
- Return type
-
IndigoObject¶
-
class
indigo.IndigoObject(session: Indigo, id_: int, parent: Any = None)¶ Wraps all Indigo model objects
-
addAtom(symbol)¶ Molecule method adds an atom
- Parameters
symbol (str) – atom symbol
- Returns
atom object
- Return type
-
addBond(destination, order)¶ Atom method adds bond
- Parameters
destination (IndigoObject) – atom object destination
order (int) – bond order
- Returns
bond object
- Return type
-
addCIPStereoDescriptors()¶ Molecule method adds cip descriptors to stereocenters
- Returns
0 if there are no errors
- Return type
int
-
addCatalyst(molecule)¶ Reaction method adds the given molecule copy to catalysts
- Parameters
molecule (IndigoObject) – molecule to be added
- Returns
1 if the molecule was added correctly
- Return type
int
-
addConstraint(type_, value)¶ Atom method adds a constraint
- Parameters
type (str) – constraint type
value (str) – constraint value
- Returns
1 if there are no errors
- Return type
int
-
addConstraintNot(type_, value)¶ Atom method adds a NOT constraint
- Parameters
type (str) – constraint type
value (str) – constraint value
- Returns
1 if there are no errors
- Return type
int
-
addConstraintOr(type_, value)¶ Atom method adds an OR constraint
- Parameters
type (str) – constraint type
value (str) – constraint value
- Returns
1 if there are no errors
- Return type
int
-
addDataSGroup(atoms, bonds, description, data)¶ Molecule method adds a data s-group
- Parameters
atoms (list) – atom indexes list
bonds (list) – bond indexes list
description (str) – data s-group description
data (str) – data s-group data
- Returns
SGroup object
- Return type
-
addDecomposition(q_match)¶ Deconvolution method adds query match
- Parameters
q_match (IndigoObject) – decomposition match object
- Returns
0 if there are no errors
- Return type
int
-
addProduct(molecule)¶ Reaction method adds the given molecule copy to products
- Parameters
molecule (IndigoObject) – molecule to be added
- Returns
1 if the molecule was added correctly
- Return type
int
-
addRSite(name)¶ Molecule method adds r-site
- Parameters
name (str) – r-site name
- Returns
atom object
- Return type
-
addReactant(molecule)¶ Reaction method adds the given molecule copy to reactants
- Parameters
molecule (IndigoObject) – molecule to be added
- Returns
1 if the molecule was added correctly
- Return type
int
-
addSGroupAttachmentPoint(aidx, lvidx, apid)¶ SGroup method sets attachment point info
- Parameters
aidx (int) – index
lvidx (int) – index
apid (str) – id string
- Returns
attachment point index
- Return type
int
-
addStereocenter(type_, v1, v2, v3, v4=- 1)¶ Atom method adds stereo information for atom
- Parameters
type (int) – Stereocenter type. Use Indigo constants ABS, OR, AND, EITHER
v1 (int) – pyramid info
v2 (int) – pyramid info
v3 (int) – pyramid info
v4 (int) – pyramid info. Optional, defaults to -1.
- Returns
1 if stereocenter is added successfully
- Return type
int
-
addSuperatom(atoms, name)¶ Molecule method adds superatom
- Parameters
atoms (list) – atom indexes list
name (str) – superatom name
- Returns
superatom object
- Return type
-
addTemplate(templates, name)¶ Molecule method adds template TGroup
- Parameters
templates (IndigoObject) – molecule template
name (str) – template name
- Returns
template index
- Return type
int
-
alignAtoms(atom_ids, desired_xyz)¶ Atom method determines and applies the best transformation for the given molecule so that the specified atoms move as close as possible to the desired positions
- Parameters
atom_ids (list) – atom indexes
desired_xyz (list) – desired coordinates for atoms (size atom_ids * 3)
- Raises
IndigoException – if input array size does not match
- Returns
- root-mean-square measure of the difference between the
desired and obtained positions
- Return type
float
-
allScaffolds()¶ Scaffold method returns all scaffolds
- Returns
array of all scaffolds
- Return type
-
append(object_)¶ Saver method adds a new object
- Parameters
object (IndigoObject) – object to be added
- Returns
1 if there are no errors
- Return type
int
-
aromatize()¶ Molecule or reaction method aromatizes the structure
- Returns
1 if there are no errors
- Return type
int
-
arrayAdd(object_)¶ Array method adds a new object
- Parameters
object (IndigoObject) – object to be added
- Returns
1 if there are no errors
- Return type
int
-
at(index)¶ Loader method returns element by index
- Parameters
index (int) – element index
- Returns
element object
- Return type
-
atomIndex()¶ Atom method returns the atom index number
- Returns
atom index
- Return type
int
-
atomMappingNumber(reaction_atom)¶ Reaction atom method returns assigned mapping
- Parameters
reaction_atom (IndigoObject) – reaction molecule atom
- Returns
atom mapping value
- Return type
int
-
atomicNumber()¶ Atom method returns the atomic number
- Returns
atomic number
- Return type
int
-
automap(mode='')¶ Automatic reaction atom-to-atom mapping
- Parameters
mode (str) – mode is one of the following (separated by a space):
"discard" – discards the existing mapping entirely and considers only the existing reaction centers (the default)
"keep" – keeps the existing mapping and maps unmapped atoms
"alter" – alters the existing mapping, and maps the rest of the reaction but may change the existing mapping
"clear" – removes the mapping from the reaction.
"ignore_charges" – do not consider atom charges while searching
"ignore_isotopes" – do not consider atom isotopes while searching
"ignore_valence" – do not consider atom valence while searching
"ignore_radicals" – do not consider atom radicals while searching
- Returns
1 if atom mapping is done without errors
- Return type
int
-
b64cdx()¶ Molecule method returns the structure as a string in CDX base64 encoded format
- Returns
base64 encoded CDX string
- Return type
str
-
bond()¶ Atom neighbor method returns bond
- Returns
bond object
- Return type
-
bondBegin()¶ Bond method returns the begining atom index of the bond
- Returns
begining atom index
- Return type
int
-
bondEnd()¶ Bond method returns the ending atom index of the bond
- Returns
ending atom index
- Return type
int
-
bondIndex()¶ Bond method returns the bond index number
- Returns
bond index
- Return type
int
-
bondOrder()¶ Bond method returns bond order
- Returns
bond order
- Return type
int
-
bondStereo()¶ Bond method returns bond stereo
- Returns
bond stereo
- Return type
int
-
canonicalSmarts()¶ Molecule method returns canonical smarts
- Returns
canonical smarts
- Return type
str
-
canonicalSmiles()¶ Molecule or reaction method returns canonical smiles
- Returns
canonical smiles string
- Return type
str
-
cdxml()¶ Molecule method returns the structure as a string in CDXML format
- Returns
CDXML string
- Return type
str
-
changeStereocenterType(type_)¶ Atom method changes stereocenter type
- Parameters
type (int) – stereo type. * ABS = 1 * OR = 2 * AND = 3 * EITHER = 4
- Returns
1 if there are no errors
- Return type
int
-
charge()¶ Atom method returns the charge of the atom
- Returns
charge
- Return type
int
-
check(check_flags='')¶ Molecule method verifies the structure
- Parameters
check_flags (str) – Flags to verify. Optional, defaults to “”.
- Returns
verification result as a JSON string
- Return type
str
-
check3DStereo()¶ Molecule method verifies if the structure contains 3d stereo
- Returns
1 if structure contains 3d stereo, 0 otherwise
- Return type
int
-
checkAmbiguousH()¶ Molecule or reaction method validates ambiguous hydrogens
- Returns
string containing hydrogens validation errors
- Return type
str
-
checkBadValence()¶ Molecule, atom or reaction method validates bad valence
- Returns
string containing valence validation errors
- Return type
str
-
checkChirality()¶ Molecule method verifies if the structure has a chiral flag
- Returns
1 if there is chiral flag, 0 otherwise
- Return type
int
-
checkQuery()¶ Atom, Bond, Molecule, Reaction method verifies if object is query
- Returns
1 if object is query, 0 otherwise
- Return type
int
-
checkRGroups()¶ Molecule method verifies if the structure contains r-groups
- Returns
1 if molecule contains r-groups, 0 otherwise
- Return type
int
-
checkSalt()¶ Molecule method verifies if the structure contains salt.
- Returns
True if structure contains salt
- Return type
bool
-
checkStereo()¶ Molecule method verifies if the structure contains stereocenters
- Returns
1 if molecule contains stereo, 0 otherwise
- Return type
int
-
checkValence()¶ Atom method validates the valence
- Returns
1 if valence has no errors, 0 otherwise
- Return type
int
-
clean2d()¶ Molecule or reaction method recalculates coordinates
- Returns
1 if there are no errors
- Return type
int
-
clear()¶ Array, molecule or reaction method clears the object
- Returns
1 if there are no errors
- Return type
int
-
clearAAM()¶ Reaction method clears atom mapping for atoms
- Returns
1 if there are no errors
- Return type
int
-
clearAlleneCenters()¶ Molecule method clears allene centers
- Returns
1 if there are no errors
- Return type
int
-
clearAttachmentPoints()¶ Atom method clears attachment points
- Returns
1 if there are no errors
- Return type
int
-
clearCisTrans()¶ Molecule or reaction method clears cis-trans stereo
- Returns
1 if there are no errors
- Return type
int
-
clearProperties()¶ Object method clears all properties
- Returns
1 if there are no errors
- Return type
int
-
clearStereocenters()¶ Molecule or reaction method clears stereo centers
- Returns
1 if there are no errors
- Return type
int
-
clearXYZ()¶ Molecule method clear coordinates of atoms
- Raises
IndigoException – on error
- Returns
molecule ID
- Return type
list
-
clone()¶ Clones IndigoObject
- Returns
cloned object
- Return type
-
close()¶ FileOutput method closes file descriptor
- Returns
1 if file is closed successfully. -1 otherwise
- Return type
int
-
cml()¶ Molecule method returns the structure as a string in CML format
- Returns
CML string
- Return type
str
-
cmlAppend(item)¶ CML builder adds a new structure
- Parameters
item (IndigoObject) – new structure to be added
- Returns
1 if there are no errors
- Return type
int
CML builder adds footer information
- Returns
1 if there are no errors
- Return type
int
-
cmlHeader()¶ CML builder adds header
- Returns
1 if there are no errors
- Return type
int
-
component(index)¶ Molecule method returns component by index
- Parameters
index (int) – component index
- Returns
molecule component object
- Return type
-
componentIndex()¶ Atom method returns component index
- Returns
component index
- Return type
int
-
copyRGroups(other: indigo.indigo.indigo_object.IndigoObject) → None¶ Molecule method, copies RGroups from other molecule
-
correctReactingCenters()¶ Reaction method corrects reacting centers according to AAM
- Returns
1 if there are no errors
- Return type
int
-
count()¶ Loader method returns the number of elements
- Returns
number of elements
- Return type
int
-
countAlleneCenters()¶ Molecule method returns the number of allene centers
- Returns
number of allene centers
- Return type
int
-
countAtoms()¶ Molecule or SGroup method returns the number of atoms
- Returns
number of atoms
- Return type
int
-
countAttachmentPoints()¶ Molecule or RGroup method returns the number of attachment points
- Returns
number of attachment points
- Return type
int
-
countBits()¶ Fingerprint method returns the count of 1 bits
- Returns
number of 1 bits
- Return type
int
-
countBonds()¶ Molecule or SGroup method returns the number of bonds
- Returns
number of bonds
- Return type
int
-
countCatalysts()¶ Reaction method returns the number of catalysts
- Returns
number of catalysts
- Return type
int
-
countComponents()¶ Molecule method returns the number of components
- Returns
number of components
- Return type
int
-
countDataSGroups()¶ Molecule method returns the number of data s-groups
- Returns
number of s-groups
- Return type
int
-
countGenericSGroups()¶ Molecule method returns the number of generic s-groups
- Returns
number of generic s-groups
- Return type
int
-
countHeavyAtoms()¶ Molecule method returns the number of heavy atoms
- Returns
heavy atom count
- Return type
int
-
countHydrogens()¶ Atom or Molecule method returns the number of hydrogens
- Returns
number of hydrogens
- Return type
int
-
countImplicitHydrogens()¶ Atom or Molecule method returns the number of implicit hydrogens
- Returns
number of hydrogens
- Return type
int
-
countMatches(query)¶ Matcher method returns the number of matches
- Parameters
query (IndigoObject) – query structure
- Returns
number of matches
- Return type
int
-
countMatchesWithLimit(query, embeddings_limit)¶ Matcher method returns the number of matches with max limit
- Parameters
query (IndigoObject) – query structure
embeddings_limit (int) – max number of matches to search
- Returns
number of matches
- Return type
int
-
countMolecules()¶ - Reaction method returns the number of reactants, products, and
catalysts
- Returns
number of reactants, products, and catalysts
- Return type
int
-
countMultipleGroups()¶ Molecule method returns the number of multiple s-groups
- Returns
number of multiple s-groups
- Return type
int
-
countProducts()¶ Reaction method returns rge number of products
- Returns
number of products
- Return type
int
-
countPseudoatoms()¶ Molecule method returns the number of pseudoatoms
- Returns
number of pseudoatoms
- Return type
int
-
countRGroups()¶ Molecule method returns the number of r-groups
- Returns
number of r-groups
- Return type
int
-
countRSites()¶ Molecule method returns the number of r-sites
- Returns
number of r-sites
- Return type
int
-
countReactants()¶ Reaction method returns the number of reactants
- Returns
number of reactants
- Return type
int
-
countRepeatingUnits()¶ Molecule method returns the number of repeating units
- Returns
number of repeating units
- Return type
int
-
countSSSR()¶ - Molecule method returns the size of the smallest set of the smallest
rings
- Returns
SSSR rings count
- Return type
int
-
countStereocenters()¶ Molecule method returns the number of stereocenters
- Returns
number of stereocenters
- Return type
int
-
countSuperatoms()¶ Molecule method calculates the number of super atoms
- Returns
number of super atoms
- Return type
int
-
createEdgeSubmolecule(vertices, edges)¶ - Molecule method creates a submolecule from the given vertex atom
and bond list
- Parameters
vertices (list) – list of atom indexes
edges (list) – list of bond indexes
- Returns
molecule object as submolecule
- Return type
-
createSGroup(sgtype, mapping, name)¶ Molecule method creates an SGroup
- Parameters
sgtype (str) – sgroup type
mapping (IndigoObject) – mapping object
name (str) – sgroup name
- Returns
sgroup object
- Return type
-
createSubmolecule(vertices)¶ Molecule method creates a submolecule from the given atom list
- Parameters
vertices (list) – list of atom indexes
- Returns
molecule object as submolecule
- Return type
-
data()¶ Data s-group method returns data
- Returns
s-group data
- Return type
str
-
dbgInternalType()¶ Object method returns type
- Returns
object type string
- Return type
str
-
dearomatize()¶ Molecule or reaction method de-aromatizes the structure
- Returns
1 if there are no errors
- Return type
int
-
decomposeMolecule(mol)¶ Deconvolution method makes decomposition for the given molecule
- Parameters
mol (IndigoObject) – molecule to decompose
- Returns
deconvolution element object
- Return type
-
decomposedMoleculeHighlighted()¶ Deconvolution method returns decomposed highlighted molecule
- Returns
decomposed highlighted molecule
- Return type
-
decomposedMoleculeScaffold()¶ Deconvolution method starts molecule decomposition
- Returns
decomposed molecule
- Return type
-
decomposedMoleculeWithRGroups()¶ Deconvolution method returns decomposed molecule with R-groups
- Returns
decomposed molecule with R-groups
- Return type
-
degree()¶ Atom method returns the atom number of neighbors
- Returns
number of atom neighbors
- Return type
int
-
deleteSGroupAttachmentPoint(apidx)¶ SGroup method removes the attachment point
- Parameters
apidx (int) – attachment point index
- Returns
1 if there are no errors
- Return type
int
-
description()¶ Data s-group method returns description
- Returns
s-group description
- Return type
str
-
destination()¶ Bond method returns destination atom
- Returns
atom object
- Return type
-
dispose() → None¶
-
expandAbbreviations()¶ Molecule method expands abbreviations
- Returns
count of expanded abbreviations
- Return type
int
-
expandMonomers()¶ Molecule method expand selected monomers
- Returns
molecule object as submolecule
- Return type
-
fasta(library)¶ Molecule or reaction method returns FASTA for the structure
- Returns
FASTA string
- Return type
str
-
findSGroups(prop, val)¶ Molecule method finds SGroup by property and value
- Parameters
prop (str) – property string
val (str) – value string
- Returns
SGroup iterator
- Return type
-
findTemplate(name)¶ Molecule method finds template by name
- Parameters
name (str) – template name
- Returns
template index
- Return type
int
-
fingerprint(type_)¶ Molecule or reaction method returns fingerprint representation
- Parameters
type (str) – fingerprint type. One of the following: “sim”, “sub”, “sub-res”, “sub-tau”, “full”
- Returns
fingerprint object
- Return type
-
foldHydrogens()¶ Molecule or reaction method folds hydrogens
- Returns
1 if there are no errors
- Return type
int
-
foldUnfoldHydrogens()¶ Molecule or reaction method unfold hydrogens if no explicit hydrogens, otherwise - fold
- Returns
1 if there are no errors
- Return type
int
-
getAcidPkaValue(atom: indigo.indigo.indigo_object.IndigoObject, level, min_level)¶ Molecule method calculates acid pKa value
- Parameters
atom (int) – input atom index
level (int) – pka level
min_level (int) – pka min level
- Returns
pka result
- Return type
float
-
getAtom(idx)¶ Molecule method returns atom by index
- Parameters
idx (int) – atom index
- Returns
atom object
- Return type
-
getBasicPkaValue(atom, level, min_level)¶ Molecule method calculates basic pKa value
- Parameters
atom (IndigoObject) – input atom index
level (int) – pka level
min_level (int) – pka min level
- Returns
pka result
- Return type
float
-
getBond(idx)¶ Molecule method returns bond by index
- Parameters
idx (int) – bond index
- Returns
bond object
- Return type
-
getDataSGroup(index)¶ Molecule method returns a data s-group by index
- Parameters
index (int) – sgroup index
- Returns
data sgroup
- Return type
-
getExplicitValence()¶ Atom method returns the explicit valence
- Returns
valence
- Return type
int
-
getGenericSGroup(index)¶ Molecule method returns a generic s-group by index
- Parameters
index (int) – s-group index
- Returns
generic s-group
- Return type
-
getHybridization()¶ Atom method returns HybridizationType
- Returns
atom hybridization
- Return type
-
getHybridizationStr()¶ Atom method returns hybridization type string
- Returns
atom hybridization
- Return type
str
-
getMolecule(index)¶ Reaction method returns a molecule by index
- Parameters
index (int) – molecule index
- Returns
molecule object
- Return type
-
getMultipleGroup(index)¶ Molecule method returns a Multiple s-group by index
- Parameters
index (int) – mul s-group index
- Returns
mul s-group
- Return type
-
getOriginalFormat()¶ Molecule method return format molecule loaded from
- Returns
original format string
- Return type
str
-
getProperty(prop)¶ Object method returns property by the given name
- Parameters
prop (str) – property name
- Returns
property value
- Return type
str
-
getRepeatingUnit(index)¶ Molecule method returns a repeating unit by index
- Parameters
index (int) – repeating unit index
- Returns
repeating unit
- Return type
-
getRepeatingUnitConnectivity()¶ Repeating unit method returns connectivity
- Returns
connectivity value
- Return type
int
-
getRepeatingUnitSubscript()¶ Repeating unit method returns subscript
- Returns
subscript value
- Return type
str
-
getSGroupClass()¶ SGroup method returns sgroup class
- Returns
sgroup class string
- Return type
str
-
getSGroupCoords()¶ Sgroup method returns coordinates
- Raises
IndigoException – if no coordinates exist for the sgroup
- Returns
[x, y] coordinates
- Return type
list
-
getSGroupDisplayOption()¶ SGroup method returns display option
- Returns
display option
- Return type
int
-
getSGroupIndex()¶ SGroup method returns index
- Returns
sgroup index
- Return type
int
-
getSGroupMultiplier()¶ Multiple group method returns multiplier
- Returns
multiplier value
- Return type
int
-
getSGroupName()¶ SGroup method returns sgroup name
- Returns
sgroup name string
- Return type
str
-
getSGroupNumCrossBonds()¶ SGroup method returns the number of cross bonds
- Returns
number of cross bonds
- Return type
int
-
getSGroupOriginalId()¶ SGroup method returns original id
- Returns
original id
- Return type
int
-
getSGroupParentId()¶ SGroup method returns parent id
- Returns
parent id
- Return type
int
-
getSGroupSeqId()¶ SGroup method returns SEQID
- Returns
SEQID value
- Return type
int
-
getSGroupType()¶ SGroup method returns type
- Returns
sgroup type
- Return type
int
-
getSubmolecule(vertices)¶ Molecule method returns submolecule by the given atom list
- Parameters
vertices (list) – list of atom indexes
- Returns
submolecule object
- Return type
-
getSuperatom(index)¶ Molecule method returns a superatom by index
- Parameters
index (int) – super atom index
- Returns
super atom
- Return type
-
getTGroupAlias()¶ TGroup method returns alias
- Returns
alias value
- Return type
str
-
getTGroupClass()¶ TGroup method returns class
- Returns
class value
- Return type
str
-
getTGroupName()¶ TGroup method returns name
- Returns
name value
- Return type
str
-
getTemplateAtomClass()¶ Atom method returns template class
- Returns
template class
- Return type
str
-
grossFormula()¶ Molecule method returns gross formula
- Returns
gross formula
- Return type
str
-
hasCoord()¶ Molecule method returns True if the structure contains coordinates
- Returns
True if contains coordinates, False otherwise
- Return type
bool
-
hasNext()¶ Iterator method checks presence of a next element
- Returns
true if collection has a next element, false otherwise
- Return type
bool
-
hasProperty(prop)¶ Object method returns True if the given property exists
- Parameters
prop (str) – property name
- Returns
flag True if property exists
- Return type
bool
-
hasSelection()¶ Molecule or reaction method returns True if has selection
- Returns
True if has selection, False otherwise
- Return type
bool
-
hasZCoord()¶ Molecule method returns True if the structure contains Z coordinate
- Returns
True if contains Z coordinate, False otherwise
- Return type
bool
-
hash()¶ Molecule or Reaction method returns hash code
- Returns
hash
- Return type
int
-
helm(library)¶ Molecule or reaction method returns Helm for the structure
- Returns
HELM string
- Return type
str
-
highlight()¶ Atom or bond method to add highlighting
- Returns
1 if there are no errors
- Return type
int
-
highlightedTarget()¶ Mapping method returns highlighted target
- Returns
highlighted molecule structure
- Return type
-
idt(library)¶ Molecule or reaction method returns IDT for the structure
- Returns
IDT string
- Return type
str
-
ignoreAtom(atom_object)¶ Matcher method adds atom to ignore list
- Parameters
atom_object (IndigoObject) – atom to ignore
- Returns
1 if there are no errors
- Return type
int
-
index()¶ Atom method returns index of the element
- Returns
element index
- Return type
int
-
invertStereo()¶ Atom or bond method inverts stereo
- Returns
1 if there are no errors
- Return type
int
-
ionize(ph, ph_toll)¶ Method for structure ionization at specified pH and pH tolerance
- Parameters
ph (float) – pH value
ph_toll (float) – pH tolerance
- Returns
1 if ionization is performed without issues
- Return type
int
-
isChiral()¶ Molecule method returns True if the structure contains chiral flag
- Returns
True if contains chiral flag, False otherwise
- Return type
bool
-
isHighlighted()¶ Atom or bond method returns True if highlighted
- Returns
True if highlighted, False otherwise
- Return type
bool
-
isPossibleFischerProjection(options)¶ - Molecule method returns True if the structure contains possible
Fischer projection
- Parameters
options (str) – projection options
- Returns
True if structure contains possible Fischer projection
- Return type
bool
-
isPseudoatom()¶ Atom method returns true if atom is pseudoatom
- Returns
True if pseudoatom
- Return type
bool
-
isRSite()¶ Atom method returns true if atom is R-site
- Returns
True if R-site
- Return type
bool
-
isSelected()¶ Atom or bond method returns True if selected
- Returns
True if selected, False otherwise
- Return type
bool
-
isTemplateAtom()¶ Atom method returns true if atom is a template atom
- Returns
True if template
- Return type
bool
-
isotope()¶ Atom method returns the isotope number
- Returns
isotope number
- Return type
int
-
iterateAlleneCenters()¶ - Molecule method returns an iterator for all atoms with allene
centers
- Returns
atom iterator
- Return type
-
iterateArray()¶ Array method returns iterator for elements
- Returns
elements iterator
- Return type
-
iterateAtoms()¶ Molecule method returns an iterator for all atoms including r-sites and pseudoatoms
- Returns
atom iterator
- Return type
-
iterateAttachmentPoints(order)¶ Molecule method iterates attachment points
- Parameters
order (int) – attachment points order
- Returns
attachment points iterator
- Return type
-
iterateBonds()¶ Molecule or SGroup method returns bonds iterator
- Returns
bonds iterator
- Return type
-
iterateCatalysts()¶ Reaction method iterates catalysts
- Returns
catalyst iterator
- Return type
-
iterateComponents()¶ Molecule method returns components iterator
- Returns
molecule components iterator
- Return type
-
iterateDataSGroups()¶ Molecule method iterates data s-groups
- Returns
s-groups iterator
- Return type
-
iterateDecomposedMolecules()¶ Deconvolution method returns decomposed molecules iterator
- Returns
decomposed molecules iterator
- Return type
-
iterateDecompositions()¶ Deconvolution element method returns decompositions iterator
- Returns
decompositions iterator
- Return type
-
iterateEdgeSubmolecules(min_bonds, max_bonds)¶ Molecule method returns edge submolecules iterator
- Parameters
min_bonds (int) – min bonds neighbors limit
max_bonds (int) – max bonds neighbors limit
- Returns
submolecules iterator
- Return type
-
iterateGenericSGroups()¶ Molecule method iterates generic s-groups
- Returns
generic s-groups iterator
- Return type
-
iterateMatches(query)¶ Matcher method returns matches iterator
- Parameters
query (IndigoObject) – query structure
- Returns
matches iterator
- Return type
-
iterateMolecules()¶ Reaction method iterates molecules
- Returns
reactant, products, and catalysts iterator
- Return type
-
iterateMultipleGroups()¶ Molecule method iterates Multiple s-groups
- Returns
Mul s-groups iterator
- Return type
-
iterateNeighbors()¶ Atom method returns neighbors iterator
- Returns
atom neighbor iterator
- Return type
-
iterateProducts()¶ Reaction method iterates products
- Returns
product iterator
- Return type
-
iterateProperties()¶ Object method returns properties iterator
- Returns
properties iterator
- Return type
-
iteratePseudoatoms()¶ Molecule method returns an iterator for all pseudoatoms
- Returns
atom iterator
- Return type
-
iterateRGroupFragments()¶ RGroup method iterates r-group fragments
- Returns
r-group fragment iterator
- Return type
-
iterateRGroups()¶ Molecule method returns an iterator for all r-group
- Returns
r-group iterator
- Return type
-
iterateRSites()¶ Molecule method returns an iterator for all r-sites
- Returns
atom iterator
- Return type
-
iterateReactants()¶ Reaction method iterates reactants
- Returns
reactant iterator
- Return type
-
iterateReactions()¶ Reaction method iterates reactions
- Returns
reaction iterator
- Return type
-
iterateRepeatingUnits()¶ Molecule method iterates repeating units
- Returns
repeating units iterator
- Return type
-
iterateRings(min_atoms, max_atoms)¶ Molecule method returns rings iterator
- Parameters
min_atoms (int) – min atoms neighbors limit
max_atoms (int) – max atoms neighbors limit
- Returns
rings iterator
- Return type
-
iterateSGroups()¶ Molecule method iterates s-groups
- Returns
s-groups iterator
- Return type
-
iterateSSSR()¶ - Molecule method returns the smallest set of the smallest rings
iterator
- Returns
SSSR iterator
- Return type
-
iterateStereocenters()¶ Molecule method returns an iterator for all atoms with stereocenters
- Returns
atom iterator
- Return type
-
iterateSubtrees(min_atoms, max_atoms)¶ Molecule method returns subtrees iterator
- Parameters
min_atoms (int) – min atoms neighbors limit
max_atoms (int) – max atoms neighbors limit
- Returns
subtrees iterator
- Return type
-
iterateSuperatoms()¶ Molecule method iterates superatoms
- Returns
superatoms iterator
- Return type
-
iterateTGroups()¶ Molecule method iterates t-groups
- Returns
t-groups iterator
- Return type
-
json()¶ Structure method returns the structure as a string in KET format
- Returns
KET format for the structure
- Return type
str
-
layeredCode()¶ Molecule method returns layered code
- Returns
layered code string
- Return type
str
-
layout()¶ Molecule or reaction method calculates layout for the structure
- Returns
1 if there are no errors
- Return type
int
-
logP()¶ Molecule method returns calculated Crippen logP value
- Returns
calculated logP value of the molecule
- Return type
float
-
macroProperties(upc, nac)¶ Method return macro-molecules properties
- Returns
json with properties
- Return type
str
-
mapAtom(atom)¶ Mapping method returns mapped atom for the given atom
- Parameters
atom (IndigoObject) – query atom to map
- Returns
mapped atom
- Return type
-
mapBond(bond)¶ Mapping method returns mapped bond for the given bond
- Parameters
bond (IndigoObject) – query bond to map
- Returns
mapped bond
- Return type
-
mapMolecule(molecule)¶ - Reaction mapping method returns mapped molecule for the given query
molecule
- Parameters
molecule (IndigoObject) – query molecule to map
- Returns
mapped molecule
- Return type
-
markEitherCisTrans()¶ Molecule or reaction method marks cis-trans stereo
- Returns
number of marked stereo
- Return type
int
-
markStereobonds()¶ Molecule or reaction method marks stereo bonds
- Returns
0 if there are no errors
- Return type
int
-
massComposition()¶ Molecule method returns mass composition
- Returns
mass composition string
- Return type
str
-
match(query)¶ Matcher method executes matching
- Parameters
query (IndigoObject) – query structure
- Returns
mapping object
- Return type
-
mdlct()¶ Gets MDL CT as a buffer
- Returns
buffer containing the MDLCT
- Return type
-
merge(what)¶ Molecule method merges molecule with the given structure
- Parameters
what (IndigoObject) – molecule object to merge with
- Returns
mapping object for merged structure
- Return type
-
molarRefractivity()¶ Molecule method returns calculated Crippen molar refractivity
- Returns
calculated value of molar refractivity
- Return type
float
-
molecularFormula()¶ Molecule or reaction method returns IUPAC molecular formula
- Returns
IUPAC molecular formula
- Return type
str
-
molecularWeight()¶ Molecule method returns molecular weight
- Returns
molecular weight value
- Return type
float
-
molfile()¶ Molecule method returns the structure as a string in Molfile format
- Returns
Molfile string
- Return type
str
-
monoisotopicMass()¶ Molecule method returns the monoisotopic mass
- Returns
monoisotopic mass
- Return type
float
-
mostAbundantMass()¶ Molecule method returns the most abundant mass
- Returns
most abundant mass
- Return type
float
-
name()¶ IndigoObject method returns name
- Returns
name string
- Return type
str
-
next()¶ Generic iterator method
- Returns
next item in the collection
- Return type
-
normalize(options='')¶ Molecule method for structure normalization. It neutralizes charges, resolves 5-valence Nitrogen, removes hydrogens, etc.
- Parameters
options (str) – Normalization options. Optional, defaults to “”.
- Returns
1 if normalization is performed without issues
- Return type
int
-
numHydrogenBondAcceptors()¶ Molecule method returns the number of hydrogen bond acceptors
- Returns
number of hydrogen bond acceptors
- Return type
float
-
numHydrogenBondDonors()¶ Molecule method returns the number of hydrogen bond donors
- Returns
number of hydrogen bond donors
- Return type
float
-
numRotatableBonds()¶ Molecule method returns the number of rotatable bonds
- Returns
number of rotatable bonds
- Return type
int
-
oneBitsList()¶ Returns string representation of fingerprint
- Returns
ones bits string for the fingerprint
- Return type
str
-
optimize(options='')¶ QueryReaction or QueryMolecule method for query optimizations for faster substructure search
- Parameters
options (str) – Options for optimization. Optional, defaults to “”.
- Returns
1 if optimization is performed without issues
- Return type
int
-
pKa()¶ Molecule method returns calculated Lee-Crippen SMARTS pKa value
- Returns
calculated pKa value of the molecule
- Return type
float
-
pKaValues()¶ Molecule method returns calculated Lee-Crippen SMARTS pKa values
- Returns
calculated pKa values of the molecule
- Return type
array of floats
-
radical()¶ Atom method returns the radical value
- Returns
radical value
- Return type
int
-
radicalElectrons()¶ Atom method returns the number of radical electrons
- Returns
radical electrons number
- Return type
int
-
rawData()¶ Object method returns string representation
- Returns
string for the object
- Return type
str
-
rdfAppend(item)¶ RDF builder method adds a new structure
- Parameters
item (IndigoObject) – new structure to be added
- Returns
1 if there are no errors
- Return type
int
-
rdfHeader()¶ RDF builder adds header
- Returns
1 if there are no errors
- Return type
int
-
reactingCenter(reaction_bond)¶ Reaction bond method returns reacting center
- Parameters
reaction_bond (IndigoObject) – reaction molecule bond
- Returns
- reacting center enum. One of values
RC_NOT_CENTER = -1
RC_UNMARKED = 0
RC_CENTER = 1
RC_UNCHANGED = 2
RC_MADE_OR_BROKEN = 4
RC_ORDER_CHANGED = 8
- Return type
int
-
remove()¶ Container method removes the element from its container
- Returns
1 if element was removed
- Return type
int
-
removeAtoms(vertices)¶ Molecule method removes atoms
- Parameters
vertices (list) – atom indexes list
- Returns
1 if there are no errors
- Return type
int
-
removeBonds(bonds)¶ Molecule method removes bonds
- Parameters
bonds (list) – bond indexes list
- Returns
1 if there are no errors
- Return type
int
-
removeConstraints(type_)¶ Atom method removes constraints
- Parameters
type (str) – constraint type
- Returns
1 if there are no errors
- Return type
int
-
removeProperty(prop)¶ Object method removes property
- Parameters
prop (str) – property name
- Returns
1 if there are no errors
- Return type
int
-
removeTemplate(name)¶ Molecule method removes template TGroup by name
- Parameters
name (str) – template name
- Returns
1 if there are no errors
- Return type
int
-
resetAtom(symbol)¶ Atom method resets atom to the new symbol
- Parameters
symbol (str) – atom symbol
-
resetCharge()¶ Atom method resets charge
- Returns
1 if there are no errors
- Return type
int
-
resetExplicitValence()¶ Atom method resets explicit valence
- Returns
1 if there are no errors
- Return type
int
-
resetIsotope()¶ Atom method resets isotope
- Returns
1 if there are no errors
- Return type
int
-
resetRadical()¶ Atom method resets radical
- Returns
1 if there are no errors
- Return type
int
-
resetStereo()¶ Atom or bond method resets stereo
- Returns
1 if there are no errors
- Return type
int
-
resetSymmetricCisTrans()¶ Molecule or reaction method clears symmetric stereo cis-trans
- Returns
number of reset centers
- Return type
int
-
resetSymmetricStereocenters()¶ Molecule or reaction method clears symmetric stereocenters
- Returns
number of reset centers
- Return type
int
-
rxnfile()¶ Reaction method returns the reaction as a string in RXN format
- Returns
RXN string
- Return type
str
-
saveCdx(filename)¶ Molecule method saves the structure into a CDX file
- Parameters
filename (str) – full path to the output file
- Returns
1 if the file is saved successfully
- Return type
int
-
saveCdxml(filename)¶ Molecule method saves the structure into a CDXML file
- Parameters
filename (str) – full path to the output file
- Returns
1 if the file is saved successfully
- Return type
int
-
saveCml(filename)¶ Molecule method saves the structure into a CML file
- Parameters
filename (str) – full path to the output file
- Returns
1 if the file is saved successfully
- Return type
int
-
saveFasta(filename, library)¶ Saves macromolecule to FASTA file
- Parameters
filename (str) – full file path to the output file
- Returns
1 if file is saved successfully
- Return type
int
-
saveHelm(filename, library)¶ Saves macromolecule to HELM file
- Parameters
filename (str) – full file path to the output file
- Returns
1 if file is saved successfully
- Return type
int
-
saveIdt(filename, library)¶ Saves macromolecule to IDT file
- Parameters
filename (str) – full file path to the output file
- Returns
1 if file is saved successfully
- Return type
int
-
saveMDLCT(output)¶ Structure method saves the structure in MDLCT format into a buffer
- Parameters
output (IndigoObject) – buffer to be updated
- Returns
1 if the structure is saved
- Return type
int
-
saveMolfile(filename)¶ Molecule method saves the structure into a Molfile
- Parameters
filename (str) – full file path to the output file
- Returns
1 if file is saved successfully
- Return type
int
-
saveRxnfile(filename)¶ Reaction method saves the reaction into an RXN file
- Parameters
filename (str) – output file path for the reaction
- Returns
1 if everything is saved without issues
- Return type
int
-
saveSequence(filename, library)¶ Saves macromolecule to monomers sequence file
- Parameters
filename (str) – full file path to the output file
- Returns
1 if file is saved successfully
- Return type
int
-
saveSequence3Letter(filename, library)¶ Saves macromolecule to monomers 3 letter sequence file
- Parameters
filename (str) – full file path to the output file
- Returns
1 if file is saved successfully
- Return type
int
-
sdfAppend(item)¶ SDF method adds a new structure
- Parameters
item (IndigoObject) – structure to be added
- Returns
1 if there are errors
- Return type
int
-
sequence(library)¶ Molecule or reaction method returns monomer sequence for the structure
- Returns
sequence string
- Return type
str
-
sequence3Letter(library)¶ Molecule or reaction method returns monomer 3 letter sequence for the structure
- Returns
sequence string
- Return type
str
-
serialize() → bytes¶ IndigoObject method serializes the object into byte array
- Returns
array of bytes
- Return type
list
-
setAtomMappingNumber(reaction_atom, number)¶ Reaction atom method sets atom mapping
- Parameters
reaction_atom (IndigoObject) – reaction molecule atom
number (int) – atom mapping
- Returns
1 if atom mapping is set
- Return type
int
-
setAttachmentPoint(order)¶ Atom method sets attachment point
- Parameters
order (int) – attachment point order
- Returns
1 if there are no errors
- Return type
int
-
setBondOrder(order)¶ Bond method sets order
- Parameters
order (int) – order value
- Returns
1 if there are no errors
- Return type
int
-
setCharge(charge)¶ Atom method sets charge
- Parameters
charge (int) – charge value
- Returns
1 if there are no errors
- Return type
int
-
setDataSGroupXY(x, y, options='')¶ SGroup method sets coordinates
- Parameters
x (float) – X coordinate
y (float) – Y coordinate
options (str) – options. Optional, defaults to “”.
- Returns
1 if there are no errors
- Return type
int
-
setExplicitValence(valence)¶ Atom method sets the explicit valence
- Parameters
valence (int) – valence
- Returns
1 if there are no errors
- Return type
int
-
setImplicitHCount(impl_h)¶ Atom method sets implicit hydrogen count
- Parameters
impl_h (int) – implicit hydrogen count
- Returns
1 if there are no errors
- Return type
int
-
setIsotope(isotope)¶ Atom method sets isotope
- Parameters
isotope (int) – isotope value
- Returns
1 if there are no errors
- Return type
int
-
setName(name)¶ IndigoObject method sets name
- Parameters
name (str) – name string
- Returns
1 if there are no errors
- Return type
int
-
setProperty(prop, value)¶ Object method sets property
- Parameters
prop (str) – property name
value (str) – property value
- Returns
1 if there are no errors
- Return type
int
-
setRSite(name)¶ Atom method sets r-site
- Parameters
name (str) – r-site name
- Returns
1 if there are no errors
- Return type
int
-
setRadical(radical)¶ Atom method sets the radical value
- Parameters
radical (int) – radical value
- Returns
1 if there are no errors
- Return type
int
-
setReactingCenter(reaction_bond, rc)¶ Reaction bond method sets reacting center
- Parameters
reaction_bond (IndigoObject) – reaction molecule bond
rc (int) – reacting center, one of the following * RC_NOT_CENTER = -1 * RC_UNMARKED = 0 * RC_CENTER = 1 * RC_UNCHANGED = 2 * RC_MADE_OR_BROKEN = 4 * RC_ORDER_CHANGED = 8
- Returns
1 if there are no errors
- Return type
int
-
setSGroupBrackets(style, x1, y1, x2, y2, x3, y3, x4, y4)¶ SGroup method sets brackets
- Parameters
style (int) – bracket style
x1 (float) – X1 coordinate
y1 (float) – Y1 coordinate
x2 (float) – X2 coordinate
y2 (float) – Y2 coordinate
x3 (float) – X3 coordinate
y3 (float) – Y3 coordinate
x4 (float) – X4 coordinate
y4 (float) – Y4 coordinate
- Returns
1 if there are no errors
- Return type
int
-
setSGroupClass(sgclass)¶ SGroup method sets class
- Parameters
sgclass (str) – sgroup class
- Returns
1 if there are no errors
- Return type
int
-
setSGroupCoords(x, y)¶ SGroup method sets coordinates
- Parameters
x (float) – X coordinate
y (float) – Y coordinate
- Returns
1 if there are no errors
- Return type
int
-
setSGroupData(data)¶ SGroup method adds data
- Parameters
data (str) – data string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupDataType(data_type)¶ SGroup method sets data type
- Parameters
data_type (str) – data type string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupDescription(description)¶ SGroup method sets description
- Parameters
description (str) – description string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupDisplay(option)¶ SGroup method sets display
- Parameters
option (str) – display string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupDisplayOption(option)¶ SGroup method sets display option
- Parameters
option (int) – display option
- Returns
1 if there are no errors
- Return type
int
-
setSGroupFieldName(name)¶ SGroup method sets field name
- Parameters
name (str) – name string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupLocation(option)¶ SGroup method sets location
- Parameters
option (str) – location string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupMultiplier(mult)¶ Multiple group sets multiplier value
- Parameters
mult (int) – multiplier value
- Returns
1 if there are no errors
- Return type
int
-
setSGroupName(sgname)¶ SGroup method sets group name
- Parameters
sgname (str) – sgroup name string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupOriginalId(original)¶ SGroup method sets original id
- Parameters
original (int) – original id value
- Returns
1 if there are no errors
- Return type
int
-
setSGroupParentId(parent)¶ SGroup method sets parent id
- Parameters
parent (int) – parent id
- Returns
1 if there are no errors
- Return type
int
-
setSGroupQueryCode(code)¶ SGroup methods sets query code
- Parameters
code (str) – code string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupQueryOper(oper)¶ SGroup method sets query oper
- Parameters
oper (str) – query oper string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupTag(tag)¶ SGroup method sets tag
- Parameters
tag (str) – tag string
- Returns
1 if there are no errors
- Return type
int
-
setSGroupTagAlign(tag_align)¶ SGroup method sets tag align
- Parameters
tag_align (int) – tag align value
- Returns
1 if there are no errors
- Return type
int
-
setSGroupXCoord(x)¶ Sgroup method sets X coordinate
- Parameters
x (float) – X coordinate
- Returns
1 if there are no errors
- Return type
int
-
setSGroupYCoord(y)¶ Sgroup method sets Y coordinate
- Parameters
y (float) – Y coordinate
- Returns
1 if there are no errors
- Return type
int
-
setStereocenterGroup(group)¶ Atom method sets stereocenter group
- Parameters
group (int) – group index
-
setTemplateAtomClass(name)¶ Atom method sets template class
- Parameters
name (str) – class name
- Returns
1 if there are no errors
- Return type
int
-
setXYZ(x, y, z)¶ Atom methods sets the given coordinates
- Parameters
x (float) – X coordinate
y (float) – Y coordinate
z (float) – Z coordinate
- Returns
1 if there are no errors
- Return type
int
-
singleAllowedRGroup()¶ Atom method returns single allowed r-group
- Returns
single allowed r-group
- Return type
int
-
smarts()¶ Molecule or reaction method calculates SMARTS for the structure
- Returns
smarts string
- Return type
str
-
smiles()¶ Molecule or reaction method calculates SMILES for the structure
- Returns
smiles string
- Return type
str
-
smilesAppend(item)¶ Smiles builder methods adds a new structure
- Parameters
item (IndigoObject) – structure to be added
- Returns
1 if there are no errors
- Return type
int
-
source()¶ Bond method returns source atom
- Returns
atom object
- Return type
-
standardize()¶ Molecule method for structure standardization. It standardizes charges, stereo, etc.
- Returns
1 if standardization is performed without issues
- Return type
int
-
stereocenterCIPDescriptor()¶ Atom method returns the cip descriptor of the given atom
- Returns
- atom cip descriptor
NONE = 0
UNKNOWN = 1
s = 2
r = 3
S = 4
R = 5
E = 6
Z = 7
- Return type
int
-
stereocenterGroup()¶ Atom method returns stereocenter group
- Returns
group index
- Return type
int
-
stereocenterPyramid()¶ Atom method returns stereopyramid information
- Returns
stereopyramid information string
- Return type
str
-
stereocenterType()¶ Atom method returns stereo center type
- Returns
- type of stereocenter
ABS = 1
OR = 2
AND = 3
EITHER = 4
- Return type
int
-
stripSalt(inplace=False)¶ Molecule method strips all inorganic components.
- Parameters
inplace (bool) – if False - returns the copy of the molecule, without inorganic components, if True - strips inorganic components from the molecule itself.
- Returns
- if inplace=False - new molecule without inorganic
components, if inplace=True - initial molecule without inorganic components.
- Return type
-
symbol()¶ Atom method returns string symbol
- Returns
atom symbol
- Return type
str
-
symmetryClasses() → Tuple[int, …]¶ Molecule method returns symmetry classes
- Returns
symmetry classes integer sequence
- Return type
Tuple[int, ..]
-
tell()¶ - Object method returns the size of the content, e.g. SDF number of
structures
- Returns
size of the content
- Return type
int
-
toBuffer() → bytes¶ Object method returns binary representation
- Returns
array of bytes
- Return type
list
-
toString()¶ Object method returns string representation
- Returns
string representation for the object
- Return type
str
-
topology()¶ Bond method returns bond topology
- Returns
bond topology
- Return type
int
-
tpsa(include_sp=False)¶ Molecule method returns the TPSA value
- Parameters
include_sp (bool) – include S and P atoms to TPSA calculation, false by default
- Returns
TPSA value
- Return type
float
-
transformCTABtoSCSR(templates)¶ Molecule method transforms CTAB to SCSR using templates
- Parameters
templates (IndigoObject) – Molecule object with templates
- Returns
1 if there are no errors
- Return type
int
-
transformSCSRtoCTAB()¶ Molecule method transforms SCSR to full CTAB
- Returns
1 if there are no errors
- Return type
int
-
unfoldHydrogens()¶ Molecule or reaction method unfolds hydrogens
- Returns
1 if there are no errors
- Return type
int
-
unhighlight()¶ Atom or bond method to remove highlighting
- Returns
1 if there are no errors
- Return type
int
-
unignoreAllAtoms()¶ Matcher method clears ignore list
- Returns
1 if there are no errors
- Return type
int
-
unignoreAtom(atom_object)¶ Matcher method removes atom from ignore list
- Parameters
atom_object (IndigoObject) – atom to remove from ignore
- Returns
1 if there are no errors
- Return type
int
-
valence()¶ Atom method returns the valence
- Returns
atom valence
- Return type
int
-
validateChirality()¶ Molecule or reaction method validates chirality
-
xyz()¶ Atom method gets coordinates of atom
- Raises
IndigoException – if no XYZ coordinates for the object
- Returns
3-element array with coordinates
- Return type
list
-
IndigoException¶
-
class
indigo.IndigoException(value: Union[str, bytes])¶ Common Exception class for Indigo
IndigoRenderer¶
-
class
indigo.renderer.IndigoRenderer(session: indigo.indigo.indigo.Indigo)¶ -
renderGridToBuffer(objects: indigo.indigo.indigo_object.IndigoObject, refatoms: Sequence[int], ncolumns: int) → bytes¶ Renders grid to buffer
- Parameters
objects (IndigoObject) – array of objects
refatoms (Sequence[int]) – array or reference atoms
ncolumns (int) – number of columns
- Raises
IndigoException – if any error while rendering
- Returns
buffer byte array
- Return type
list
-
renderGridToFile(objects: indigo.indigo.indigo_object.IndigoObject, refatoms: Sequence[int], ncolumns: int, filename: str) → None¶ Renders grid to file
- Parameters
objects (IndigoObject) – array of objects
refatoms (Sequence[int]) – array or reference atoms
ncolumns (int) – number of columns
filename (str) – full file path
- Raises
IndigoException – if any error while rendering
-
renderToBuffer(obj: indigo.indigo.indigo_object.IndigoObject) → bytes¶ Renders object to buffer
- Parameters
obj (IndigoObject) – object to render
- Returns
buffer with byte array
-
renderToFile(obj: indigo.indigo.indigo_object.IndigoObject, filename: str) → None¶ Renders to file
- Parameters
obj (IndigoObject) – object to render
filename (str) – full file path
-
renderToString(obj: indigo.indigo.indigo_object.IndigoObject) → str¶ Renders object to string
- Parameters
obj (IndigoObject) – object to render
- Returns
string with rendered data
- Return type
str
-
IndigoInchi¶
-
class
indigo.inchi.IndigoInchi(session: indigo.indigo.indigo.Indigo)¶ -
getAuxInfo() → str¶ Returns aux info for the InChi
- Returns
InChi aux info string
- Return type
str
-
getInchi(molecule: indigo.indigo.indigo_object.IndigoObject) → str¶ Returns InChi string for Indigo molecule
- Parameters
molecule (IndigoObject) – molecule object
- Returns
InChi string
- Return type
str
-
getInchiKey(inchi: str) → str¶ Returns InChi key for InChi string
- Parameters
inchi (str) – InChi string
- Returns
InChi key
- Return type
str
-
getLog() → str¶ Returns logs while InChi calculation
- Returns
log string
- Return type
str
-
getWarning() → str¶ Returns warning message
- Returns
warning string
- Return type
str
-
loadMolecule(inchi: str) → indigo.indigo.indigo_object.IndigoObject¶ Loads molecule from InChi string
- Parameters
inchi (str) – InChi string
- Returns
molecule object
- Return type
-
resetOptions() → None¶ Resets options for InChi
-
version() → str¶ Returns InChi version
- Returns
version string
- Return type
str
-