SMILES Base#
- class autode.smiles.base.RingBond(idx_i, symbol, bond_idx=None)#
Dangling bond created when a ring is found
- __init__(idx_i, symbol, bond_idx=None)#
Initialise the bond with a non-existent large index
- Parameters:
symbol (str) – Symbol of this bond, in bond_order_symbols
bond_idx (None | int) – Index for this bond in the bond list
- close(idx, symbol)#
Close this bond using an atom index
- in_ring(rings_idxs)#
Is this bond a constituent of a ring
- Return type:
(bool)
- class autode.smiles.base.SMILESAtom(label: str, stereochem: SMILESStereoChem = SMILESStereoChem.NONE, n_hydrogens: int | None = None, charge: int = 0, atom_class: int | None = None)#
Atom in a SMILES string
- __init__(label: str, stereochem: SMILESStereoChem = SMILESStereoChem.NONE, n_hydrogens: int | None = None, charge: int = 0, atom_class: int | None = None)#
SMILES atom initialised at the origin
determined implicitly
- Parameters:
stereochem – Point stereochemistry around this atom (R, S)
charge – Formal charge on this atom
atom_class – Class of an atom. See §3.1.7 in the SMILES spec http://opensmiles.org/opensmiles.html
- property has_stereochem#
Does this atom have associated stereochemistry?
- invert_stereochem()#
Invert the stereochemistry at this centre
- property is_aromatic#
Is this atom ‘aromatic’?
- is_pi(valency: int = 0) bool #
Determine if this atom is a ‘π-atom’ i.e. is unsaturated. Only approximate! Example:
>>> import autode as ade >>> ade.Atom('C').is_pi(valency=3) True >>> ade.Atom('H').is_pi(valency=1) False
- Return type:
(bool)
- property is_shifted#
Has this atom been shifted from the origin?
- property n_bonded#
How many atoms are bonded to this one?
- class autode.smiles.base.SMILESBond(idx_i: int, idx_j: int, symbol: str)#
Bond in a SMILES string
- __init__(idx_i: int, idx_j: int, symbol: str)#
Bond between two atoms from a SMILES string, sorted from low to high
- Parameters:
idx_j (int)
symbol (str) – Bond order symbol
- property atom_indexes#
Atom indexes for the atoms in this bond
- distance(atoms)#
Distance of this bond (Å) given a set of atoms
- in_ring(rings_idxs)#
Is this bond a constituent of a ring
- Return type:
(bool)
- is_cis(atoms)#
Is this bond a cis double bond?
- is_trans(atoms)#
Is this bond a trans double bond?
Undefined stereochemistry defaults to trans
- property symbol#
SMILES symbol for this bond e.g. # for a triple bond
- class autode.smiles.base.SMILESBonds(iterable=(), /)#
- append(bond: SMILESBond)#
Add another SMILESBond to this list
- first_involving(*args)#
First bond that includes some atom indexes
- insert(index: SupportsIndex, bond: SMILESBond)#
Insert a bond into this list if it does not already exist
- involving(*args)#
Get all the bonds involving a particular atom (given as a index)
- Return type:
(list(autode.smiles.SMILESBond))
- n_involving(idx)#
How many bonds does an atom (given as a index) have?